Flow Studio
Suspension Model
How the engine suspends execution at a HIL node — persisting state to the database, generating the correlation token, and tracking the suspended execution until resume.
Execution State Machine
| State | Description |
|---|---|
| Running | Execution is in-process — nodes are executing |
| Suspended | HIL node returned Suspend — state persisted to DB, thread freed |
| Resuming | Resume API called — state being restored, engine re-initialising |
| Running | Back in-process — downstream nodes executing from the HIL node's output |
| Completed / Failed | Workflow finished (success or error) |
Correlation Token
The correlation token (also called ExecutionResId) is a GUID generated by the engine when a HIL suspension is recorded. It is:
- Globally unique — no two suspensions ever share a token.
- Single-use — once used to resume, it is marked consumed. Repeat calls are rejected.
- The primary key of the resume API URL:
POST /api/executions/{executionResId}/resume - Embedded in HIL task notifications so the actor's channel can call the API.
SuspendPayload Schema
public class SuspendPayload
{
public string ExecutionResId { get; init; } // correlation token (GUID)
public string SuspendedNodeId { get; init; }
public string HilTaskType { get; init; } // "Approval" | "UserForm" | "Review"
public string ActorId { get; init; } // resolved actor
public string ActorType { get; init; } // "User" | "Group" | "Agent"
public DateTimeOffset? ExpiresAt { get; init; } // null if no timeout
public object? TaskPayload { get; init; } // form schema, instruction text, etc.
}
Process_SuspendedExecutions Table
CREATE TABLE Process_SuspendedExecutions (
ExecutionResId UNIQUEIDENTIFIER PRIMARY KEY,
TenantId NVARCHAR(100) NOT NULL,
ExecutionId NVARCHAR(100) NOT NULL,
ProcessId NVARCHAR(100) NOT NULL,
SuspendedNodeId NVARCHAR(100) NOT NULL,
ExecutionMemory NVARCHAR(MAX) NOT NULL, -- JSON serialised
SuspendedAt DATETIMEOFFSET NOT NULL,
ExpiresAt DATETIMEOFFSET NULL,
ResumedAt DATETIMEOFFSET NULL, -- set on consume
Status TINYINT NOT NULL -- 0=Pending, 1=Resumed, 2=Expired
);
Deep dive: For the full suspension and resume implementation, see Guide22_HILSuspensionResume. For timeout handling, see Guide23_HILTimeout.