Step Functions
Full ASL interpreter, cross-service task integrations, execution history.
fakecloud implements 37 of 37 Step Functions operations at 100% Smithy conformance, including a full ASL (Amazon States Language) interpreter.
Supported features
- State machines — CRUD, versions, aliases, tags. Both
STANDARDandEXPRESStypes. - Executions:
StartExecution(async; for a STANDARD state machine, repeating a name and input returns the execution while it runs andExecutionAlreadyExistsonce it has closed, as on AWS; for an EXPRESS state machine every call starts a new execution, so a name can be reused at once),StartSyncExecution(real synchronous Express runner that blocks until the state machine terminates and returns the final output; a givennameis used for the execution),StopExecution(stops the execution's states where they are, so nothing after the stop runs and its history ends withExecutionAborted, and stops a.syncchild it waits for and its map runs' children, with the causes AWS gives them; on an execution that has already ended, reports its stop date and changes nothing, as on AWS),DescribeExecution,GetExecutionHistory. As on AWS, those three,RedriveExecutionandDescribeStateMachineForExecutionrefuse an EXPRESS execution ARN withInvalidArn(except thatDescribeExecutionandDescribeStateMachineForExecutiondescribe a map run's EXPRESS children), andListExecutionsrefuses an EXPRESS state machine withStateMachineTypeNotSupported; a.syncTask still waits for an EXPRESS child, whose result carries no redrive fields. - ASL states — Pass, Task, Choice, Wait, Parallel, Map, Succeed, Fail
- Retry and Catch — full retry logic with exponential backoff, catch clauses with error filters.
RetryandCatchalso cover query errors inArguments,Items,OutputandAssign;States.TaskFaileddoes not match them, whileStates.ALLandStates.QueryEvaluationErrordo. A retried Parallel or Map state reruns its branches or iterations - JSONPath and JSONata: both query languages.
QueryLanguage: JSONatamachines and states evaluate{% %}expressions inArguments,Output,Assign,Condition,Items,ItemSelector,Seconds,Timestamp,Error,Causeand Map limits, with$states(input,context,result,errorOutput), workflow variables and$partition,$range,$hash,$random,$uuid,$parse; a failing expression isStates.QueryEvaluationError. - JSONPath paths: the full JSONPath syntax AWS accepts (
$['key'],[-1],[*], slices,..deep scan,[?(@.x > 1)]filters) inInputPath/OutputPath/ItemsPath/Parameters/ResultSelector/ItemSelectorand Choice rules. A path that matches nothing fails the execution withStates.Runtime, as on AWS (onlyIsPresentmay probe a missing field) - Choice rules: every comparator and its
*Pathform (String/Numeric/Timestamp Equals, LessThan, GreaterThan, LessThanEquals, GreaterThanEquals, BooleanEquals, StringMatches), theIs*type tests andAnd/Or/Not - Intrinsic functions: all
States.*functions, nested up to 10 levels (States.ArrayGetItem(States.StringSplit($.s, ','), 0)) with the\',\{,\},\\string escapes; a failing intrinsic fails the state withStates.Runtime, naming the call, which noRetryorCatchwildcard takes - Task integrations: Lambda (
invoke,invoke.waitForTaskToken), SQS (sendMessage), SNS (publish), EventBridge (putEvents), DynamoDB (getItem/putItem/updateItem/deleteItem), ECS (runTask,.sync,.waitForTaskToken), Athena and Glue, and nested Step Functions (states:startExecution,.sync,.sync:2,.waitForTaskToken)..syncwaits for the child execution and returns its description withOutputas an escaped string,.sync:2withInputandOutputas JSON; a failed child fails the parent task withStates.TaskFailedand the child's description as the cause. Most optimized results also carrySdkHttpMetadataandSdkResponseMetadata, as on AWS (notevents:putEventsorathena:startQueryExecution). Definitions name these parameters in PascalCase, and a missingStateMachineArnis anInvalidDefinitionatCreateStateMachine, as on AWS. - AWS SDK integrations:
arn:aws:states:::aws-sdk:<service>:<action>for every modeled and registered fakecloud service, over that service's real protocol (AWS JSON, REST JSON, REST XML, query, EC2 query) driven by its Smithy model. Parameters and results use PascalCase member names, dates are ISO-8601, and failures are<Service>.<Name>Exception. The table is generated byscripts/gen-sfn-sdk-models.py. - Map state: parallel item processing with concurrency control. Supports distributed mode (
ItemProcessor.ProcessorConfig.Mode=DISTRIBUTED) withMaxConcurrency,ToleratedFailureCount,ToleratedFailurePercentage(and their*Pathforms), and:ItemReaderovers3:getObject, which requiresReaderConfig:InputTypeJSON(arrays, and objects as{Key, Value}entries, withItemsPointer),JSONL,CSV(CSVHeaderLocation,CSVHeaders,CSVDelimiter),PARQUETorMANIFEST,ManifestTypeS3_INVENTORYorATHENA_DATA, and GZIP and ZSTD input files. Overs3:listObjectsV2, optionally withTransformation: LOAD_AND_FLATTEN.MaxItems/MaxItemsPathlimit either. A failed read isStates.ItemReaderFailed.ResultWriterovers3:putObject, writing<Prefix>/<map run>/manifest.jsonplusSUCCEEDED_0.json,FAILED_0.jsonandPENDING_0.json; the state's output is{MapRunArn, ResultWriterDetails}.WriterConfigappliesTransformation(NONE,COMPACT,FLATTEN) andOutputType(JSON,JSONL), and alone shapes the state output without exporting. A failed write isStates.ResultWriterFailed.- A run past its tolerance still writes its results, then fails with
States.ExceedToleratedFailureThreshold, and items it never started are reported inPENDING_0.json. - Each iteration is a child execution (
ProcessorConfig.ExecutionTypeSTANDARDorEXPRESS) of the labeled state machine<machine>/<Label>, named by a stable id when the state has noLabel. As on AWS,ListExecutionstakes amapRunArnand lists them withmapRunArnanditemCount,DescribeExecutionandDescribeStateMachineForExecutiondescribe them (EXPRESS ones too),DescribeStateMachinedescribes the labeled state machine, and the parent's history recordsMapRunStarted/MapRunSucceededinstead of the iterations. Stopping the parent aborts its map run and the children still running, which count as results written.
- Variables:
Assignin JSONPath and JSONata states, on states, Choice rules and catchers. Parallel branches and Map iterations have their own scope and read outer ones, except a distributed Map's iterations, which cannot; an inner scope can't assign a name an outer scope assigns. References read the values from state entry. - Parallel state — concurrent branch execution
- Activities — real worker pool. A
Taskstate with an activity ARN inserts a pending task;GetActivityTasklong-polls (up toFAKECLOUD_SFN_GET_ACTIVITY_TIMEOUT_SECS, default 5s) for the next pending task;SendTaskSuccess/SendTaskFailureresolve the workflow.HeartbeatSecondsandTimeoutSecondsare enforced, and tasks dispatched past their timeout are reaped automatically. - Execution logging: a state machine's
LoggingConfigurationdelivers its executions' history to the CloudWatch Logs group, in AWS's format:- Each event is one JSON line, with
detailsand stringid,type,previous_event_id,event_timestampandexecution_arn. - Input and output appear only with
includeExecutionData. ALLlogs every event,ERRORfailures, aborts and timeouts,FATALonly the execution's own end.- Streams are
states/<machine>/<YYYY-MM-DD-HH>/00000000for STANDARD executions and.../<YYYY-MM-DD-HH-MM>/00000000for EXPRESS ones. - A distributed Map's children log under the parent's machine; their first and last events carry
map_run_arnandparent_execution_arn. A stopped execution logs itsExecutionAborted, and so does each map run child it stopped. - As on AWS,
CreateStateMachineandUpdateStateMachinerefuse a log group that doesn't exist withInvalidLoggingConfiguration.
- Each event is one JSON line, with
- State machine execution history — full event log per execution
- Error handling —
States.ALL,States.TaskFailed,States.Timeout,States.HeartbeatTimeout, custom error names
Protocol
JSON protocol. X-Amz-Target header, JSON body, JSON responses.
Introspection
GET /_fakecloud/stepfunctions/executions— list all executions with status, input, output (both as structured JSON), and timestampsPOST /_fakecloud/stepfunctions/enqueue-activity-task— directly insert a pending activity task (skipping a state-machine execution). Body:{"activityArn": "...", "input": "{}", "heartbeatSeconds": 60, "timeoutSeconds": 300}. Returns{"taskToken": "..."}. Useful for testing worker pool clients without authoring a full ASL workflow.
Cross-service delivery
- Step Functions -> Lambda / SQS / SNS / EventBridge / DynamoDB — Task states invoke functions, send messages, publish events, and read/write items
- Step Functions -> Step Functions: nested executions via
states:startExecutionand its.sync,.sync:2and.waitForTaskTokenvariants. The.syncvariants block the parent until the child reaches a terminal state, surfacing the child's output or failure (States.TaskFailedwith the child's cause) back to the parent task. - Step Functions -> CloudWatch Logs — Express state machine execution events stream to the configured log group.
Why this matters
Most emulators stub Step Functions or support a tiny subset of the ASL spec. fakecloud runs the full interpreter — your state machine definitions execute with real branching, retries, catches, and task integrations. This lets you test orchestration logic end-to-end without touching real AWS.