# Workflows

Source: https://docs.settlemint.com/docs/console/platform-admin/workflows
Watch the workflow engine across every organisation: its health, run counts per workflow, the runs themselves and each run's steps and error type.

**Workflows** shows what the [workflow engine](https://docs.settlemint.com/docs/concepts/settlement/workflow-engine) is doing across every organisation on the platform. It answers three questions: is the engine itself healthy, which runs are in flight or finished per workflow, and where a stuck or failed run stopped.

The screen only reads. It has no control to resume, cancel or retry a run, and it never shows what a workflow was given, what a step returned or the text of a stored error. A failure shows its type only.

## Before you start [#before-you-start]

- Only accounts with the "Administrator" platform role see this screen. Owning an organisation does not grant it.
- To watch one organisation's runs as its owner, use **Organisation settings** → **Platform status** → **Workflows** instead.

## Steps [#steps]

### Open Workflows [#open-workflows]

Open **Platform admin** → **Workflows**. The page opens with **Engine health** at the top and the **Overview** tab below it. While the page is open, the health panel, the overview and the first page of each runs list refresh every 15 seconds.

### Check the engine health [#check-the-engine-health]

**Engine health** shows one verdict: "Operational", "Degraded" or "Down". Below it, **Runners** lists each runner with its **Machine**, **Liveness** ("Live" or "No heartbeat"), **Last heartbeat** and **Shard groups**. **Shards and backlog** lists each shard group in use with **Shards held** out of the shards expected, and the messages **Due now**, **In progress** and **Scheduled**. When a shard group holds more than 10,000 unprocessed messages, its three counts read "10,000+". Under the table, the panel shows the age of the oldest due message among the first 100 unprocessed messages of each shard.

A section whose source did not answer in time reads "No data". The verdict is then never "Operational". When the runner or shard source reads "No data", **Shards and backlog** lists the backlog of every shard group and leaves out **Shards held**.

### Read the run counts [#read-the-run-counts]

The **Overview** tab counts runs per workflow, with **All workflows** as the total. Runs that are running, waiting or suspended are counted now, whenever they started. Completed, failed and interrupted runs are counted over the **Finished runs** window: **Last 1 hour**, **Last 24 hours** or **Last 7 days**, 24 hours by default.

The **Source** column says what a row counts: "Recorded" runs, of workflows that write a status, or "Unrecorded" runs, which exist only in the engine's journal. A workflow with both kinds has a row for each. A workflow with no registered name shows its type name split into words, with the type name below it. A workflow whose registered name other workflows share, such as "Create data feed", keeps that name and adds its own type name in words in brackets (the type name itself when those words would repeat the name), so no two rows read the same and each name still matches the Platform status Workflows list. A count of zero reads 0. Select a count above zero to open the matching runs tab, filtered to that workflow, state and window. The **All workflows** row adds up both sources, so its totals are not links.

### Find a run [#find-a-run]

Open **Recorded runs** or **Unrecorded runs**. Both list runs across every organisation, newest first, and filter by **Workflow** and **State**. The **Workflow** filter offers every workflow with a run of that tab's kind in the chosen window, **Last 30 days** included. **Recorded runs** also filters by **Organisation**, where "Platform" stands for runs that belong to no organisation. Type part of a name to find any organisation on the platform. Runs in flight show whenever they started. Finished runs show for the **Finished runs** window, which here also offers **Last 30 days**.

On **Unrecorded runs**, every run reads "Not recorded" as its organisation, because the journal does not carry it.

### Open a run [#open-a-run]

Select a run to open its page. It shows the **Workflow type**, **Execution ID**, **Organisation**, state, **Started**, **Last change**, **Duration**, **Redrives** where recorded, and the **Failure** that stopped it. The **Steps** table lists each step with its **Name**, **Attempt**, **State**, **Started** and **Ended**, each sleep with its state, "Sleeping" or "Woke", and the time it wakes or woke (a short sleep still waiting reads "Wake time not recorded", because the engine keeps no wake time for it), and each finished child run with a link to it. Select the copy button beside the shortened **Execution ID** to copy the whole ID.

## Badges on a run [#badges-on-a-run]

| Badge | What it means |
| --- | --- |
| "Status out of date" | The run's status still shows it in flight, but the engine's journal recorded its end. The page shows the journal's state. |
| "Sleeping" | The run is in flight and waits on a durable sleep. |
| "Retrying" | The run is in flight and its latest step is on its second attempt or later. |

## How the engine health verdict is chosen [#how-the-engine-health-verdict-is-chosen]

| Verdict | When |
| --- | --- |
| "Down" | The runner and shard sources answered, and no runner is live or no shard is held. |
| "Degraded" | A source reads "No data", a shard of a group in use is unheld, no live runner serves a group in use, or the oldest due message is older than 5 minutes. |
| "Operational" | Every source answered and no other row applies. |

A runner is live when the engine marks it healthy and its last heartbeat is younger than 120 seconds, and a shard is held when its lock is younger than 120 seconds. A shard group is in use when a registered runner lists it, a shard of it is held, or it has an unprocessed message. Each shard group in use expects 64 shards. A message is due when it has not been processed, may be delivered now and no runner claimed it in the last 10 minutes. A message a runner claimed counts as **In progress** and does not change the verdict.

## How a failure is shown [#how-a-failure-is-shown]

| Failure | Shown as |
| --- | --- |
| A known error type | The error's title and explanation from the [error reference](https://docs.settlemint.com/docs/api-reference/errors) |
| An error type the platform does not know | "Unrecognised error" with "Error type:" and its name |
| A crash | "Unexpected failure" |
| An interruption | "Interrupted" |

The error's own message, cause and fields stay on the server.

## You should see [#you-should-see]

- **Engine health** with a verdict, and its runners and shard groups.
- On **Overview**, a row per workflow with counts that open the matching runs tab.
- On a run's page, its state, its failure type when it failed, and its steps.

## Troubleshooting [#troubleshooting]

**The page says Not available**

Your account does not have the "Administrator" platform role. An organisation owner sees their own organisation's runs
under **Organisation settings** → **Platform status** → **Workflows**.

**A run reads Not found: runs older than 30 days are not kept**

The engine keeps a run's journal for 30 days. Check the workflow type and execution ID in the address. The API answers
`DALP-9549` for the same case.

**A run's page says Earlier steps removed**

The journal no longer holds the run's first steps, so the **Steps** table starts later than the run did.

**The overview says its totals are incomplete**

The status table or the engine's journal did not answer in time, so the counts leave out the recorded or the
unrecorded runs. The **All workflows** totals then read as a lower bound, such as "12+". The page tries again on its
next refresh.

**A section reads Refresh failed. Showing the last data read.**

The latest refresh did not answer, so the section keeps the figures it read before. The next refresh replaces them.

## Frequently asked questions [#frequently-asked-questions]

### Why does a workflow show under Unrecorded runs and not Recorded runs?

Some workflows write a status as they run and some do not. **Recorded runs** reads the written statuses, which carry the organisation. **Unrecorded runs** reads the engine's journal, which holds every run but not its organisation.

### Can I restart, cancel or retry a run here?

No. The screen only reads.

### Are my reads of other organisations' runs recorded?

Yes. Each read of a runs list or of a run's page is recorded in the platform's [audit trail](https://docs.settlemint.com/docs/concepts/records-and-evidence/audit-trail) as a read of sensitive data. The engine health, the overview counts and the list of workflows the **Workflow** filter offers are not recorded.

## API routes [#api-routes]

This screen reads `GET /api/v2/admin/workflows/engine-health`, `GET /api/v2/admin/workflows/overview`, `GET /api/v2/admin/workflows/types`, `GET /api/v2/admin/workflows/runs`, `GET /api/v2/admin/workflows/unrecorded-runs` and `GET /api/v2/admin/workflows/runs/{workflowType}/{executionId}` (Platform administrator only), documented in the [Platform API reference](https://docs.settlemint.com/docs/api-reference/v2).