Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

docs: merge workflow runs into the workflows page

Sidwebworksde5d7f203efd
diff --git a/apps/erp/app/modules/agent/kb/docs/reference/workflow-runs.md b/apps/erp/app/modules/agent/kb/docs/reference/workflow-runs.md
deleted file mode 100644
index 53909d9742..0000000000
--- a/apps/erp/app/modules/agent/kb/docs/reference/workflow-runs.md
+++ /dev/null
@@ -1,93 +0,0 @@
-# Workflow runs
-
-> Every firing of a workflow, recorded step by step: the run list, run detail, statuses, repeating steps, and how long history is kept.
-
-Every time a workflow fires, Carbon records a workflow run: one row for the run and one row for each step it took, with the values that went in, the values that came out, and why it ended the way it did. Open **Automate → Runs** to see them all, or click the **"Last Run"** cell on the workflow list to jump straight to the most recent one.
-
-The run log is written by the engine and is read-only for everyone. It is the record of what your automations actually did, so nothing in the app can edit it.
-
-## The run list
-
-| Column | Shows |
-| --- | --- |
-| Status | The run's status badge, linking to the run |
-| Workflow | The workflow's name, linking to the builder |
-| Trigger | The event or moment that started it |
-| Record | The record it started from, linking to that record |
-| Started | When it began |
-| Duration | How long it took |
-| Owner | The user the run acted as |
-| Chain | **"Hop 2"** when this run was caused by another run, linking to the cause |
-
-Rows update live while anything is still queued or running, then settle. Scheduled runs have no record, so their **Record** cell is blank.
-
-## Inside a run
-
-Clicking a row opens the **"Run Details"** drawer: the workflow's name, the version it ran, its status, and a one-line plain-English outcome. That sentence is the fastest way to understand a run, and it is deliberately specific:
-
-- *Completed — 4 of 6 steps ran.*
-- *Failed at "notify the buyer": The address answered 500.*
-- *Nothing happened — "only if overdue" matched none of its conditions, so the 3 steps after it never ran.*
-- *Stopped early — "find the customer" was skipped: That list was empty, so there was nothing to do.*
-- *Blocked — Cycle: this workflow already ran in this chain*
-
-Below that sits the step list, in the order the steps appear in the workflow rather than the order they happened, so a step that never ran still holds its place — greyed out and marked **"Not reached"**, **"Skipped — the check above didn't match"**, or **"Skipped — an earlier step failed"**.
-
-Expand a step to see three things: **Input** (its settings, plus the values those settings resolved to), **Output** (what it produced), and **Why** for condition steps — a clause-by-clause account of each path, showing the left side, the operator, the right side, and whether it passed, with the path that was taken marked **"taken"**. A **"Show raw"** toggle dumps the underlying JSON when you need it.
-
-If a condition matches none of its paths and has no **"Otherwise"**, that step *succeeded* — it correctly decided not to continue. The run ends successful with most of its steps never reached, which is why the outcome line spells out what happened instead of leaving you to read a green badge.
-
-## Run statuses
-
- - **Queued**: Accepted and waiting for a worker to pick it up.
- - **Running**: A worker has claimed it and is walking the steps.
- - **Succeeded**: Every step that ran finished without error.
- - **Failed**: At least one step failed, or the run was stopped by the 500-step ceiling.
- - **Blocked**: A loop guard stopped it before any step ran. The reason is on the run.
- - **Skipped**: It never started — the workflow was unpublished, or a scheduled run came due too late, or its previous run was still going.
-
-Individual steps use a shorter list: **Running**, **Succeeded**, **Failed**, **Skipped**. There is no blocked or queued step — those are decisions about the run as a whole.
-
-Other branches already in flight keep going, and if you wired the step's **Failure** handle to something, the run follows it. The run is marked failed at the end regardless. The one exception is a permission failure, which stops that branch outright even when a failure path exists — Carbon will not treat "you are not allowed to do this" as a business outcome to route around.
-
-Missing data is usually a skip rather than a failure. A step that cannot find the record it needs records a reason and stands down, and a condition whose values cannot be read does **not** fall through to its **"Otherwise"** — an unknown is not the same as a no.
-
-## Steps that repeat
-
-When a list is wired into a step that takes one value, the run records each item separately and then adds one summary row for the step as a whole. The summary sentence counts what actually ran:
-
-- *"Ran 3 of 3; 1 failed."*
-- *"Ran 100 of 150; 50 were not used."*
-
-A repeating step processes at most 100 items. In *"Ran 100 of 150"* the other 50 were never attempted — they were beyond the cap, not broken. The summary succeeds if at least one item succeeded, so read the count, not just the badge. An empty list is a single skipped step: *"That list was empty, so there was nothing to do."*
-
-## Chains and loop protection
-
-When a workflow's own writes trigger another workflow, Carbon links the runs together. The **Chain** column shows how many hops in you are, and the drawer draws the whole chain, indented, with the run you are looking at marked **"current"**.
-
-Two guards stop a chain running away, and both record a **Blocked** run so you can see why it stopped:
-
-- **Cycle** — the same workflow already ran earlier in this chain: *"Cycle: this workflow already ran in this chain"*.
-- **Depth** — the chain is ten hops long: *"Chain depth limit reached (10 hops)"*.
-
-The **"Triggered by"** setting on each trigger is the first line of defence: leave it at **"People"** and the workflow simply ignores changes made by other workflows. See `docs/reference/workflows`.
-
-A finished run cannot be re-run from the Runs page. If a step failed because of something outside Carbon, fix that and let the next trigger fire, or use the builder's **"Test run"** — which really executes, but is not written to run history. A run that crashes mid-flight is retried automatically by the queue, and because each step is claimed before it acts, that retry cannot repeat work that already completed.
-
-## How long history is kept
-
-A nightly job tidies run history in four passes, all of them ignoring runs that are still in flight:
-
-| After | What happens |
-| --- | --- |
-| 24 hours | A run still queued or running is closed as failed: *"This run stopped reporting and was closed automatically after 24 hours."* |
-| 7 days | Recorded values are summarised in place, and the run is marked as such |
-| 30 days | Step rows are deleted; the run itself survives |
-| 90 days | The run is deleted entirely |
-
-Summarising shortens long text, keeps the first few items of a list, and reduces a record to its identity — enough to follow what happened, without storing a full copy of your data forever. The drawer says so plainly: **"Values in this run have been summarised. Full detail is kept for 7 days."** and, once the steps are gone, **"Step detail is kept for 30 days. This run's steps have been removed."**
-
-Values whose names look like credentials — anything containing *secret*, *token*, *password*, *authorization*, *api key*, *bearer*, *cookie* and similar — are stored as `[REDACTED]`, and every webhook header value is masked regardless of its name. The field name is kept so you can still tell it was there. Ordinary fields that merely sound sensitive, such as an item key or who authorised something, are left alone: a debugging tool that hides too much is as broken as one that hides too little.
-
- - Workflows Building the workflow that produced these runs.
- - Audit log The separate, entity-centric record of who changed what.
diff --git a/apps/erp/app/modules/agent/kb/docs/reference/workflows.md b/apps/erp/app/modules/agent/kb/docs/reference/workflows.md
index 753a263ca3..df9df619aa 100644
--- a/apps/erp/app/modules/agent/kb/docs/reference/workflows.md
+++ b/apps/erp/app/modules/agent/kb/docs/reference/workflows.md
@@ -1,16 +1,14 @@
# Workflows
-> Build an automation on a canvas: one trigger, conditions, and steps that notify people, update records, or call an outside service.
+> Build an automation on a canvas: one trigger, conditions, and steps that act, with every firing recorded step by step in run history.
-A workflow watches for something happening in Carbon and then does something about it: notify the account manager when a sales order changes hands, open an issue when a job is put on hold, or call your own service when a shipment is posted. You build one on a canvas under **Automate → Workflows**, wire the steps together, and press **"Publish"**.
-
-It is a canvas, not a list of rules. Steps are cards you drag from the palette and connect by their handles, so one trigger can fan out into several branches that each end differently. Runs are recorded step by step — see `docs/reference/workflow-runs`.
+A workflow watches for something happening in Carbon and then does something about it: notify the account manager when a sales order changes hands, open an issue when a job is put on hold, or call your own service when a shipment is posted. You build one on a canvas under **Automate → Workflows**, wire the steps together, and press **"Publish"**. It is a canvas, not a list of rules: steps are cards you drag from the palette and connect by their handles, so one trigger can fan out into several branches that each end differently. Every firing is recorded step by step; see [runs and history](#runs-and-history) below.
## What starts a workflow
Every workflow has exactly one **Trigger** step, and it works one of two ways. The **"Trigger type"** toggle picks between **"Event"** and **"Schedule"**; choosing one clears the other.
-**Events.** An event is a specific change to a specific record. Names follow the record and what happened to it:
+**Events.** An event is a specific change to a specific record:
| Shape | Example | What you get |
| --- | --- | --- |
@@ -20,101 +18,107 @@ Every workflow has exactly one **Trigger** step, and it works one of two ways. T
You pick the exact field you care about. Ten record types can be watched — purchase orders, sales orders, jobs, items, receipts, shipments, quotes, suppliers, customers, and issues — each with its own short list of watched fields. A change to a field nobody watches starts nothing at all.
-**Business moments.** Below the per-record events, the picker has one group headed **"Business moments"**. These are the nine points in Carbon's own flows where something meaningful finished, rather than a raw column edit:
-
-| Moment | Reads |
-| --- | --- |
-| A job is released | The job, and who released it |
-| A job is put on hold | The job, and who held it |
-| A job operation is completed | The job, the operation, and who completed it |
-| A quote is sent | The quote, and who sent it |
-| A quote is accepted | The quote and the sales order it became |
-| A receipt is posted | The receipt, and who posted it |
-| A shipment is posted | The shipment, and who posted it |
-| A sales invoice is posted | The invoice, and who posted it |
-| A purchase invoice is posted | The invoice, and who posted it |
-
-A business moment hands your workflow the *identity* of each record, not a copy of its fields. Add a **Find** step when you need to read something the moment didn't name.
+**Business moments.** Below the per-record events, the picker has one group headed **"Business moments"**: the nine points in Carbon's own flows where something meaningful finished: a job released or put on hold, a job operation completed, a quote sent or accepted, a receipt or shipment posted, a sales or purchase invoice posted. A business moment hands your workflow the *identity* of each record, not a copy of its fields; add a **Find** step when you need to read something the moment didn't name.
-**Schedules.** In **"Schedule"** mode you pick a **"Frequency"** of Daily, Weekly, or Monthly, the days it applies to, a **"Time of day"**, and a **"Timezone"**. The builder shows a live **"Next fires at:"** line as you change it. Minutes are chosen in five-minute steps, and Monthly offers **"Last day"** alongside the numbered days.
+**Schedules.** In **"Schedule"** mode you pick a **"Frequency"** of Daily, Weekly, or Monthly, the days it applies to, a **"Time of day"**, and a **"Timezone"**; the builder shows a live **"Next fires at:"** line as you change it.
-The time is stored as wall-clock time plus a zone, so 09:00 stays 09:00 across daylight-saving changes. Two consequences worth knowing: a monthly schedule set to the 31st simply **skips** months that have no 31st rather than sliding to the end of the month, and after an outage Carbon resumes from the next due time instead of replaying missed ones. Anything more than an hour late is recorded as skipped rather than run late. Each workflow also carries a small fixed offset of up to five minutes, so a 9:00 schedule fires somewhere in 9:00–9:05.
+The time is stored as wall-clock time plus a zone, so 09:00 stays 09:00 across daylight-saving changes. A monthly schedule set to the 31st simply **skips** months with no 31st, and after an outage Carbon resumes from the next due time instead of replaying missed ones. Anything more than an hour late is recorded as skipped. Each workflow also carries a small fixed offset of up to five minutes, so a 9:00 schedule fires somewhere in 9:00–9:05.
-**"Triggered by".** Event triggers also choose *who* caused the change: **"People"**, **"Workflows"**, or **"Both"**. A new trigger starts at **"People"**, which is the safe answer — it stops a workflow from reacting to edits made by workflows, including its own. Switch it to **"Both"** deliberately, when you want one automation to feed another.
+**"Triggered by".** Event triggers also choose *who* caused the change: **"People"**, **"Workflows"**, or **"Both"**. A new trigger starts at **"People"**, which is the safe answer: it stops a workflow from reacting to edits made by workflows, including its own. Switch it to **"Both"** deliberately, when you want one automation to feed another.
## The steps you can add
-Six kinds, in palette order.
+Six kinds, in palette order:
| Step | What it does |
| --- | --- |
| **Trigger** | Starts the workflow. One per workflow, and nothing can connect into it. |
| **Condition** | Sends the run down one path. Each path is a set of clauses, with an optional **"Otherwise"**. |
| **Action** | Does the work — notifies, creates, updates, or calls out. Has separate **Success** and **Failure** handles. |
-| **Compute** | Works out a number from a record, such as an order total or a scrap percentage. |
+| **Compute** | Works out a number from a record, such as an order total or a scrap percentage. Read-only. |
| **Find** | Looks a record up so later steps can use it. |
| **Filter** | Keeps only the items in a list that match your rules. |
-A **Compute** step is read-only. Its picker is titled **"Operation"**, and it works out a value such as a purchase order's total, a sales order's line count, a job's scrap percentage or earliest operation start, or an item's quantity on hand. Everything that *writes* is an **Action** step.
-
-Workflows you built before the rename are unaffected — they open as **Compute** steps and keep whatever step names you gave them.
-
-**Actions** come in three families. Four create records — a job, an issue, a purchase order, or a sales order — and each runs through the same service Carbon's own screens use, so sequences, defaults, and required fields behave identically. Ten update an existing record, one per watched record type. The last two are **"Notify someone"** and **"Call an outside URL"**.
-
-An update step can only set the fields Carbon lists for that record — an assignee, a due date, a reference, a priority. Statuses are not writable from a workflow, and there is no delete action of any kind. What a workflow can *watch* and what it can *write* are two different lists.
+**Actions** come in three families. Four create records (a job, an issue, a purchase order, or a sales order), each through the same service Carbon's own screens use, so sequences, defaults, and required fields behave identically. Ten update an existing record, one per watched record type. The last two are **"Notify someone"** and **"Call an outside URL"**.
-**Find** works over any record type, with **"How many"** set to **"Just one"** or **"Every match"** and a set of **"Match"** rules. **Filter** narrows a list you already have: pick a **"Source list"**, then add rules.
+An update step can only set the fields Carbon lists for that record: an assignee, a due date, a reference, a priority. Statuses are not writable from a workflow, and there is no delete action of any kind. What a workflow can *watch* and what it can *write* are two different lists.
## Filling in a step
-Most fields take either a value you type or a value from an earlier step. Type `{` in a text field — the placeholder says **"Type { to insert a variable"** — and a menu opens listing the steps above this one, then their outputs, then up to two levels of properties. Fields that aren't free text show a picker instead, and the same menu anchors to it.
+Most fields take either a value you type or a value from an earlier step. Type `{` in a text field and a menu opens listing the steps above this one, their outputs, and up to two levels of properties. Only steps *guaranteed* to have run before this one are offered — a value from the other side of a condition is not on the menu, and referring to one is rejected at publish.
-Only steps that are *guaranteed* to have run before this one are offered. A value from the other side of a condition is not on the menu, and referring to one is rejected when you publish: *"This uses a value from a step that does not always run before it."*
-
-**Repeating steps.** There is no repeat checkbox. Wire a list into a field that expects a single value and the step runs once per item, which the form confirms in place: *"A list is wired into … so this step runs once for each item in it — up to 100."* Wiring two lists into the same step is an error at publish time rather than a guess about which one to loop over.
+**Repeating steps.** There is no repeat checkbox. Wire a list into a field that expects a single value and the step runs once per item, which the form confirms in place, up to 100 items. Wiring two lists into the same step is an error at publish time rather than a guess about which one to loop over.
## Calling an outside URL
-The **"Call an outside URL"** action sends an HTTP request — a webhook — so another system can react to something in Carbon.
+The **"Call an outside URL"** action sends an HTTP request, a webhook, so another system can react to something in Carbon.
- **URL**: The `https` address to call. Variables are allowed, so the address can include a record's id.
- **Method**: `GET`, `POST`, `PUT`, `PATCH`, or `DELETE`. A new step starts at `GET`.
- - **Headers**: Extra information sent with the request, such as an authorization key. Use **"Add header"** to add a row; values can contain variables.
- - **Body**: The request payload, with variables substituted. Only shown for `POST`, `PUT`, and `PATCH`, and only sent on those.
+ - **Headers**: Extra information sent with the request, such as an authorization key. Values can contain variables, and every header *value* is masked in run history.
+ - **Body**: The request payload, with variables substituted. Only shown and sent for `POST`, `PUT`, and `PATCH`.
-Carbon sends `Content-Type: application/json` on the methods that carry a body, unless you set a content type of your own. The response status comes back as the step's output, and the first part of the response body is kept in the step summary so you can see what the other end said.
+Plain `http` is rejected, and so is any address resolving to a private or link-local network, `localhost` and cloud metadata endpoints included. Redirects are not followed, the call gives up after ten seconds, and any answer that isn't a success status fails the step. Eight headers are set by Carbon and cannot be overridden. Carbon does not sign the request — if the receiving system needs to verify the caller, give it a shared secret in a header.
-Plain `http` is rejected, and so is any address that resolves to a private or link-local network — that includes `localhost` and cloud metadata endpoints. Redirects are not followed, because following one would land somewhere that never passed those checks. The call gives up after ten seconds, and any answer that isn't a success status fails the step. Eight headers are set by Carbon and cannot be overridden, among them `Host`, `Content-Length`, and `Connection`; setting one blocks publishing with *"… is set by Carbon and cannot be changed here."*
+## Saving, publishing, and versions
-Every header *value* is masked in the run log while the names stay readable, so an API key you paste into a header is not sitting in your own audit trail. Carbon does not sign the request — if the receiving system needs to verify the caller, give it a shared secret in a header.
+There is no Save button: the builder saves as you work and reports **"Saving…"**, **"Saved"**, or **"Could not save"** next to the title. A half-finished draft saves happily; nothing is checked until you publish.
-## Saving, publishing, and versions
+**"Publish"** is all-or-nothing. Carbon validates the whole workflow — a trigger exists, no step loops back, every required field is filled, every variable resolves and comes from upstream — and if anything is wrong, nothing is written; the problems appear in a panel and clicking one pans the canvas to the offending step. Publishing is also the only on/off switch: whichever version you publish is the one that runs, and **"Unpublish"** stops the workflow entirely. Nothing is deleted, so publishing again starts it back up. A workflow with nothing published reads as **Draft**.
-There is no Save button. The builder saves as you work and reports its state next to the title as **"Saving…"**, **"Saved"**, or **"Could not save"**. A half-finished draft saves happily; nothing is checked until you publish.
+Publishing freezes that version. To keep working, use the version menu to create a new version, which copies the published one and numbers it one higher. A run already in flight keeps using the version it started with even if you publish another mid-run. The trigger card also has a **"Test run"** button (owner only): it executes for real, but the result is never written to run history.
-**"Publish"** is all-or-nothing. Carbon validates the whole workflow — a trigger exists, no step loops back, every step is reachable, every required field is filled, every variable resolves and comes from upstream, every type lines up — and if anything is wrong, **nothing is written**. The problems appear in a panel headed **"3 problems — not published"**, and clicking one pans the canvas to the step it belongs to.
+## Who can do what
-Publishing is also the only on/off switch there is. Whichever version you publish is the one that runs, and **"Unpublish"** — on the published version in the builder, or from a workflow's row menu on the list — stops the workflow entirely: its trigger registrations are removed so nothing fires. Nothing is deleted, so publishing a version again starts it back up. A workflow with nothing published reads as **Draft**.
+Workflows have their own permission module: **View** opens the list, builder, and run history; **Create** adds workflows and versions; **Update** edits, publishes, and test-runs; **Delete** removes a workflow with its versions and history. Every route also requires an employee account.
-Publishing also freezes that version. The builder locks with *"This version is published. Create a new version to edit."* — to keep working, use the version menu to create a new version, which copies the published one and numbers it one higher. Older versions stay readable, and a run that is already in flight keeps using the version it started with even if you publish another one mid-run.
+Every step reads and writes with the owner's permissions, re-checked at each step. If the owner's access is revoked the run stops with a plain message naming the area. Nothing a workflow does can reach outside the company it belongs to — and run history is read-only in the database itself, so no user, however privileged, can edit or forge a run log.
-**Test run.** The trigger card has a **"Test run"** button, available to the workflow's owner. It executes for real, so anything it creates or sends actually happens, but the result is never written to run history: *"The result will not appear on the Runs page."*
+## Runs and history
-## Who can do what
+Every firing is recorded as a workflow run: one row for the run and one per step, with the values in, the values out, and why it ended the way it did. Open **Automate → Runs** for the list: status, workflow, trigger, the record it started from, duration, owner, and a **Chain** cell reading **"Hop 2"** when the run was caused by another run. Rows update live while anything is queued or running.
-Workflows have their own permission module, seeded from your existing settings access, and every route also requires an employee account.
+ - **Queued**: Accepted and waiting for a worker to pick it up.
+ - **Running**: A worker has claimed it and is walking the steps.
+ - **Succeeded**: Every step that ran finished without error.
+ - **Failed**: At least one step failed, or the run hit the 500-step ceiling.
+ - **Blocked**: A loop guard stopped it before any step ran. The reason is on the run.
+ - **Skipped**: It never started: the workflow was unpublished, or a scheduled run came due too late, or its previous run was still going.
-| You need | To |
-| --- | --- |
-| View | Open the list, the builder, and run history |
-| Create | Add a workflow, or create a new version of one |
-| Update | Edit, publish, unpublish, rename, test run |
-| Delete | Delete a workflow, its versions, and its run history |
+Clicking a row opens the **"Run Details"** drawer with a one-line plain-English outcome (*"Failed at 'notify the buyer': The address answered 500."*). Below it the steps appear in workflow order rather than execution order, so a step that never ran still holds its place, greyed and marked **"Not reached"** or skipped with its reason. Expand a step for its **Input**, **Output**, and — on conditions — a clause-by-clause **Why** with the path taken marked. A repeating step records each item plus a summary that counts what actually ran (*"Ran 100 of 150; 50 were not used"* means the 100-item cap, not an error).
-Every step reads and writes with the owner's permissions, re-checked at each step rather than cached, and Carbon confirms the owner still has access to the relevant area before running. If the owner's access is revoked the run stops with a plain message naming the area, such as *"The owner of this workflow no longer has access to Purchasing."* Nothing a workflow does can reach outside the company it belongs to.
+If a condition matches none of its paths and has no **"Otherwise"**, that step *succeeded* — it correctly decided not to continue. The run ends successful with most steps never reached, which is why the outcome sentence spells out what happened instead of leaving you to read a green badge. Missing data is likewise a skip, not a failure, and a condition whose values cannot be read does **not** fall through to its **"Otherwise"**: an unknown is not a no.
-Run history is read-only in the database itself — the engine writes it privately, and no user, however privileged, can edit or forge a run log.
+A failed step stops its branch, not the run: other branches keep going, and a wired **Failure** handle is followed, though the run is marked failed at the end regardless. The one exception is a permission failure, which stops the branch outright even when a failure path exists.
+
+**Chains.** When a workflow's writes trigger another workflow, the runs are linked and the drawer draws the whole chain. Two guards record a **Blocked** run rather than looping forever: a cycle (the same workflow already ran in this chain) and a depth limit of ten hops. The [**"Triggered by"**](#what-starts-a-workflow) setting is the first line of defence.
+
+A finished run cannot be re-run from the Runs page. Fix the outside cause and let the next trigger fire, or use the builder's **"Test run"**. A run that crashes mid-flight is retried automatically by the queue, and because each step is claimed before it acts, the retry cannot repeat work that already completed.
+
+**Retention.** A nightly job tidies history in four passes, ignoring runs still in flight: after 24 hours a run still queued or running is closed as failed; after 7 days recorded values are summarised in place; after 30 days step rows are deleted (the run survives); after 90 days the run is deleted entirely. Values whose names look like credentials are stored as `[REDACTED]` and every webhook header value is masked, while ordinary fields that merely sound sensitive (an item key, who authorised something) are left alone: a debugging tool that hides too much is as broken as one that hides too little.
+
+## Related
- - Workflow runs What happened on each run, why a step was skipped, and how long history is kept.
- Notifications Where a workflow's "Notify someone" step lands, and how people mute topics.
- - Permissions and access How employee types map to module permissions.
+ - Approvals Rule-based gates on documents, the other half of Automation.
+ - Audit log The separate, entity-centric record of who changed what.
+
+## Internals, exact messages, and troubleshooting
+
+Builder: the variable menu placeholder is "Type { to insert a variable"; cross-branch references are rejected at publish with "This uses a value from a step that does not always run before it."; a list wired into a single-value field confirms "A list is wired into … so this step runs once for each item in it — up to 100." The Compute step was previously named "Record" — old workflows open as Compute and keep their step names. Webhook: blocked headers fail publish with "… is set by Carbon and cannot be changed here."; Content-Type defaults to application/json on body-carrying methods; the response status is the step's output and the first part of the body is kept in the step summary. Publish problems appear in a panel headed like "3 problems — not published". The published-version lock reads "This version is published. Create a new version to edit." Test run notes "The result will not appear on the Runs page."
+
+Runs: step statuses are Running / Succeeded / Failed / Skipped only (Queued and Blocked are run-level). Outcome sentence examples: "Completed — 4 of 6 steps ran."; "Nothing happened — 'only if overdue' matched none of its conditions, so the 3 steps after it never ran."; "Stopped early — 'find the customer' was skipped: That list was empty, so there was nothing to do."; "Blocked — Cycle: this workflow already ran in this chain". Skip labels: "Not reached", "Skipped — the check above didn't match", "Skipped — an earlier step failed". Repeating summaries: "Ran 3 of 3; 1 failed." — the summary succeeds if at least one item succeeded; an empty list is one skipped step ("That list was empty, so there was nothing to do."). Blocked reasons: "Cycle: this workflow already ran in this chain" and "Chain depth limit reached (10 hops)". A "Show raw" toggle dumps the underlying JSON. Scheduled runs have a blank Record cell.
+
+Retention banners: the 24-hour reaper writes "This run stopped reporting and was closed automatically after 24 hours."; after summarising the drawer shows "Values in this run have been summarised. Full detail is kept for 7 days."; after step deletion, "Step detail is kept for 30 days. This run's steps have been removed." Redacted key patterns include secret, token, password, authorization, api key, bearer, cookie; deliberately NOT redacted: itemKey, authorizedBy, keyword, sessionId. Owner-permission failures read like "The owner of this workflow no longer has access to Purchasing."
+
+### A run is missing from the Runs page
+Test runs are never written to history. Scheduled runs more than an hour late are recorded as Skipped, not missing. Runs older than 90 days are deleted by retention.
+
+### Why did my workflow fire twice / react to itself?
+"Triggered by" is set to "Both" (or "Workflows"). Set it to "People" to ignore workflow-caused edits, including its own.
+
+### The run shows Succeeded but nothing happened
+A condition matched no path and had no Otherwise — that is a successful decision not to continue. Read the outcome sentence; it names the condition.
+
+### Steps are gone from an old run
+Retention: step rows are deleted after 30 days, the run header after 90. The drawer's banner distinguishes "steps purged" from "run has no steps yet".
diff --git a/apps/erp/app/modules/agent/kb/manifest.json b/apps/erp/app/modules/agent/kb/manifest.json
index 760ef30a5f..f080768fcb 100644
--- a/apps/erp/app/modules/agent/kb/manifest.json
+++ b/apps/erp/app/modules/agent/kb/manifest.json
@@ -1597,24 +1597,10 @@
"Related"
]
},
- {
- "slug": "docs/reference/workflow-runs",
- "title": "Workflow runs",
- "description": "Every firing of a workflow, recorded step by step: the run list, run detail, statuses, repeating steps, and how long history is kept.",
- "keywords": ["workflow", "runs", "docs", "reference"],
- "headings": [
- "The run list",
- "Inside a run",
- "Run statuses",
- "Steps that repeat",
- "Chains and loop protection",
- "How long history is kept"
- ]
- },
{
"slug": "docs/reference/workflows",
"title": "Workflows",
- "description": "Build an automation on a canvas: one trigger, conditions, and steps that notify people, update records, or call an outside service.",
+ "description": "Build an automation on a canvas: one trigger, conditions, and steps that act, with every firing recorded step by step in run history.",
"keywords": ["workflows", "docs", "reference"],
"headings": [
"What starts a workflow",
@@ -1622,7 +1608,14 @@
"Filling in a step",
"Calling an outside URL",
"Saving, publishing, and versions",
- "Who can do what"
+ "Who can do what",
+ "Runs and history",
+ "Related",
+ "Internals, exact messages, and troubleshooting",
+ "A run is missing from the Runs page",
+ "Why did my workflow fire twice / react to itself?",
+ "The run shows Succeeded but nothing happened",
+ "Steps are gone from an old run"
]
},
{
diff --git a/docs/app/docs/layout.tsx b/docs/app/docs/layout.tsx
index 7ae7991e44..39dc0d4c3f 100644
--- a/docs/app/docs/layout.tsx
+++ b/docs/app/docs/layout.tsx
@@ -124,7 +124,7 @@ const REFERENCE_GROUPS: { label: string; slugs: string[] }[] = [
},
{
label: "Automation & alerts",
- slugs: ["workflows", "workflow-runs", "approvals", "notifications"],
+ slugs: ["workflows", "approvals", "notifications"],
},
{
label: "Administration",
diff --git a/docs/content/docs/reference/meta.json b/docs/content/docs/reference/meta.json
index 2469b361e9..e3707e753e 100644
--- a/docs/content/docs/reference/meta.json
+++ b/docs/content/docs/reference/meta.json
@@ -65,7 +65,6 @@
"sharing",
"agent",
"workflows",
- "workflow-runs",
"notifications"
]
}
diff --git a/docs/content/docs/reference/workflow-runs.mdx b/docs/content/docs/reference/workflow-runs.mdx
deleted file mode 100644
index 757c5c4a4a..0000000000
--- a/docs/content/docs/reference/workflow-runs.mdx
+++ /dev/null
@@ -1,109 +0,0 @@
----
-title: Workflow runs
-description: "Every firing of a workflow, recorded step by step: the run list, run detail, statuses, repeating steps, and how long history is kept."
-plan: Business
----
-
-Every time a workflow fires, Carbon records a <Term>workflow run</Term>: one row for the run and one row for each step it took, with the values that went in, the values that came out, and why it ended the way it did. Open **Automate → Runs** to see them all, or click the **"Last Run"** cell on the workflow list to jump straight to the most recent one.
-
-The run log is written by the engine and is read-only for everyone. It is the record of what your automations actually did, so nothing in the app can edit it.
-
-## The run list
-
-| Column | Shows |
-| --- | --- |
-| Status | The run's status badge, linking to the run |
-| Workflow | The workflow's name, linking to the builder |
-| Trigger | The event or moment that started it |
-| Record | The record it started from, linking to that record |
-| Started | When it began |
-| Duration | How long it took |
-| Owner | The user the run acted as |
-| Chain | **"Hop 2"** when this run was caused by another run, linking to the cause |
-
-Rows update live while anything is still queued or running, then settle. Scheduled runs have no record, so their **Record** cell is blank.
-
-## Inside a run
-
-Clicking a row opens the **"Run Details"** drawer: the workflow's name, the version it ran, its status, and a one-line plain-English outcome. That sentence is the fastest way to understand a run, and it is deliberately specific:
-
-- *Completed — 4 of 6 steps ran.*
-- *Failed at "notify the buyer": The address answered 500.*
-- *Nothing happened — "only if overdue" matched none of its conditions, so the 3 steps after it never ran.*
-- *Stopped early — "find the customer" was skipped: That list was empty, so there was nothing to do.*
-- *Blocked — Cycle: this workflow already ran in this chain*
-
-Below that sits the step list, in the order the steps appear in the workflow rather than the order they happened, so a step that never ran still holds its place — greyed out and marked **"Not reached"**, **"Skipped — the check above didn't match"**, or **"Skipped — an earlier step failed"**.
-
-Expand a step to see three things: **Input** (its settings, plus the values those settings resolved to), **Output** (what it produced), and **Why** for condition steps — a clause-by-clause account of each path, showing the left side, the operator, the right side, and whether it passed, with the path that was taken marked **"taken"**. A **"Show raw"** toggle dumps the underlying JSON when you need it.
-
-<Callout type="note" title="A run can succeed having done nothing">
-If a condition matches none of its paths and has no **"Otherwise"**, that step *succeeded* — it correctly decided not to continue. The run ends successful with most of its steps never reached, which is why the outcome line spells out what happened instead of leaving you to read a green badge.
-</Callout>
-
-## Run statuses
-
-<StatusFlow entity="workflowRun">
- <Status name="Queued">Accepted and waiting for a worker to pick it up.</Status>
- <Status name="Running">A worker has claimed it and is walking the steps.</Status>
- <Status name="Succeeded" accent>Every step that ran finished without error.</Status>
- <Status name="Failed" terminal>At least one step failed, or the run was stopped by the 500-step ceiling.</Status>
- <Status name="Blocked" terminal>A loop guard stopped it before any step ran. The reason is on the run.</Status>
- <Status name="Skipped" terminal>It never started — the workflow was unpublished, or a scheduled run came due too late, or its previous run was still going.</Status>
-</StatusFlow>
-
-Individual steps use a shorter list: **Running**, **Succeeded**, **Failed**, **Skipped**. There is no blocked or queued step — those are decisions about the run as a whole.
-
-<Callout type="warn" title="A failed step stops its branch, not the run">
-Other branches already in flight keep going, and if you wired the step's **Failure** handle to something, the run follows it. The run is marked failed at the end regardless. The one exception is a permission failure, which stops that branch outright even when a failure path exists — Carbon will not treat "you are not allowed to do this" as a business outcome to route around.
-</Callout>
-
-Missing data is usually a skip rather than a failure. A step that cannot find the record it needs records a reason and stands down, and a condition whose values cannot be read does **not** fall through to its **"Otherwise"** — an unknown is not the same as a no.
-
-## Steps that repeat
-
-When a list is wired into a step that takes one value, the run records each item separately and then adds one summary row for the step as a whole. The summary sentence counts what actually ran:
-
-- *"Ran 3 of 3; 1 failed."*
-- *"Ran 100 of 150; 50 were not used."*
-
-<Callout type="note" title="“Not used” means the cap, not an error">
-A repeating step processes at most 100 items. In *"Ran 100 of 150"* the other 50 were never attempted — they were beyond the cap, not broken. The summary succeeds if at least one item succeeded, so read the count, not just the badge. An empty list is a single skipped step: *"That list was empty, so there was nothing to do."*
-</Callout>
-
-## Chains and loop protection
-
-When a workflow's own writes trigger another workflow, Carbon links the runs together. The **Chain** column shows how many hops in you are, and the drawer draws the whole chain, indented, with the run you are looking at marked **"current"**.
-
-Two guards stop a chain running away, and both record a **Blocked** run so you can see why it stopped:
-
-- **Cycle** — the same workflow already ran earlier in this chain: *"Cycle: this workflow already ran in this chain"*.
-- **Depth** — the chain is ten hops long: *"Chain depth limit reached (10 hops)"*.
-
-The **"Triggered by"** setting on each trigger is the first line of defence: leave it at **"People"** and the workflow simply ignores changes made by other workflows. See [what starts a workflow](/docs/reference/workflows#what-starts-a-workflow).
-
-<Callout type="warn" title="There is no retry button">
-A finished run cannot be re-run from the Runs page. If a step failed because of something outside Carbon, fix that and let the next trigger fire, or use the builder's **"Test run"** — which really executes, but is not written to run history. A run that crashes mid-flight is retried automatically by the queue, and because each step is claimed before it acts, that retry cannot repeat work that already completed.
-</Callout>
-
-## How long history is kept
-
-A nightly job tidies run history in four passes, all of them ignoring runs that are still in flight:
-
-| After | What happens |
-| --- | --- |
-| 24 hours | A run still queued or running is closed as failed: *"This run stopped reporting and was closed automatically after 24 hours."* |
-| 7 days | Recorded values are summarised in place, and the run is marked as such |
-| 30 days | Step rows are deleted; the run itself survives |
-| 90 days | The run is deleted entirely |
-
-Summarising shortens long text, keeps the first few items of a list, and reduces a record to its identity — enough to follow what happened, without storing a full copy of your data forever. The drawer says so plainly: **"Values in this run have been summarised. Full detail is kept for 7 days."** and, once the steps are gone, **"Step detail is kept for 30 days. This run's steps have been removed."**
-
-<Callout type="note" title="Secrets are stripped before anything is written">
-Values whose names look like credentials — anything containing *secret*, *token*, *password*, *authorization*, *api key*, *bearer*, *cookie* and similar — are stored as `[REDACTED]`, and every webhook header value is masked regardless of its name. The field name is kept so you can still tell it was there. Ordinary fields that merely sound sensitive, such as an item key or who authorised something, are left alone: a debugging tool that hides too much is as broken as one that hides too little.
-</Callout>
-
-<Cards>
- <Card title="Workflows" href="/docs/reference/workflows">Building the workflow that produced these runs.</Card>
- <Card title="Audit log" href="/docs/reference/audit-log">The separate, entity-centric record of who changed what.</Card>
-</Cards>
diff --git a/docs/content/docs/reference/workflows.mdx b/docs/content/docs/reference/workflows.mdx
index 3cdd727ea0..e922e94411 100644
--- a/docs/content/docs/reference/workflows.mdx
+++ b/docs/content/docs/reference/workflows.mdx
@@ -1,18 +1,18 @@
---
title: Workflows
-description: "Build an automation on a canvas: one trigger, conditions, and steps that notify people, update records, or call an outside service."
+description: "Build an automation on a canvas: one trigger, conditions, and steps that act, with every firing recorded step by step in run history."
plan: Business
---
-A <Term>workflow</Term> watches for something happening in Carbon and then does something about it: notify the account manager when a sales order changes hands, open an issue when a job is put on hold, or call your own service when a shipment is posted. You build one on a canvas under **Automate → Workflows**, wire the steps together, and press **"Publish"**.
+A <Term>workflow</Term> watches for something happening in Carbon and then does something about it: notify the account manager when a sales order changes hands, open an issue when a job is put on hold, or call your own service when a shipment is posted. You build one on a canvas under **Automate → Workflows**, wire the steps together, and press **"Publish"**. It is a canvas, not a list of rules: steps are cards you drag from the palette and connect by their handles, so one trigger can fan out into several branches that each end differently. Every firing is recorded step by step; see [runs and history](#runs-and-history) below.
-It is a canvas, not a list of rules. Steps are cards you drag from the palette and connect by their handles, so one trigger can fan out into several branches that each end differently. Runs are recorded step by step — see [workflow runs](/docs/reference/workflow-runs).
+<Screenshot label="The workflow builder canvas under Automate → Workflows: a trigger card wired to condition and action steps, with the palette and the Publish button" caption="One trigger, fanning out into branches that each end differently." />
## What starts a workflow
Every workflow has exactly one **Trigger** step, and it works one of two ways. The **"Trigger type"** toggle picks between **"Event"** and **"Schedule"**; choosing one clears the other.
-**Events.** An event is a specific change to a specific record. Names follow the record and what happened to it:
+**Events.** An event is a specific change to a specific record:
| Shape | Example | What you get |
| --- | --- | --- |
@@ -24,117 +24,129 @@ Every workflow has exactly one **Trigger** step, and it works one of two ways. T
You pick the exact field you care about. Ten record types can be watched — purchase orders, sales orders, jobs, items, receipts, shipments, quotes, suppliers, customers, and issues — each with its own short list of watched fields. A change to a field nobody watches starts nothing at all.
</Callout>
-**Business moments.** Below the per-record events, the picker has one group headed **"Business moments"**. These are the nine points in Carbon's own flows where something meaningful finished, rather than a raw column edit:
+**Business moments.** Below the per-record events, the picker has one group headed **"Business moments"**: the nine points in Carbon's own flows where something meaningful finished: a job released or put on hold, a job operation completed, a quote sent or accepted, a receipt or shipment posted, a sales or purchase invoice posted. A <Term>business moment</Term> hands your workflow the *identity* of each record, not a copy of its fields; add a **Find** step when you need to read something the moment didn't name.
-| Moment | Reads |
-| --- | --- |
-| A job is released | The job, and who released it |
-| A job is put on hold | The job, and who held it |
-| A job operation is completed | The job, the operation, and who completed it |
-| A quote is sent | The quote, and who sent it |
-| A quote is accepted | The quote and the sales order it became |
-| A receipt is posted | The receipt, and who posted it |
-| A shipment is posted | The shipment, and who posted it |
-| A sales invoice is posted | The invoice, and who posted it |
-| A purchase invoice is posted | The invoice, and who posted it |
-
-A <Term>business moment</Term> hands your workflow the *identity* of each record, not a copy of its fields. Add a **Find** step when you need to read something the moment didn't name.
-
-**Schedules.** In **"Schedule"** mode you pick a **"Frequency"** of Daily, Weekly, or Monthly, the days it applies to, a **"Time of day"**, and a **"Timezone"**. The builder shows a live **"Next fires at:"** line as you change it. Minutes are chosen in five-minute steps, and Monthly offers **"Last day"** alongside the numbered days.
+**Schedules.** In **"Schedule"** mode you pick a **"Frequency"** of Daily, Weekly, or Monthly, the days it applies to, a **"Time of day"**, and a **"Timezone"**; the builder shows a live **"Next fires at:"** line as you change it.
<Callout type="warn" title="Schedules never catch up">
-The time is stored as wall-clock time plus a zone, so 09:00 stays 09:00 across daylight-saving changes. Two consequences worth knowing: a monthly schedule set to the 31st simply **skips** months that have no 31st rather than sliding to the end of the month, and after an outage Carbon resumes from the next due time instead of replaying missed ones. Anything more than an hour late is recorded as skipped rather than run late. Each workflow also carries a small fixed offset of up to five minutes, so a 9:00 schedule fires somewhere in 9:00–9:05.
+The time is stored as wall-clock time plus a zone, so 09:00 stays 09:00 across daylight-saving changes. A monthly schedule set to the 31st simply **skips** months with no 31st, and after an outage Carbon resumes from the next due time instead of replaying missed ones. Anything more than an hour late is recorded as skipped. Each workflow also carries a small fixed offset of up to five minutes, so a 9:00 schedule fires somewhere in 9:00–9:05.
</Callout>
-**"Triggered by".** Event triggers also choose *who* caused the change: **"People"**, **"Workflows"**, or **"Both"**. A new trigger starts at **"People"**, which is the safe answer — it stops a workflow from reacting to edits made by workflows, including its own. Switch it to **"Both"** deliberately, when you want one automation to feed another.
+**"Triggered by".** Event triggers also choose *who* caused the change: **"People"**, **"Workflows"**, or **"Both"**. A new trigger starts at **"People"**, which is the safe answer: it stops a workflow from reacting to edits made by workflows, including its own. Switch it to **"Both"** deliberately, when you want one automation to feed another.
## The steps you can add
-Six kinds, in palette order.
+Six kinds, in palette order:
| Step | What it does |
| --- | --- |
| **Trigger** | Starts the workflow. One per workflow, and nothing can connect into it. |
| **Condition** | Sends the run down one path. Each path is a set of clauses, with an optional **"Otherwise"**. |
| **Action** | Does the work — notifies, creates, updates, or calls out. Has separate **Success** and **Failure** handles. |
-| **Compute** | Works out a number from a record, such as an order total or a scrap percentage. |
+| **Compute** | Works out a number from a record, such as an order total or a scrap percentage. Read-only. |
| **Find** | Looks a record up so later steps can use it. |
| **Filter** | Keeps only the items in a list that match your rules. |
-A **Compute** step is read-only. Its picker is titled **"Operation"**, and it works out a value such as a purchase order's total, a sales order's line count, a job's scrap percentage or earliest operation start, or an item's quantity on hand. Everything that *writes* is an **Action** step.
-
-<Callout type="note" title="Compute was called “Record”">
-Workflows you built before the rename are unaffected — they open as **Compute** steps and keep whatever step names you gave them.
-</Callout>
-
-**Actions** come in three families. Four create records — a job, an issue, a purchase order, or a sales order — and each runs through the same service Carbon's own screens use, so sequences, defaults, and required fields behave identically. Ten update an existing record, one per watched record type. The last two are **"Notify someone"** and **"Call an outside URL"**.
+**Actions** come in three families. Four create records (a job, an issue, a purchase order, or a sales order), each through the same service Carbon's own screens use, so sequences, defaults, and required fields behave identically. Ten update an existing record, one per watched record type. The last two are **"Notify someone"** and **"Call an outside URL"**.
<Callout type="note" title="Updates are deliberately narrow">
-An update step can only set the fields Carbon lists for that record — an assignee, a due date, a reference, a priority. Statuses are not writable from a workflow, and there is no delete action of any kind. What a workflow can *watch* and what it can *write* are two different lists.
+An update step can only set the fields Carbon lists for that record: an assignee, a due date, a reference, a priority. Statuses are not writable from a workflow, and there is no delete action of any kind. What a workflow can *watch* and what it can *write* are two different lists.
</Callout>
-**Find** works over any record type, with **"How many"** set to **"Just one"** or **"Every match"** and a set of **"Match"** rules. **Filter** narrows a list you already have: pick a **"Source list"**, then add rules.
-
## Filling in a step
-Most fields take either a value you type or a value from an earlier step. Type `{` in a text field — the placeholder says **"Type &#123; to insert a variable"** — and a menu opens listing the steps above this one, then their outputs, then up to two levels of properties. Fields that aren't free text show a picker instead, and the same menu anchors to it.
+Most fields take either a value you type or a value from an earlier step. Type `{` in a text field and a menu opens listing the steps above this one, their outputs, and up to two levels of properties. Only steps *guaranteed* to have run before this one are offered — a value from the other side of a condition is not on the menu, and referring to one is rejected at publish.
-Only steps that are *guaranteed* to have run before this one are offered. A value from the other side of a condition is not on the menu, and referring to one is rejected when you publish: *"This uses a value from a step that does not always run before it."*
-
-**Repeating steps.** There is no repeat checkbox. Wire a list into a field that expects a single value and the step runs once per item, which the form confirms in place: *"A list is wired into … so this step runs once for each item in it — up to 100."* Wiring two lists into the same step is an error at publish time rather than a guess about which one to loop over.
+**Repeating steps.** There is no repeat checkbox. Wire a list into a field that expects a single value and the step runs once per item, which the form confirms in place, up to 100 items. Wiring two lists into the same step is an error at publish time rather than a guess about which one to loop over.
## Calling an outside URL
-The **"Call an outside URL"** action sends an HTTP request — a <Term>webhook</Term> — so another system can react to something in Carbon.
+The **"Call an outside URL"** action sends an HTTP request, a <Term>webhook</Term>, so another system can react to something in Carbon.
<FieldTable>
<Field name="URL" type="text" required>The `https` address to call. Variables are allowed, so the address can include a record's id.</Field>
<Field name="Method" type="choice" required>`GET`, `POST`, `PUT`, `PATCH`, or `DELETE`. A new step starts at `GET`.</Field>
- <Field name="Headers" type="name/value rows">Extra information sent with the request, such as an authorization key. Use **"Add header"** to add a row; values can contain variables.</Field>
- <Field name="Body" type="text">The request payload, with variables substituted. Only shown for `POST`, `PUT`, and `PATCH`, and only sent on those.</Field>
+ <Field name="Headers" type="name/value rows">Extra information sent with the request, such as an authorization key. Values can contain variables, and every header *value* is masked in run history.</Field>
+ <Field name="Body" type="text">The request payload, with variables substituted. Only shown and sent for `POST`, `PUT`, and `PATCH`.</Field>
</FieldTable>
-Carbon sends `Content-Type: application/json` on the methods that carry a body, unless you set a content type of your own. The response status comes back as the step's output, and the first part of the response body is kept in the step summary so you can see what the other end said.
-
<Callout type="warn" title="What the webhook step refuses to do">
-Plain `http` is rejected, and so is any address that resolves to a private or link-local network — that includes `localhost` and cloud metadata endpoints. Redirects are not followed, because following one would land somewhere that never passed those checks. The call gives up after ten seconds, and any answer that isn't a success status fails the step. Eight headers are set by Carbon and cannot be overridden, among them `Host`, `Content-Length`, and `Connection`; setting one blocks publishing with *"… is set by Carbon and cannot be changed here."*
-</Callout>
-
-<Callout type="note" title="Header values are hidden in run history">
-Every header *value* is masked in the run log while the names stay readable, so an API key you paste into a header is not sitting in your own audit trail. Carbon does not sign the request — if the receiving system needs to verify the caller, give it a shared secret in a header.
+Plain `http` is rejected, and so is any address resolving to a private or link-local network, `localhost` and cloud metadata endpoints included. Redirects are not followed, the call gives up after ten seconds, and any answer that isn't a success status fails the step. Eight headers are set by Carbon and cannot be overridden. Carbon does not sign the request — if the receiving system needs to verify the caller, give it a shared secret in a header.
</Callout>
## Saving, publishing, and versions
-There is no Save button. The builder saves as you work and reports its state next to the title as **"Saving…"**, **"Saved"**, or **"Could not save"**. A half-finished draft saves happily; nothing is checked until you publish.
+There is no Save button: the builder saves as you work and reports **"Saving…"**, **"Saved"**, or **"Could not save"** next to the title. A half-finished draft saves happily; nothing is checked until you publish.
-**"Publish"** is all-or-nothing. Carbon validates the whole workflow — a trigger exists, no step loops back, every step is reachable, every required field is filled, every variable resolves and comes from upstream, every type lines up — and if anything is wrong, **nothing is written**. The problems appear in a panel headed **"3 problems — not published"**, and clicking one pans the canvas to the step it belongs to.
+**"Publish"** is all-or-nothing. Carbon validates the whole workflow — a trigger exists, no step loops back, every required field is filled, every variable resolves and comes from upstream — and if anything is wrong, nothing is written; the problems appear in a panel and clicking one pans the canvas to the offending step. Publishing is also the only on/off switch: whichever version you publish is the one that runs, and **"Unpublish"** stops the workflow entirely. Nothing is deleted, so publishing again starts it back up. A workflow with nothing published reads as **Draft**.
-Publishing is also the only on/off switch there is. Whichever version you publish is the one that runs, and **"Unpublish"** — on the published version in the builder, or from a workflow's row menu on the list — stops the workflow entirely: its trigger registrations are removed so nothing fires. Nothing is deleted, so publishing a version again starts it back up. A workflow with nothing published reads as **Draft**.
+Publishing freezes that version. To keep working, use the version menu to create a new version, which copies the published one and numbers it one higher. A run already in flight keeps using the version it started with even if you publish another mid-run. The trigger card also has a **"Test run"** button (owner only): it executes for real, but the result is never written to run history.
-Publishing also freezes that version. The builder locks with *"This version is published. Create a new version to edit."* — to keep working, use the version menu to create a new version, which copies the published one and numbers it one higher. Older versions stay readable, and a run that is already in flight keeps using the version it started with even if you publish another one mid-run.
+## Who can do what
-**Test run.** The trigger card has a **"Test run"** button, available to the workflow's owner. It executes for real, so anything it creates or sends actually happens, but the result is never written to run history: *"The result will not appear on the Runs page."*
+Workflows have their own permission module: **View** opens the list, builder, and run history; **Create** adds workflows and versions; **Update** edits, publishes, and test-runs; **Delete** removes a workflow with its versions and history. Every route also requires an employee account.
-## Who can do what
+<Callout type="note" title="A workflow runs as its owner, not as whoever triggered it">
+Every step reads and writes with the owner's permissions, re-checked at each step. If the owner's access is revoked the run stops with a plain message naming the area. Nothing a workflow does can reach outside the company it belongs to — and run history is read-only in the database itself, so no user, however privileged, can edit or forge a run log.
+</Callout>
-Workflows have their own permission module, seeded from your existing settings access, and every route also requires an employee account.
+## Runs and history
-| You need | To |
-| --- | --- |
-| View | Open the list, the builder, and run history |
-| Create | Add a workflow, or create a new version of one |
-| Update | Edit, publish, unpublish, rename, test run |
-| Delete | Delete a workflow, its versions, and its run history |
+Every firing is recorded as a <Term>workflow run</Term>: one row for the run and one per step, with the values in, the values out, and why it ended the way it did. Open **Automate → Runs** for the list: status, workflow, trigger, the record it started from, duration, owner, and a **Chain** cell reading **"Hop 2"** when the run was caused by another run. Rows update live while anything is queued or running.
-<Callout type="note" title="A workflow runs as its owner, not as whoever triggered it">
-Every step reads and writes with the owner's permissions, re-checked at each step rather than cached, and Carbon confirms the owner still has access to the relevant area before running. If the owner's access is revoked the run stops with a plain message naming the area, such as *"The owner of this workflow no longer has access to Purchasing."* Nothing a workflow does can reach outside the company it belongs to.
+<Screenshot label="The Run Details drawer from Automate → Runs: outcome sentence, step list in workflow order with a skipped branch greyed out, and one step expanded showing Input and Output" caption="The outcome sentence is the fastest way to understand a run." />
+
+<StatusFlow entity="workflowRun">
+ <Status name="Queued">Accepted and waiting for a worker to pick it up.</Status>
+ <Status name="Running">A worker has claimed it and is walking the steps.</Status>
+ <Status name="Succeeded" accent>Every step that ran finished without error.</Status>
+ <Status name="Failed" terminal>At least one step failed, or the run hit the 500-step ceiling.</Status>
+ <Status name="Blocked" terminal>A loop guard stopped it before any step ran. The reason is on the run.</Status>
+ <Status name="Skipped" terminal>It never started: the workflow was unpublished, or a scheduled run came due too late, or its previous run was still going.</Status>
+</StatusFlow>
+
+Clicking a row opens the **"Run Details"** drawer with a one-line plain-English outcome (*"Failed at 'notify the buyer': The address answered 500."*). Below it the steps appear in workflow order rather than execution order, so a step that never ran still holds its place, greyed and marked **"Not reached"** or skipped with its reason. Expand a step for its **Input**, **Output**, and — on conditions — a clause-by-clause **Why** with the path taken marked. A repeating step records each item plus a summary that counts what actually ran (*"Ran 100 of 150; 50 were not used"* means the 100-item cap, not an error).
+
+<Callout type="note" title="A run can succeed having done nothing">
+If a condition matches none of its paths and has no **"Otherwise"**, that step *succeeded* — it correctly decided not to continue. The run ends successful with most steps never reached, which is why the outcome sentence spells out what happened instead of leaving you to read a green badge. Missing data is likewise a skip, not a failure, and a condition whose values cannot be read does **not** fall through to its **"Otherwise"**: an unknown is not a no.
+</Callout>
+
+A failed step stops its branch, not the run: other branches keep going, and a wired **Failure** handle is followed, though the run is marked failed at the end regardless. The one exception is a permission failure, which stops the branch outright even when a failure path exists.
+
+**Chains.** When a workflow's writes trigger another workflow, the runs are linked and the drawer draws the whole chain. Two guards record a **Blocked** run rather than looping forever: a cycle (the same workflow already ran in this chain) and a depth limit of ten hops. The [**"Triggered by"**](#what-starts-a-workflow) setting is the first line of defence.
+
+<Callout type="warn" title="There is no retry button">
+A finished run cannot be re-run from the Runs page. Fix the outside cause and let the next trigger fire, or use the builder's **"Test run"**. A run that crashes mid-flight is retried automatically by the queue, and because each step is claimed before it acts, the retry cannot repeat work that already completed.
</Callout>
-Run history is read-only in the database itself — the engine writes it privately, and no user, however privileged, can edit or forge a run log.
+**Retention.** A nightly job tidies history in four passes, ignoring runs still in flight: after 24 hours a run still queued or running is closed as failed; after 7 days recorded values are summarised in place; after 30 days step rows are deleted (the run survives); after 90 days the run is deleted entirely. Values whose names look like credentials are stored as `[REDACTED]` and every webhook header value is masked, while ordinary fields that merely sound sensitive (an item key, who authorised something) are left alone: a debugging tool that hides too much is as broken as one that hides too little.
+
+## Related
<Cards>
- <Card title="Workflow runs" href="/docs/reference/workflow-runs">What happened on each run, why a step was skipped, and how long history is kept.</Card>
<Card title="Notifications" href="/docs/reference/notifications">Where a workflow's "Notify someone" step lands, and how people mute topics.</Card>
- <Card title="Permissions and access" href="/docs/reference/permissions">How employee types map to module permissions.</Card>
+ <Card title="Approvals" href="/docs/reference/approvals">Rule-based gates on documents, the other half of Automation.</Card>
+ <Card title="Audit log" href="/docs/reference/audit-log">The separate, entity-centric record of who changed what.</Card>
</Cards>
+
+<AgentContext>
+## Internals, exact messages, and troubleshooting
+
+Builder: the variable menu placeholder is "Type &#123; to insert a variable"; cross-branch references are rejected at publish with "This uses a value from a step that does not always run before it."; a list wired into a single-value field confirms "A list is wired into … so this step runs once for each item in it — up to 100." The Compute step was previously named "Record" — old workflows open as Compute and keep their step names. Webhook: blocked headers fail publish with "… is set by Carbon and cannot be changed here."; Content-Type defaults to application/json on body-carrying methods; the response status is the step's output and the first part of the body is kept in the step summary. Publish problems appear in a panel headed like "3 problems — not published". The published-version lock reads "This version is published. Create a new version to edit." Test run notes "The result will not appear on the Runs page."
+
+Runs: step statuses are Running / Succeeded / Failed / Skipped only (Queued and Blocked are run-level). Outcome sentence examples: "Completed — 4 of 6 steps ran."; "Nothing happened — 'only if overdue' matched none of its conditions, so the 3 steps after it never ran."; "Stopped early — 'find the customer' was skipped: That list was empty, so there was nothing to do."; "Blocked — Cycle: this workflow already ran in this chain". Skip labels: "Not reached", "Skipped — the check above didn't match", "Skipped — an earlier step failed". Repeating summaries: "Ran 3 of 3; 1 failed." — the summary succeeds if at least one item succeeded; an empty list is one skipped step ("That list was empty, so there was nothing to do."). Blocked reasons: "Cycle: this workflow already ran in this chain" and "Chain depth limit reached (10 hops)". A "Show raw" toggle dumps the underlying JSON. Scheduled runs have a blank Record cell.
+
+Retention banners: the 24-hour reaper writes "This run stopped reporting and was closed automatically after 24 hours."; after summarising the drawer shows "Values in this run have been summarised. Full detail is kept for 7 days."; after step deletion, "Step detail is kept for 30 days. This run's steps have been removed." Redacted key patterns include secret, token, password, authorization, api key, bearer, cookie; deliberately NOT redacted: itemKey, authorizedBy, keyword, sessionId. Owner-permission failures read like "The owner of this workflow no longer has access to Purchasing."
+
+### A run is missing from the Runs page
+Test runs are never written to history. Scheduled runs more than an hour late are recorded as Skipped, not missing. Runs older than 90 days are deleted by retention.
+
+### Why did my workflow fire twice / react to itself?
+"Triggered by" is set to "Both" (or "Workflows"). Set it to "People" to ignore workflow-caused edits, including its own.
+
+### The run shows Succeeded but nothing happened
+A condition matched no path and had no Otherwise — that is a successful decision not to continue. Read the outcome sentence; it names the condition.
+
+### Steps are gone from an old run
+Retention: step rows are deleted after 30 days, the run header after 90. The drawer's banner distinguishes "steps purged" from "run has no steps yet".
+</AgentContext>
diff --git a/docs/next.config.mjs b/docs/next.config.mjs
index 7b0fadeb85..2bb8ba7cc0 100644
--- a/docs/next.config.mjs
+++ b/docs/next.config.mjs
@@ -61,6 +61,12 @@ const config = {
destination: "/docs/reference/single-sign-on",
permanent: true,
},
+ // Workflow runs merged into the Workflows page as its "Runs and history" section.
+ {
+ source: "/docs/reference/workflow-runs",
+ destination: "/docs/reference/workflows#runs-and-history",
+ permanent: true,
+ },
// The Data API moved from its own root to a section inside /api, so the whole
// surface lives under one header entry, one sidebar and one host/API-key
// configurator. Paths below the root are unchanged, so :path* maps 1:1 —