ObjectStackObjectStack

Execution

Execution protocol schemas

Automation Execution Protocol

Defines schemas for execution logging, error tracking, checkpointing, concurrency control, and scheduled execution persistence.

Industry alignment: Salesforce Flow Interviews, Temporal Workflow History, AWS Step Functions execution logs.

Source: packages/spec/src/automation/execution.zod.ts

TypeScript Usage

import { CheckpointSchema, ConcurrencyPolicySchema, ExecutionErrorSchema, ExecutionErrorSeverity, ExecutionLogSchema, ExecutionStatus, ExecutionStepLogSchema, ExecutionStepMetricsSchema, ExecutionStepSkipReasonSchema, FlowRunGateSummarySchema, FlowRunNodeSummarySchema, FlowRunSummarySchema, ScheduleStateSchema } from '@objectstack/spec/automation';
import type { Checkpoint, ConcurrencyPolicy, ExecutionError, ExecutionErrorSeverity, ExecutionLog, ExecutionStatus, ExecutionStepLog, ExecutionStepMetrics, ExecutionStepSkipReason, FlowRunGateSummary, FlowRunNodeSummary, FlowRunSummary, ScheduleState } from '@objectstack/spec/automation';

// Validate data
const result = CheckpointSchema.parse(data);

Checkpoint

Properties

PropertyTypeRequiredDescription
idstringCheckpoint ID
executionIdstringParent execution ID
flowNamestringFlow machine name
currentNodeIdstringNode ID where execution is paused
variablesRecord<string, any>Flow variable state at checkpoint
completedNodeIdsstring[]List of node IDs already executed
createdAtstringCheckpoint creation timestamp
expiresAtstringoptionalCheckpoint expiration (auto-cleanup)
reasonEnum<'wait' | 'screen_input' | 'approval' | 'error' | 'manual_pause' | 'parallel_join' | 'boundary_event'>Why the execution was checkpointed

ConcurrencyPolicy

Properties

PropertyTypeRequiredDescription
maxConcurrentintegerMaximum number of concurrent executions allowed
onConflictEnum<'queue' | 'reject' | 'cancel_existing'>queue = enqueue for later, reject = fail immediately, cancel_existing = stop running instance
lockScopeEnum<'global' | 'per_record' | 'per_user'>Scope of the concurrency lock
queueTimeoutMsintegeroptionalMaximum time to wait in queue before timing out (ms)

ExecutionError

Properties

PropertyTypeRequiredDescription
idstringError record ID
executionIdstringParent execution ID
nodeIdstringoptionalNode where the error occurred
severityEnum<'warning' | 'error' | 'critical'>Error severity level
codestringMachine-readable error code
messagestringHuman-readable error message
stackstringoptionalStack trace for debugging
contextRecord<string, any>optionalAdditional diagnostic context (input data, config snapshot)
timestampstringWhen the error occurred
retryablebooleanWhether this error can be retried
resolvedAtstringoptionalWhen the error was resolved (e.g., after successful retry)

ExecutionErrorSeverity

Allowed Values

  • warning
  • error
  • critical

ExecutionLog

Properties

PropertyTypeRequiredDescription
idstringExecution instance ID
flowNamestringMachine name of the executed flow
flowVersionintegeroptionalVersion of the flow that was executed
statusEnum<'pending' | 'running' | 'paused' | 'completed' | 'failed' | 'cancelled' | 'timed_out' | 'retrying'>Current execution status
trigger{ type: string; recordId?: string; object?: string; userId?: string; … }What triggered this execution
steps{ nodeId: string; nodeType: string; nodeLabel?: string; status: Enum<'success' | 'failure' | 'skipped'>; … }[]Ordered list of executed steps
summary{ selected: integer; acted: integer; skipped: integer; unmeasured?: integer; … }optionalPer-run rollup: records selected / acted on, gate skips, per-node status
variablesRecord<string, any>optionalFinal state of flow variables
startedAtstringExecution start timestamp
completedAtstringoptionalExecution completion timestamp
durationMsintegeroptionalTotal execution duration in milliseconds
runAsEnum<'system' | 'user'>optionalExecution context identity
tenantIdstringoptionalTenant ID for multi-tenant isolation

ExecutionStatus

Allowed Values

  • pending
  • running
  • paused
  • completed
  • failed
  • cancelled
  • timed_out
  • retrying

ExecutionStepLog

Properties

