How b3yotch/marketing-automation works
This repository implements an ecommerce-ad creative workflow: a product-page URL is researched, turned into creative direction and generation prompts, used to generate images, judged to select a source frame, and optionally used to generate video. The shared pipeline runner owns the ordered stages; each agent is a LangGraph subgraph. The README documents the stages and bulk-run modes, while sampled source confirms several internal calls. Some subsystem details are documented but not sampled, so those links rely on the README rather than inferred implementation.
Main entry points: pipeline.py Stage runner · creative_strategy_agent/nodes.py Creative strategy · video_generation/nodes.py Video generation · research_agent/nodes.py Product research
Components 21
Workflow orchestration
- Stage runner
app/core/pipeline.py
Research and strategy
- Product research
app/agents/research_agent/nodes.py - Page scraper
app/agents/research_agent/scraper.py - Research contract
app/agents/research_agent/schema.py - Creative strategy
app/agents/creative_strategy_agent/nodes.py - Market research
app/agents/creative_strategy_agent/market_research.py - Strategy contract
app/agents/creative_strategy_agent/schema.py
Creative generation
- Prompt generation
app/agents/prompt_gen_agent/nodes.py - Prompt contract
app/agents/prompt_gen_agent/schema.py - Image generation
app/agents/image_generation/nodes.py - Image ComfyUI client
app/agents/image_generation/comfyui_client.py - Image results
app/agents/image_generation/schema.py
Selection and video
- Image selection
app/agents/image_selection_agent/nodes.py - Selection results
app/agents/image_selection_agent/schema.py - Video generation
app/agents/video_generation/nodes.py - Video ComfyUI client
app/agents/video_generation/video_comfyui_client.py - Video results
app/agents/video_generation/schema.py
Shared services
- Structured LLM
app/core/llm.py
Other components
- Product URL
- ComfyUI
- Tavily search
Connections 31
- Product URL → Stage runner: submits URL
- Stage runner → Product research: runs first
- Stage runner → Creative strategy: runs second
- Stage runner → Prompt generation: runs third
- Stage runner → Image generation: runs fourth
- Stage runner → Image selection: runs fifth
- Stage runner → Video generation: runs sixth
- Product research → Page scraper: scrapes page
app/agents/research_agent/nodes.py - Product research → Structured LLM: extracts data
app/agents/research_agent/nodes.py - Product research → Research contract: validates output
app/agents/research_agent/nodes.py - Creative strategy → Market research: fetches context
app/agents/creative_strategy_agent/nodes.py - Creative strategy → Structured LLM: creates direction
app/agents/creative_strategy_agent/nodes.py - Creative strategy → Research contract: uses product data
app/agents/creative_strategy_agent/nodes.py - Creative strategy → Strategy contract: returns direction
app/agents/creative_strategy_agent/nodes.py - Market research → Tavily search: searches trends
- Market research → Tavily search: searches competitors
- Prompt generation → Structured LLM: generates prompts
app/agents/prompt_gen_agent/nodes.py - Prompt generation → Strategy contract: uses direction
app/agents/prompt_gen_agent/nodes.py - Prompt generation → Prompt contract: validates prompts
app/agents/prompt_gen_agent/nodes.py - Image generation → Image ComfyUI client: queues workflow
app/agents/image_generation/nodes.py - Image generation → Prompt contract: uses prompts
app/agents/image_generation/nodes.py - Image generation → Image results: produces images
app/agents/image_generation/nodes.py - Image ComfyUI client → ComfyUI: queues and polls
app/agents/image_generation/comfyui_client.py - Image selection → Structured LLM: judges candidates
app/agents/image_selection_agent/nodes.py - Image selection → Image results: reviews candidates
- Image selection → Selection results: returns selection
app/agents/image_selection_agent/nodes.py - Video generation → Selection results: uses selected frame
app/agents/video_generation/nodes.py - Video generation → Prompt contract: uses video prompt
app/agents/video_generation/nodes.py - Video generation → Video ComfyUI client: generates video
app/agents/video_generation/nodes.py - Video generation → Video results: returns video results
app/agents/video_generation/nodes.py - Video ComfyUI client → ComfyUI: uploads and polls
app/agents/video_generation/video_comfyui_client.py