Campaign engine
How a launched campaign becomes one durable workflow per person, and what each part of the engine is for.
A campaign is a flow of Steps drawn in the builder. Launching it freezes the campaign’s Audience into a list of people and starts one workflow per person. Each workflow walks the flow for its person: it sends, sleeps through Wait Steps, parks until a reply, click or open arrives, and can stay alive for days or weeks.
The workflows run on Restate, a durable execution engine that runs next to the backend. Restate records every side effect a workflow performs. When the backend restarts, a workflow picks up where it stopped instead of starting over or sending anything twice.
Key rules
- One run per launch, and one workflow per person in that run.
- The Audience is read once, at launch. People who join it later wait for the next run.
- A campaign has at most one run in progress at a time.
- Every side effect inside a workflow is recorded, so a replay after a crash reuses the recorded result and sends nothing twice.
- The flow check blocks Launch now and Schedule in the app. A launch through the API, or a schedule when it comes due, does not run it.
Someone presses Launch now on Review & launch, or a scheduled launch comes due. The campaign needs at least one linked product, and no other run of it may still be running.
The parts
| Part | What it is |
|---|---|
| Campaign | A name, an Audience, the linked products and the flow: which Steps exist and how arrows join them |
| Step | One box on the canvas. It has a type (Send email, Wait, Split into paths…) and its own settings, with variables left unfilled until the Step runs |
| Launch schedule | Launch now, or once at a set time. The backend also accepts a recurring schedule, which the app does not offer |
| Run | One launch of the campaign. It ends as success, failed, canceled or partial |
| Workflow | One person’s path through one run. It is the unit the durable engine runs, resumes and cancels |
| Step record | What one Step did for one person: the settings after variables were filled in, then the output or the error |
| Step catalogue | Every Step type the backend knows, each describing its own settings and outputs. The builder draws its settings fields from it and offers only the types it lists |
| Flow check | A check of the whole flow, run after every save. The builder rewrites its messages as plain-language problems |
| Wake-up signals | Tracking opens and clicks, and matching inbound replies, which wake a workflow that waits for them |
Two places hold state
The database holds what people look at: runs, workflows, their statuses and every Step record. The run history in the builder reads only from there.
Restate holds each workflow’s journal: the ordered list of side effects it has done and their results. The journal is what lets a workflow resume after a restart or a deploy; the app never reads it directly.