PropertyTypeRequiredDescription
nodeIdstringNode ID that was executed
nodeTypestringNode action type (e.g., "decision", "http")
nodeLabelstringoptionalHuman-readable node label
statusEnum<'success' | 'failure' | 'skipped'>Step execution result
startedAtstringWhen the step started
completedAtstringoptionalWhen the step completed
durationMsintegeroptionalStep execution duration in milliseconds
inputRecord<string, any>optionalInput data passed to the node
outputRecord<string, any>optionalOutput data produced by the node
error{ code: string; message: string; stack?: string }optionalError details if step failed
retryAttemptintegeroptionalRetry attempt number (0 = first try)
parentNodeIdstringoptionalEnclosing structured-region container node ID (loop/parallel/try_catch)
iterationintegeroptionalZero-based loop iteration or parallel branch index of the enclosing region
regionKindstringoptionalRegion kind the step ran in: loop-body | parallel-branch | try | catch
metrics{ selected?: integer; acted?: integer; unmeasuredEffect?: boolean }optionalRecords this step selected / acted on, as reported by the node executor
skippedBy{ nodeId: string; edgeId?: string; label?: string }optionalThe gate that closed, when status is skipped

ExecutionStepMetrics

Properties

PropertyTypeRequiredDescription
selectedintegeroptionalRecords this node READ or matched (a get_record query, a lookup)
actedintegeroptionalRecords this node WROTE (created / updated / deleted) or effects it dispatched (notifications delivered)
unmeasuredEffectbooleanoptionalThis execution may have caused an effect the platform cannot count (an external write through a connector). NOT interchangeable with acted: 0 — it says the count is unknown, not that it is zero.

ExecutionStepSkipReason

Properties

PropertyTypeRequiredDescription
nodeIdstringNode whose out-edge did not open (the gate)
edgeIdstringoptionalEdge whose condition evaluated false
labelstringoptionalEdge label, when the flow names its branches

FlowRunGateSummary

Properties

PropertyTypeRequiredDescription
nodeIdstringNode whose out-edge did not open (the gate)
targetNodeIdstringNode the closed edge would have run
edgeIdstringoptionalEdge whose condition evaluated false
labelstringoptionalEdge label, when the flow names its branches
skippedintegerTimes this gate evaluated false (once per loop iteration)

FlowRunNodeSummary

Properties

PropertyTypeRequiredDescription
nodeIdstringNode ID
nodeTypestringNode action type (e.g., "get_record", "decision")
nodeLabelstringoptionalHuman-readable node label
statusEnum<'success' | 'failure' | 'skipped'>Terminal status of the node across the run — failure if any execution failed, else success if any succeeded, else skipped
runsintegerTimes the node executed (loop iterations and parallel branches each count)
failuresintegerExecutions that failed
skippedintegerTimes a closed gate kept this node from running at all
selectedintegeroptionalRecords read across every execution — omitted for a node that reads none
actedintegeroptionalRecords written / effects dispatched across every execution — omitted for a node that writes none
unmeasuredintegeroptionalExecutions that may have caused an effect the platform cannot count (see ExecutionStepMetrics.unmeasuredEffect)

FlowRunSummary

Properties

PropertyTypeRequiredDescription
selectedintegerTotal records read by the run
actedintegerTotal records written / effects dispatched by the run
skippedintegerTotal node executions a closed gate prevented
unmeasuredintegeroptionalTotal executions that may have caused an effect the platform cannot count. Absent = not tracked (an older run), which is not the same as zero.
nodes{ nodeId: string; nodeType: string; nodeLabel?: string; status: Enum<'success' | 'failure' | 'skipped'>; … }[]Per-node breakdown, in first-execution order
gates{ nodeId: string; targetNodeId: string; edgeId?: string; label?: string; … }[]Gates that closed during the run, most-skipped first
detailOmittedbooleanoptionalSet when persistence dropped nodes/gates to keep the stored row bounded — the totals are still exact. Declared so empty arrays are never mistaken for "nothing ran".

ScheduleState

Properties

PropertyTypeRequiredDescription
idstringSchedule instance ID
flowNamestringFlow machine name
cronExpressionstring | { dialect: Enum<'cel' | 'cron' | 'template'>; source?: string; ast?: any; meta?: object }Cron expression — cron0 9 * * MON-FRI
timezonestringoptionalIANA timezone for cron evaluation
statusEnum<'active' | 'paused' | 'disabled' | 'expired'>optionalCurrent schedule status
nextRunAtstringoptionalNext scheduled execution timestamp
lastRunAtstringoptionalLast execution timestamp
lastExecutionIdstringoptionalExecution ID of the last run
lastRunStatusEnum<'pending' | 'running' | 'paused' | 'completed' | 'failed' | 'cancelled' | 'timed_out' | 'retrying'>optionalStatus of the last run
totalRunsintegeroptionalTotal number of executions
consecutiveFailuresintegeroptionalConsecutive failed executions
startDatestringoptionalSchedule effective start date
endDatestringoptionalSchedule expiration date
maxRunsintegeroptionalMaximum total executions before auto-disable
createdAtstringSchedule creation timestamp
updatedAtstringoptionalLast update timestamp
createdBystringoptionalUser who created the schedule

On this page