Lifecycle
The objects of a workflow and how they move: from draft to version, from version to runs, and how every node of a run executes as a Link Loom worker with its own state machine.
A workflow has two lives at once: the draft you are editing and the versions you have published. Knowing which one a call runs is the difference between a safe change and a surprise in production.
This section follows a workflow from the draft to a finished run, and then goes one level down: what happens to each node while it runs.
The four objects
| Object | API name | What it holds |
|---|---|---|
| Flow definition | flow-definition | Name, slug, description and the draft: draft_nodes, draft_edges and editor_state (canvas positions and zoom). It also points to its latest version (latest_version_id, version_counter). |
| Flow version | flow-version | An immutable copy of the draft graph (graph.nodes, graph.edges) with a number (version), a name such as Order intake V3 and the flag is_default. |
| Flow instance | flow-instance | One run: its status, the node it is on, its variables and the last envelope. |
| Flow instance result | flow-instance-result | The outcome of a run: status, duration, final envelope, an outcome category (success or error) and a summary of the steps. |
Each node of a run also leaves a node execution with its output, port and timing.
In this section
From draft to an immutable version, and which mode runs what.
Runs and their statusesThe statuses of a run and of its result.
Backend and orchestratorHow a run flows between the API and the orchestrator.
How a node runsEach node is a Link Loom worker: spawn, activate, stop.
Worker state machineSeven states, nine events and the hook each transition runs.
When a node failsError port or crash, and how each one ends the run.
Isolation and sandboxesWorkers, expression contexts and code sandboxes.