SettleMint
ConceptsSettlement

Workflow Engine

The Workflow Engine lets a multi-step operation survive a process restart without repeating a finished step or losing track of one still in progress.

A workflow durably tracks each step through completion, waiting, and recovery.An illustrative workflow has four steps. Validation and preparation are complete. Approval is waiting on a decision. Submission has not started. Beside the steps, a journal explains that recorded activity results are reused during replay. Unfinished work can run again.A workflow durably tracks each step through completion, waiting, and recovery.The same figure as the desktop variant, drawn as a vertical sequence for phone widths. An illustrative workflow has four steps. Validation and preparation are complete. Approval is waiting on a decision. Submission has not started. Below the fourth step, a journal box explains that recorded activity results are reused during replay. Unfinished work can run again. An accent line links the journal back to the waiting step.

Validation and preparation are complete. Approval waits on a decision. After a restart, replay reuses recorded results. Unfinished work can run again.

A multi-step operation, such as an asset deployment or a corporate action, recovers from a crash without repeating a step it already finished. The engine stores each activity's result and reuses it on replay. Work whose result was not recorded runs again.

The engine tracks a run as running, waiting, suspended, completed, or failed. A run enters waiting for an approval, a threshold, or a timer with a deadline the operation defines, and suspended when an infrastructure retry sequence is exhausted and awaits automatic recovery.

On-chain writes still use the Transaction Queue for deduplication and sequencing. Durable execution alone does not make external effects happen exactly once.

Why a multi-step operation needs durable execution

An operation such as deploying an asset, processing a corporate action, or approving a batch of identity claims is never one call. It chains several steps, each one a separate effect: a custody signature, an on-chain write, a compliance check, sometimes a wait for a threshold or an approval. If the process running that chain restarts before it finishes, nothing outside the platform can tell which of those effects already happened.

A naive retry gets this wrong in one of two directions. Restarting the whole operation can resubmit a step that already reached the chain, so an asset deploys twice or a claim is minted twice. Resuming from wherever the process happens to pick back up can skip a step that never ran, so a required compliance check is silently missing from an operation the caller believes is complete. Both mistakes are invisible from outside: the caller sees only that the operation eventually reports a result, not whether its internal steps produced that result honestly.

Asset Lifecycle names a related risk at the boundary between systems, a reconciliation where an instrument's ledger state and its legal record drift apart. The Workflow Engine closes a narrower gap: it keeps the steps inside one multi-step operation from running twice or from silently not running at all after a restart.

Why one recovery layer serves every operation, not one per domain

The alternative is for each kind of operation to carry its own recovery logic. One retry scheme serves an asset deployment, a different one a corporate action, and a third a batch of identity claims. Each scheme would answer the same question, whether a given step already ran, in its own way. A platform with as many answers as it has operation types makes recovering an operation depend on which team wrote its retry code.

The Workflow Engine is shared machinery instead. One execution record and one replay rule serve every domain that runs a multi-step operation, whether it deploys an asset, provisions a custody wallet, or processes a corporate action. An integrator reads the same kind of status and the same kind of recorded evidence whatever operation they started, because the recovery layer underneath does not change.

What the engine records, and what replay does with it

The engine records each activity's result as it completes. A restarted process replays the workflow's code from the top, but a completed activity returns its stored result instead of running its work again. An activity interrupted before its result was saved executes again.

Replay only guarantees the workflow's own bookkeeping. It says nothing about the business outcome of an external effect, so external effects still need their own duplicate protection, including writes submitted through the Transaction Queue. A stored result does not prove every business outcome was successful. Read the operation's result and any failure details before reporting success.

Running, waiting, and suspended are different states

A running workflow executes its next activity. Waiting means the operation needs a condition such as an approval, funds, or a timer. It can continue when that condition is satisfied. A deadline can end a wait, but the workflow decides what happens when the deadline expires.

Suspended means an infrastructure failure exhausted the activity's immediate retries. The platform schedules another recovery attempt with backoff. Automatic recovery is bounded. Persistent failure can end the run as failed. Restore the unavailable dependency when an incident prevents progress.

Completed and failed are terminal workflow statuses. They describe the workflow's outcome. Waiting and suspended are non-terminal. Status projections can lag during a database outage, so a stale running status does not prove that an activity is still executing.

A workflow moves between running and one of two terminal statuses, pausing on waiting or suspended along the way.Running executes the workflow's steps and leads to one of two terminal statuses, completed or failed. A step can pause the workflow into waiting, deferred on an approval, a threshold, or a timer, which resumes running once its condition is met. Separately, a run can land in suspended when its retry ladder runs out, and the platform's own resume pass automatically redrives it back to running. Both pauses return to running rather than ending the workflow.A workflow moves between running and one of two terminal statuses, pausing on waiting or suspended along the way.The same figure as the desktop variant, drawn as a vertical sequence for phone widths. Running executes the workflow's steps and leads to one of two terminal statuses, completed or failed. A step can pause the workflow into waiting, deferred on an approval, a threshold, or a timer, which resumes running once its condition is met. Separately, a run can land in suspended when its retry ladder runs out, and the platform's own resume pass automatically redrives it back to running. Both pauses return to running rather than ending the workflow.

