Skip to main content
This reference documents the types used during workflow execution.

Workflow runtime status

export enum WorkflowRuntimeStatus {
  NOT_STARTED = 'NotStarted',
  IN_PROGRESS = 'InProgress',
  COMPLETED = 'Completed',
  FAILED = 'Failed',
  CANCELLED = 'Cancelled',
}
StatusDescription
NOT_STARTEDWorkflow defined but not yet begun
IN_PROGRESSActively executing steps
COMPLETEDAll steps finished successfully
FAILEDOne or more steps failed
CANCELLEDExecution was explicitly cancelled

Step runtime status

export enum WorkflowRuntimeStepStatus {
  NOT_STARTED = 'NotStarted',
  IN_PROGRESS = 'InProgress',
  COMPLETED = 'Completed',
  DISABLED = 'Disabled',
  FAILED = 'Failed',
}
StatusDescription
NOT_STARTEDStep has not started
IN_PROGRESSStep is currently executing
COMPLETEDStep finished successfully
DISABLEDStep is disabled
FAILEDStep execution failed

TRuntimeWorkflowExecution

Represents a running workflow instance:
export type TRuntimeWorkflowExecution = {
  id: string;
  correlationId: string;
  parentWorkflowExecutionId?: string;
  rootWorkflowExecutionId?: string;
  workflowTemplateVersionId: string;
  runtimeStatus: WorkflowRuntimeStatus;
  startedAt: string;
  completedAt?: string;
  failedAt?: string;
  lastActivityAt?: string;
  context: Record<string, any>;
  steps: Record<string, TRuntimeWorkflowStepExecution>;
};
PropertyDescription
idUnique execution identifier
correlationIdCorrelation ID for tracing
parentWorkflowExecutionIdParent workflow if spawned as sub-workflow
rootWorkflowExecutionIdRoot workflow in nested hierarchies
workflowTemplateVersionIdTemplate version being executed
runtimeStatusCurrent overall status
startedAtExecution start timestamp
completedAtCompletion timestamp (if completed)
failedAtFailure timestamp (if failed)
lastActivityAtLast step update timestamp
contextGlobal workflow context data
stepsMap of step execution states by ID

Context usage

The context property serves two purposes:
  1. Global context - Accessible via __context__ in expressions
  2. Metadata storage - Additional execution information (e.g., directorId for DSC workflows)

TRuntimeWorkflowStepExecution

Represents a step’s execution state:
export type TRuntimeWorkflowStepExecution = {
  id: string;
  type: WorkflowStepType;
  stepId: string;
  status: WorkflowRuntimeStepStatus;
  attempt: number;
  startedAt?: string;
  completedAt?: string;
  failedAt?: string;
  dueAt?: string;
  outputData?: Record<string, any>;
  childWorkflowExecutions?: { id: string }[];
};
PropertyDescription
idUnique step execution ID
typeStep type
stepIdReference to step definition ID
statusCurrent step status
attemptAttempt number (for retries)
startedAtStep start timestamp
completedAtCompletion timestamp
failedAtFailure timestamp
dueAtDue date for the step
outputDataStep output (follows outputSchema)
childWorkflowExecutionsChild workflows triggered by this step

Runtime flow

┌─────────────────────────────────────────────────────────┐
│                 Workflow Execution                       │
│                                                          │
│  Status: IN_PROGRESS                                     │
│  Context: { customerId: "123", ... }                     │
│                                                          │
│  Steps:                                                  │
│  ┌─────────────┬──────────────┬─────────────────┐       │
│  │ start       │ IN_PROGRESS  │ outputData: {}  │       │
│  ├─────────────┼──────────────┼─────────────────┤       │
│  │ verify      │ NOT_STARTED  │ outputData: null│       │
│  ├─────────────┼──────────────┼─────────────────┤       │
│  │ end         │ NOT_STARTED  │ outputData: null│       │
│  └─────────────┴──────────────┴─────────────────┘       │
└─────────────────────────────────────────────────────────┘

Accessing runtime data

In expressions, access step outputs via the __steps__ variable:
__steps__.verify.outputData.verified
This returns the verified field from the verify step’s output.

Child workflow executions

For sub-workflow steps, childWorkflowExecutions contains references to spawned workflows:
{
  "id": "step-exec-1",
  "type": "sys.sub_workflow",
  "stepId": "dsc-step",
  "status": "Completed",
  "childWorkflowExecutions": [
    { "id": "child-exec-1" },
    { "id": "child-exec-2" },
    { "id": "child-exec-3" }
  ]
}

Status transitions

Workflow status flow

NOT_STARTED → IN_PROGRESS → COMPLETED

                    ├──────→ FAILED

                    └──────→ CANCELLED

Step status flow

NOT_STARTED → IN_PROGRESS → COMPLETED

                    └──────→ FAILED

(DISABLED can be set at any point via activation policy)

Next steps

Data models

Database schema reference

Validation rules

Definition validation rules