# 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.

Source: https://docs.sommatic.ai/en/workflows/lifecycle/ (updated 2026-11-26)

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

- [Drafts and versions](https://docs.sommatic.ai/en/workflows/lifecycle/versions.md): From draft to an immutable version, and which mode runs what.
- [Runs and their statuses](https://docs.sommatic.ai/en/workflows/lifecycle/runs.md): The statuses of a run and of its result.
- [Backend and orchestrator](https://docs.sommatic.ai/en/workflows/lifecycle/backend-and-orchestrator.md): How a run flows between the API and the orchestrator.
- [How a node runs](https://docs.sommatic.ai/en/workflows/lifecycle/node-execution.md): Each node is a Link Loom worker: spawn, activate, stop.
- [Worker state machine](https://docs.sommatic.ai/en/workflows/lifecycle/worker-states.md): Seven states, nine events and the hook each transition runs.
- [When a node fails](https://docs.sommatic.ai/en/workflows/lifecycle/failures.md): Error port or crash, and how each one ends the run.
- [Isolation and sandboxes](https://docs.sommatic.ai/en/workflows/lifecycle/isolation.md): Workers, expression contexts and code sandboxes.

## Next steps

- [Workflow Studio](https://docs.sommatic.ai/en/workflows/studio.md): Edit the draft, test it and deploy it.
- [Publishing](https://docs.sommatic.ai/en/workflows/publishing.md): Versions, rollbacks, warnings and pausing a workflow.
- [Workflow design API](https://docs.sommatic.ai/en/api/reference/workflow-design.md): Flow definitions, versions and publishing over HTTP.
