100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

AWS Step Functions Cheat Sheet

AWS Step Functions Cheat Sheet

ASL state types, error handling, and CLI/SDK commands for building and running serverless workflow orchestrations.

3 PagesIntermediateMar 3, 2026

Basic State Machine (ASL)

A minimal state machine with a Task and a Choice state.

json
{  "Comment": "Order processing workflow",  "StartAt": "ValidateOrder",  "States": {    "ValidateOrder": {      "Type": "Task",      "Resource": "arn:aws:lambda:us-east-1:123456789012:function:validateOrder",      "Next": "IsValid"    },    "IsValid": {      "Type": "Choice",      "Choices": [        { "Variable": "$.valid", "BooleanEquals": true, "Next": "ProcessPayment" }      ],      "Default": "RejectOrder"    },    "ProcessPayment": {      "Type": "Task",      "Resource": "arn:aws:lambda:us-east-1:123456789012:function:charge",      "End": true    },    "RejectOrder": {      "Type": "Fail",      "Error": "OrderInvalid",      "Cause": "Validation failed"    }  }}

Retry & Catch on a Task

Standard error-handling block for a Task state.

json
{  "Type": "Task",  "Resource": "arn:aws:lambda:us-east-1:123456789012:function:charge",  "Retry": [    {      "ErrorEquals": ["States.TaskFailed"],      "IntervalSeconds": 2,      "MaxAttempts": 3,      "BackoffRate": 2.0    }  ],  "Catch": [    {      "ErrorEquals": ["States.ALL"],      "ResultPath": "$.error",      "Next": "NotifyFailure"    }  ],  "Next": "ShipOrder"}

Map State for Fan-Out

Process each item in an array concurrently.

json
{  "Type": "Map",  "ItemsPath": "$.items",  "MaxConcurrency": 5,  "Iterator": {    "StartAt": "ProcessItem",    "States": {      "ProcessItem": {        "Type": "Task",        "Resource": "arn:aws:lambda:us-east-1:123456789012:function:processItem",        "End": true      }    }  },  "End": true}

Start & Describe an Execution (CLI)

Kick off a workflow run and check its status.

bash
aws stepfunctions start-execution \  --state-machine-arn arn:aws:states:us-east-1:123456789012:stateMachine:OrderFlow \  --input '{"orderId": "o-123"}'aws stepfunctions describe-execution \  --execution-arn arn:aws:states:us-east-1:123456789012:execution:OrderFlow:abc123

ASL State Types

The eight state types you can use in a state machine definition.

  • Task- invokes a Lambda, activity, or AWS service integration
  • Choice- branches based on conditions evaluated against the input
  • Parallel- runs fixed branches concurrently
  • Map- iterates over an array, running a sub-workflow per item
  • Wait- pauses for a duration or until a timestamp
  • Pass- passes input to output, optionally injecting data
  • Succeed / Fail- terminal states that end the execution
Pro Tip

Prefer Express workflows for high-volume, short-duration event processing (sub-5-min, at-least-once) and Standard workflows for anything needing exactly-once semantics and execution history longer than CloudWatch Logs retention.

Was this cheat sheet helpful?

Explore Topics

#AWSStepFunctions#AWSStepFunctionsCheatSheet#CloudComputing#Intermediate#BasicStateMachineASL#RetryCatchOnATask#Map#State#Functions#ErrorHandling#CommandLine#CheatSheet#SkillVeris
Advertisement
Sri Hayavadhana Info-Tech

Professional Web Designing Services

  • Responsive Websites
  • E-commerce Solutions
  • SEO Friendly Design
  • Fast & Secure
  • Support & Maintenance
Get a Free Quote

Share this Cheat Sheet