Flow Studio
HIL Suspension and Resume — Overview
A deep-dive into the mechanics of workflow suspension and resume. Understand the state machine, how execution state is persisted to the database, and how a remote resume call restores and continues the workflow.
State Machine
| State | Location | Trigger to Next State |
|---|---|---|
| Running | In-process memory | HIL node returns Suspend result |
| Suspending | In-process (transient) | ExecutionMemory serialised and written to DB |
| Suspended | Database only | POST /api/executions/{executionResId}/resume called |
| Resuming | In-process (transient) | State loaded, response data merged |
| Running | In-process memory | Engine continues from HIL node's output port |
Key Objects
SuspendPayload
Returned by HIL executors. Contains ExecutionResId, actor assignment, task type, and expiry. Tells the engine what to record.
Process_SuspendedExecutions
Database table holding serialised ExecutionMemory, pending node pointer, and correlation token. Durable across restarts.
ExecutionResId
GUID correlation token. Unique per suspension. Used as the resume API URL path parameter. Consumed on first use.
ResumePayload
Sent by the actor's channel to the resume API. Contains the actor's response data (decision, form values, acknowledgement).
Service Architecture
| Service | Responsibility |
|---|---|
HILSuspensionService | Receives Suspend result from engine, serialises ExecutionMemory, writes to DB, generates correlation token |
CorrelationTokenService | Generates and validates ExecutionResIds — checks uniqueness and consumed status |
HILResumeService | Validates resume request, loads suspended state, merges response data, triggers continuation |
IWorkflowContinuationOrchestrator | Re-initialises the engine from loaded state and resumes execution from the suspended node's downstream |