Reference
StepFlow
DSL Specification

StepFlow DSL Specification

The StepFlow DSL (Domain Specific Language) defines workflows as JSON documents with declarative state machines.

Workflow Structure

{
  "description": "Optional workflow description",
  "version": "1.0",
  "entry": "FirstStep",
  "timeoutSeconds": 3600,
  "steps": {
    "FirstStep": { ... },
    "SecondStep": { ... }
  }
}

Top-Level Fields

FieldTypeRequiredDescription
entrystringYesName of the first step to execute
stepsobjectYesMap of step name → step definition
descriptionstringNoHuman-readable description
versionstringNoWorkflow version identifier
timeoutSecondsintegerNoMaximum execution time

Step Common Fields

All step types share these fields:

FieldTypeDescription
typestringStep type: task, set, wait, router, parallel, map, succeed, fail
descriptionstringOptional step description
nextstringNext step name (mutually exclusive with end)
endbooleanMarks workflow termination
setobjectVariables to set after execution
outputobjectOutput mapping for next step's input

Execution Flow

┌─────────┐    ┌─────────┐    ┌─────────┐
│  Entry  │───▶│  Step   │───▶│  Step   │───▶ End
│  Step   │    │  (next) │    │  (end)  │
└─────────┘    └─────────┘    └─────────┘
  1. Execution starts at entry step
  2. Each step processes, then transitions via next
  3. Execution ends when a step has end: true

State Types Overview

TypePurposeKey Fields
taskExecute an actionaction, parameters, mode
setSet variables without actionset, output
waitPause executionseconds or timestamp
routerConditional branchingroutes, default
parallelConcurrent branchesbranches, maxConcurrency
mapIterate over arrayitems, itemProcessor
succeedSuccessful terminationoutput
failFailure terminationerror, cause

Next Steps