Ignitify.dev
Chain runs
Build flows

Chain runs

A run does one step. Something outside the VM starts the next step: the caller, your own workflow tool, cron job or queue, or the API server when a run ends. A run never starts a run.

Which one to use

WayWho starts the next stepPlanUse it whenRead
1 · The next step in the resultThe caller, after it reads the result.Any planThe next step depends on what the task found.The next step in the result
2 · Your own orchestratorYour workflow tool, cron job or queue. It keeps the state of the flow.Any planThe flow has more than a few steps, or a step must not be lost.Your own orchestrator
3 · Run B when A endsThe API server. Task A's end-of-run callback calls task B's webhook.Starter and upTask B needs to know only that A ended. It needs no data from A, or it reads the data from your own database.Run B when A ends

1 · The next step in the result

Use it when the next step depends on what the task found. The task returns the next step in its result: which task, and which payload. Or it returns "done". The caller reads the result and starts that step.

Plan: any plan.

CallerAPI server1start task Aflow id + payload2resultfailed: no next steptry again or stop3start task A againnew key4resultflow id + next: task B5start task Bwhat travelsfailedCallerAPI server1start task Aflow id + payload2resultfailed: no next steptry again or stop3start A againnew key4resultnext: task B5start task B
A failed run names no next step. The caller decides.
  • The result is at most 10 KiB. Pass a reference to your own storage, not the data.
  • A run that fails returns no next step. The caller decides: try again, or stop the flow.
  • This is also how you branch and loop. See Flow shapes.

2 · Your own orchestrator

Use it when the flow has more than a few steps, or when a lost step costs you. Your workflow tool, cron job or queue keeps the state of the flow. It starts each step, waits for its end, and starts the next one. Ignitify is the secure compute step that your tool calls.

Plan: any plan.

Your orchestratorAPI server1start step 1key flow-7:12resultsave the flow state3start step 2key flow-7:24resultfailedtry again: new key flow-7:2:25start step 2 againkey flow-7:2:26resultdonewhat travelsdonefailedOrchestratorAPI server1start step 1key flow-7:12resultsave the flow state3start step 2key flow-7:24resultfailedretry, new key5start step 2 againkey flow-7:2:26resultdone
Your orchestrator keeps the flow state, the keys and the retries.

How your orchestrator waits for a step

  1. Follow the run until it ends (task:run with wait).
  2. Read its status from time to time (run:get).
  3. Get a callback when the run ends, at your own small receiver. See Get a callback when a run ends.

3 · Run B when A ends

Use it when task B needs to know only that a run of task A ended. Task A's end-of-run callback goes straight to task B's webhook, with no server of yours in between. B starts with A's run id and status as its payload. B does not get A's result.

Plan: Starter and up.

Task AAPI serverTask B1a run of A endsstatuscallback to B's webhook, signed2start task BA's run id + statusno resultCOMPLETED? else stopwhat travelsnot sentTask AAPI serverTask B1run endsstatussigned callback2start Brun id + statusno resultCOMPLETED? else stop
The API server starts B when A ends. B gets the status, not the result.

Set it up

  1. Create a webhook for task B (hook:create). Keep its URL and its secret.
  2. Set the callback of task A's deployment to that URL, with B's webhook secret as the signing secret (notify:set).
  3. In task B, read status from the payload. If it is not COMPLETED, stop.