Marketing Run Execution
Summary
Run execution is where marketing authoring becomes durable work. A CampaignRun owns materialized members, member steps, rendered assets, deliveries, events, action plans, and transition history. Jobs execute explicit run and flow-step work; they do not rediscover campaign intent on the fly.
Reader Question
How does a campaign move from authored configuration to run-owned work that can render, deliver, trigger actions, advance, retry, and explain itself?
Surface Or Workflow
Operators enter through the runs list and run detail. They inspect counts, render progress, action executions, distribution state, delivery status, and health signals. Engineers trace the same state through runtime services and thin job entrypoints.
Lifecycle
Run start resolves the campaign flow, materializes eligible members, creates entry member steps, snapshots action plans, and queues renderable work. Rendering processes explicit run_id + flow_step_id work, creates assets, and moves member steps toward review or delivery. Flow advancement evaluates edges from completed member steps and creates downstream work. Actions execute from run action plans, not live authoring definitions.
Child Threads
marketing-execution-job-family: run start, render, advance, and action jobs.marketing-action-plan-dispatch: transition dispatch and action execution.marketing-delivery-and-distribution: print, export, confirmation, and delivery reconciliation.- Marketing Review And Repair
Implementation Boundaries
services/marketing/runtime owns run orchestration, audience materialization, flow advancement, delivery, actions, and scheduling. services/marketing/jobs contains reusable job logic. jobs/marketing/*/run.py entrypoints stay thin. Run detail UI/API surfaces read state; they should not execute heavy work inline.
Tradeoffs
Run-owned state creates more rows than a stateless sender, but it gives the platform retries, audit, review, idempotency, and historical explanation.
Visual
The current visual is a graph neighborhood. The intended visual is a job/run timeline from schedule or manual start to materialization, render, review, delivery, actions, advancement, and analytics publication.
Source Evidence
app/web/app/marketing/runsapp/api/marketing/campaigns/routes/runtime.pyapp/api/marketing/campaigns/routes/runs.pyservices/marketing/runtimeservices/marketing/jobsjobs/marketing/start_campaign_run/run.pyjobs/marketing/render_flow_step/run.pyjobs/marketing/advance_campaign/run.pyjobs/marketing/execute_actions/run.pytests/marketing