Portal Community

Execution State Machine

StateDescription
RunningExecution is in-process — nodes are executing
SuspendedHIL node returned Suspend — state persisted to DB, thread freed
ResumingResume API called — state being restored, engine re-initialising
RunningBack in-process — downstream nodes executing from the HIL node's output
Completed / FailedWorkflow 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:

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.