Skip to content

Run lifecycle

When a workflow runs, three nested state machines progress in parallel: a workflow run, an operation run for each operation in the workflow definition, and (for method operations) a method run for the underlying method invocation. This page covers each state machine, how they interact, and what to look for when diagnosing a failed run.

The SimKit Web UI is where you go to inspect runs.

Workflow run

CREATED → RUNNING → SUCCEEDED
                  ↘
                    FAILED
                  ↘
        PAUSED → RUNNING → … (resume)
                  ↘
        CANCELING → CANCELED
State Meaning
CREATED Initial. The run exists, hasn't started processing yet.
RUNNING Operations are progressing. The fine-grained internal stage is in WorkflowRunProcessingState (parsing, scheduling, computing, finalizing).
PAUSED Hit a breakpoint or was paused by the user. Resumable.
CANCELING Cancel requested; ongoing operations are being cancelled. Transitional — moves to CANCELED.
SUCCEEDED Terminal. All operations completed successfully.
FAILED Terminal. At least one operation failed.
CANCELED Terminal. Cancellation completed.

Run mode is set at start time: - REAL — full execution; methods run for real. - DRY — exercises workflow structure with cheap/fake method responses. Useful for early debugging.

Operation run

Each operation in the workflow definition gets its own run record:

CREATED → SCHEDULED → RUNNING → SUCCEEDED
                              ↘
                                FAILED
        ↘ TO_BE_REPROCESSED → SCHEDULED ↗
                              ↘
                                CANCELED
State Meaning
CREATED Operation defined but not ready to run yet (waiting on inputs).
SCHEDULED All inputs available; operation is queued for execution.
RUNNING Currently executing (used by inline operations; method operations spawn a method run instead).
TO_BE_REPROCESSED Workflow processed something else atomically; this op needs another scheduling pass.
SUCCEEDED Terminal. Output produced, downstream operations can consume.
FAILED Terminal. The op didn't produce its output.
CANCELED Terminal. Run was cancelled before this op completed.

Workflow runs are atomic per processing pass — only one operation's state changes at a time within a run. TO_BE_REPROCESSED is the "come back later" state for ops that were ready but had to defer.

Method run

When an operation is a method call, the actual method invocation gets its own run with a single terminal state at the end:

Terminal state Meaning
SUCCEEDED Method ran to completion and produced its output.
FAILED Method returned a failure (legitimate, well-formed).
ENGINE_ERROR The method-engine couldn't execute the method (image pull failure, container crash, infrastructure issue).
CANCELED Method was cancelled before completing.

A failed method run is expected in some workflows (a terminalState = "FAILURE" test, for example, deliberately fails). An engine error is always unexpected.

How they nest

For each operation in the workflow definition:

WorkflowRun (RUNNING)
  └─ OperationRun (SCHEDULED → RUNNING)
       └─ MethodRun (SUCCEEDED)        ← only for method operations
       (or inline computation)         ← for inline operations

Inline operations don't spawn a method run; the platform evaluates them directly.

Nested workflow operations spawn a child workflow run with its own operation tree. The child run's outcome rolls up to the parent operation's state.

Operation recycling

When a run reaches an operation, the runner first looks for an earlier operation run in the same project with the same operation definition, inputs and configuration. If one exists, the new operation run is marked as recycled and reuses its results instead of executing again; the run's hasRecycledOperation flag reports that this happened.

Recycling is on by default and can be switched off per run with the operationRecyclingEnabled field of the run initialization request (simkit run start --no-operation-recycling). A run with recycling off executes every operation, and nested workflow runs it starts inherit the setting. Use it to test a method or a workflow type change end to end; later runs recycle the results it produces as usual. The runner's global ENABLE_OPERATION_RECYCLING configuration turns recycling off for every run.

Cascading cancellation

When you cancel a workflow run, the cancel propagates downward: - All non-terminal operation runs transition to CANCELED. - All in-flight method runs are signalled to cancel (the method-engine may take time to acknowledge — that's why workflow run goes to CANCELING rather than directly to CANCELED). - Once every child has settled, the workflow run reaches CANCELED.

Cancellation never moves a run backwards through state — already- SUCCEEDED operations stay succeeded; cancellation only affects in-flight or pending work.

Pause and resume

Breakpoints declared in workflowDefinition { } pause the workflow run automatically when reached. Manual simkit run pause is also available.

While paused: - Any in-flight operation continues to completion (pause doesn't abort running ops). - Subsequent ops sit in CREATED / SCHEDULED state, waiting. - The workflow run is in PAUSED.

Resume with simkit run resume <run-id> (or from Workbench, where the workflow's user can also resume) — the workflow run goes back to RUNNING and processing continues.

Resource usage reporting

Each operation reports resource usage (CPU time, memory, wall-clock). The ResourceUsageReportStatus enum tracks completeness — partial reports are acceptable mid-run; final reports are expected on terminal completion.

A method's resourceEstimation { } block declares expected usage based on configuration; the actual usage gets compared against the estimate after the run for billing and capacity planning.

Where to look when something failed

A FAILED workflow run typically points at one or two operations:

  1. Workflow run is FAILED. Open it in SimKit Web UI, expand the operation tree.
  2. Find the FAILED operation run. Read its error message — usually identifies the data or configuration that broke.
  3. If the operation is a method op, drill into the method run. FAILED is a method-side error; ENGINE_ERROR is infrastructure.
  4. Validation-rule violations show up as a workflow run that never starts — the failure is at submission time, not run time. Check the configuration form for case messages.

Cross-references