Follow-up — what it is¶
Documentation › Concepts › Follow-up
A follow-up (in the API — spawn) is a new independent Work Queue task that a worker can create at the same moment it successfully finishes the current task.
In conversation this is often called "a subtask created when the parent is closed". The sense is close; the model is different: on complete the original task already becomes succeeded, and the follow-up immediately lives on its own. Any worker of the target named queue claims it as ordinary work.
flowchart LR
source["source task"]
complete[complete]
followUp["follow-up task / spawn"]
workers[competing workers]
source --> complete
complete -->|"atomically, in the same transaction"| followUp
followUp --> workers
How it works¶
- The worker holds a lease on the original (source) task.
- On a successful complete it passes
spawn[]— zero or more new tasks into the target named queues. - In one workhold transaction: the original task → succeeded, and the follow-ups appear in the Work Queue.
- There is no window in which "the original is closed and the next work is lost".
- A repeat of the same complete with the same claim and the same body returns the same spawned tasks, without duplicates.
The source → spawn link exists as lineage (who spawned whom). It is not an ownership tree and not a wait for children.
Example: complete in one queue, the task in another¶
One instance has several named queues. Each has its own work stream and its own workers. A complete in one queue can atomically enqueue a new task into another.
Suppose an admin has already created two queues: orders and billing.
| Step | Where | What happens |
|---|---|---|
| 1 | orders |
A worker processes order 42 |
| 2 | orders |
Finishes this task |
| 3 | the same complete | Passes spawn[] with queue_name: billing |
| 4 | both queues | The task in orders → succeeded; an independent task "issue an invoice for order 42" appears in billing |
| 5 | billing |
A billing worker takes it. The orders queue no longer holds this work |
flowchart LR
orders["named queue orders"]
billing["named queue billing"]
workerOrders["worker orders"]
workerBilling["worker billing"]
orders --> workerOrders
workerOrders -->|"complete in orders + spawn into billing"| billing
billing --> workerBilling
You can also spawn several tasks, into different names. The target queue must already exist: an unknown name is an error, as with an ordinary enqueue. The step-by-step scenario is complete-and-spawn.md.
How to say it correctly¶
| Colloquially | In the product |
|---|---|
| parent | source / source task |
| subtask | follow-up task / spawn |
| create when closing the parent | atomically spawn on complete |
A "subtask" in a tracker lives inside the parent and often does not release it. A follow-up in workhold is the next independent unit of work, enqueued atomically together with complete.
What a follow-up is not¶
- not a nested tracker subtask: there is no parent/child hierarchy and no "wait for all children";
- not a Delivery Outbox record — that is
events[]; - not a workflow/DAG, join, compensation, or human task;
- not a required step: complete without
spawn[]is normal.
Where next¶
- An example in the scenario catalog: complete-and-spawn.md.
- Scenario: UC-3.
- End-to-end lifecycle: 03-how-it-works.md.
- How spawn differs from an event: spawn-vs-events.md.
- When to call services X and Y as work, not as events: 12-delivery-outbox.md.
- Why this is not an orchestrator: workflow-dag.md.
- The "two different resources" decision: ADR 003.
← Named queues · Glossary →