Ignitify.dev
Flow shapes
Build flows

Flow shapes

Each shape is made from single runs. Your own workflow tool, cron job or queue, or the caller, starts the runs and keeps the state. A run never starts other runs.

Which one to use

ShapeWho does itPlanUse it whenRead
1 · Fan-outYour orchestrator or a script starts many runs.Any planWork splits into parts that can run at the same time.Fan-out
2 · Fan-inYour orchestrator waits for all parts, then combines the results.Any planThe next step needs every part.Fan-in
3 · Branch and loopThe task returns the next step or "again". The caller starts it and counts.Any planThe next step depends on a result.Branch and loop
4 · One at a timeYour orchestrator, a schedule, or a bidirectional task.Any plan. A schedule needs a plan with schedules; the bidirectional way needs Starter and up.Runs must not overlap.One at a time

1 · Fan-out

Use it when work splits into parts. Your orchestrator or a script starts one run for each part, at the same time.

Plan: any plan.

Your orchestratorAPI server1start part 1flow-7:p12start part 2flow-7:p23start part 3flow-7:p34run ids5read status, a few timesall three ended?combine the resultsdonewhat travelsdoneOrchestratorAPI server1start part 1flow-7:p12start part 2flow-7:p23start part 3flow-7:p34run ids5read statusall three ended?combine the resultsdone
Your orchestrator starts the parts, waits for all of them, and combines them.
  • Start each part with its own idempotency key: the flow id and the part number.
  • Your plan limits the runs that run at the same time. Above it, a start is refused with 429 and Retry-After; waiting in a queue does not help. Start a few parts at a time, and the next when one ends.
  • Put the flow id and the part number in each payload.

2 · Fan-in

Use it when the next step needs every part. Your orchestrator keeps the run ids it started. It waits until each run has ended, then combines the results. The diagram above shows both.

Plan: any plan.

  • Wait with run:get from time to time, or with a callback to your own receiver.
  • A large part goes to your own database under the flow id. The result holds only a reference.
  • Decide what one failed part means: try that part again with a new key, or fail the flow.

3 · Branch and loop

Use it when the next step depends on a result. The task returns which step comes next, or "again". The caller starts that step. For a loop, the caller counts and stops at a maximum.

Plan: any plan.

CallerAPI server1start checktry 12resultagaintry < max?3start checktry 24resultnext: task B5start task Bwhat travelsCallerAPI server1start checktry 12resultagaintry < max?3start checktry 24resultnext: task B5start task B
The caller counts the loops and starts each step.
  • Keep the count in the caller, or in the payload. Do not keep it only in the memory of a warm VM: you can lose it.
  • Set a maximum. A loop with no maximum can run, and cost, forever.

4 · One at a time

Use it when runs must not overlap. Pick one of three ways.

  1. Your orchestrator starts the next run only after the last one ended. Any plan.
  2. A schedule skips a slot while its last run is still active (overlap: skip, the default). A plan with schedules. See Run on a schedule.
  3. A bidirectional task runs one run at a time on one VM. With on_busy: queue, a second run waits and then runs on the same VM. With state: across-runs, the runs share its memory. Plan: Starter and up, because the task serves inbound traffic.
CallerAPI serverOne VMone VM1start run 12run 1 runs3start run 2queued4run 1 ends5run 2 runs on the same VMsame memory with across-runsbehind a busy pinned VM: bidirectional-busyCallerAPI serverOne VM1start 12run 13start 2queued41 ends5run 2same memorybusy pinned VM: bidirectional-busy
A bidirectional task runs one run at a time on one VM.