Running leads to completed or failed. A step can pause the workflow into waiting, on an approval, a threshold, or a timer, or the platform can park it as suspended after its retry ladder runs out. Both pauses return to running rather than ending the workflow.

When an operation pauses for funds

An operation configured to wait for gas funding pauses the affected step when the paying wallet has insufficient funds. The work recorded before that step remains available for replay. The funding request identifies the wallet or deposit to fund, the required amount, and the deadline.

The amount required to retry the refused operation controls when it can resume. The operator may also see an estimate for the remaining work. That estimate helps plan funding but does not raise the resume threshold.

Fund the destination shown in the request. An ordinary signing account or a self-funded smart account uses an address balance. A paymaster uses its deposit in the EntryPoint contract. Funding the paymaster address alone does not increase that deposit.

A balance observation and a transaction broadcast can use different network nodes. A deposit visible to one node may take time to reach another. The platform makes bounded broadcast retries after funding. A repeated rejection does not always mean another deposit is needed.

When the funding deadline expires, read the recorded error, fund the requested destination, and start a new attempt as the operation's API specifies. Operations that do not enable the funding pause fail with GAS_REQUIRED, which identifies the funding shortfall.

The engine and the API run separately

The API hands durable work to the Workflow Engine, which runs in a separate process. The engine uses database-backed execution records to recover after a restart. Its availability and capacity can therefore differ from the API's: an accepted request can remain in progress while the engine recovers.

Workflow Engine

Coordinates activities and stores their results for replay. Its result describes the multi-step operation.

Transaction Queue

Deduplicates, sequences, and executes the on-chain writes submitted by activities. Each write has its own outcome.

Follow the operation's status contract

An asynchronous start returns an operation identifier or status link. Acceptance means the platform accepted the request for processing. It does not mean the operation finished. Use the status endpoint returned by that operation and interpret its documented states.

After a lost response, inspect the original operation before sending another request. Repeat the API request with the same Idempotency-Key only when its route documents replay safety. At the workflow boundary, reusing the key does not create a fresh attempt after a terminal failure. Correct the failure's cause before starting a new business attempt with a new key.

A client polls until the operation reaches a documented terminal state. Read the resulting resource after success. A pending operation does not yet promise that a separate resource read contains its changes.

For operational monitoring, the Console's Platform Health view includes workflow status. That view complements the status endpoint used by the integration. It does not replace the operation's result.

Recovery records and audit evidence

The execution journal records activity results needed for recovery. It has a retention policy and does not replace the platform's Audit Trail, the append-only record of who did what and when, or your compliance archive. Retain the operation identifier, transaction references, approvals, and other evidence your policy requires.

A workflow's recorded decision also does not prove that a token transfer passed compliance. The token's transfer checks decide whether its balances may change. Read the write's Settlement Verdict, the typed terminal outcome recorded for that on-chain write, to establish the on-chain outcome.

A failed workflow exposes error information through its operation's status contract. Read the error code and retry guidance before deciding whether to change the request, restore a dependency, or escalate.

Frequently asked questions

Can a workflow wait indefinitely?

Yes, if its wait has no deadline. Durable execution preserves the wait. It does not impose a universal time limit. Check the deadline the operation you are integrating documents for its wait, and design an approval or funding process around it.

Does completed mean everything the operation requested actually succeeded?

Read the operation's result. A workflow can complete after recording a business rejection or a partial outcome that its own contract permits. The workflow status alone does not describe each external effect.

Should I restart a suspended workflow manually?

The platform schedules recovery attempts for infrastructure suspension. Check dependency health and the operation's recorded details before starting another request. A second request with a new key can create separate work while the original run is still recoverable.

  • Asset Lifecycle: The whole working life of a regulated tokenized instrument, where the deployments, corporate actions, and other multi-step operations this engine recovers actually run.
  • Transaction Lifecycle: The path one on-chain write follows once a workflow activity submits it through the Transaction Queue, from its pre-checks to one recorded outcome.
  • Transaction Queue: The separate control that dedupes, sequences, and gates the on-chain writes a workflow step submits.
  • XvP Settlement: An on-chain exchange between two or more parties in which every leg settles together or none does, a sibling settlement primitive in this same category.
  • Settlement Verdict: The typed terminal outcome a single on-chain write reaches, distinct from a workflow's own typed outcome.
  • Custody Approval: One concrete source of the approval a workflow step can wait on before resuming.
  • Idempotent Write: The Idempotency-Key mechanism a workflow's start request carries, so a retried start never creates a duplicate workflow.

On this page