"A multi-step job needs one big script." It's the usual first version: a script that validates an order, charges the card, ships it and sends the email. Then it fails at step four, and you have to work out what already ran before starting over. AWS Step Functions turns that script into a workflow of separate steps, each with its own error handling, that you can watch run.
Workflows made of states
In Step Functions a workflow is a state machine, written in the Amazon States Language (JSON or YAML) or drawn in the visual editor, Workflow Studio. Each step is a state:
- Task: does the work, by calling an AWS service, a Lambda function or an HTTPS endpoint.
- Choice: branches on the data ("amount over 1,000? send for review").
- Parallel and Map: run branches side by side, or the same steps for every item in a list.
- Wait: pauses for a time or until a date.
Every execution is drawn as a graph in the console, with the input and output of each step, so you can see exactly where a run stopped and why.
Retries and error handling per step
Each Task can declare Retry rules (which errors, how many attempts, with exponential backoff) and Catch rules (where to go when retries run out, such as a cleanup or notification step). One flaky API call no longer sinks the whole job, and the error handling lives in the workflow definition instead of being scattered through your code.
Call services directly
Step Functions integrates with over two hundred AWS services through AWS SDK integrations, plus optimized integrations for services such as Lambda, DynamoDB, SQS, SNS, ECS, Glue and Bedrock. Many steps that used to need a Lambda function just to call another API can call the service directly, which means less glue code to write, deploy and pay for.
Standard vs Express
You choose the type when you create the state machine, and it can't be changed later:
- Standard: runs up to one year, exactly-once execution, full execution history, billed per state transition. Use it for long, auditable or non-idempotent processes like payments and approvals.
- Express: runs up to five minutes, at-least-once (asynchronous) or at-most-once (synchronous), billed by executions, duration and memory. Use it for high-volume event processing.
A common mistake is choosing Express for a process that waits for people: Express doesn't support the callback (.waitForTaskToken) pattern, so human approval needs Standard.
Where AI fits
Step Functions is a natural way to chain prompts. With the optimized Amazon Bedrock integration, one step can extract facts from a document, the next can draft a reply from those facts, and a Choice state can check the result, each step with its own retries. AWS publishes a sample project for exactly this prompt-chaining pattern.
For human approval, a step uses the wait-for-callback pattern: it sends a task token (for example in an email, a queue message or a ticket) and the workflow pauses. When a reviewer approves, your app calls SendTaskSuccess with the token and the workflow continues; a rejection calls SendTaskFailure. A Standard workflow can wait up to its one-year limit, so set a heartbeat or timeout to avoid runs stuck forever.
Quick recap
- Steps, not scripts: each state does one thing, and you can see every run.
- Retries and Catch per step, and direct calls to 200+ AWS services.
- Standard for long jobs and approvals, Express for fast, high-volume ones.