Step Functions states and data flow
A workflow is a state machine
Step Functions coordinates steps of a process. A state is one named step; transitions define where to go next. Unlike choreography, where services independently react to events, orchestration explicitly coordinates the order, decisions and recovery. The following Amazon States Language (ASL) definition uses JSONPath (the default query language) and no external tasks. Given {"approved":true}, it returns the original field and decision.status = accepted. With false it fails with OrderRejected.
{ "StartAt": "Check", "States": { "Check": { "Type": "Choice", "Choices": [ { "Variable": "$.approved", "BooleanEquals": true, "Next": "Accept" } ], "Default": "Reject" }, "Accept": { "Type": "Pass", "Result": { "status": "accepted" }, "ResultPath": "$.decision", "End": true }, "Reject": { "Type": "Fail", "Error": "OrderRejected" } }}State types and service integrations
Task performs work through an integration or activity; Pass forwards or constructs data; Choice branches according to conditions; Wait delays progress; Succeed and Fail terminate explicitly. Parallel runs separate branches and returns their results; Map processes items, with a chosen concurrency bound where supported. Inline Map and Distributed Map have different capabilities. Set timeouts and choose narrow execution-role permissions for each actual integration. A callback task token can signal completion for supported Standard integrations; protect the token as sensitive data. This lesson uses no actual callback or task invocation.
JSONPath data flow
InputPath selects input for a state; Parameters can construct the request from selected fields; ResultSelector can shape a task result; ResultPath places the result relative to the original input; OutputPath selects what continues. These fields depend on the state type. In Accept, ResultPath $.decision preserves approved and inserts the decision. Omitting ResultPath normally replaces the input with the result for result-producing states; null discards the result. JSONata is another supported query language with different fields, not interchangeable syntax. Avoid passing secrets or large documents through history; pass a narrowly scoped reference instead.
Choose Standard or Express
Standard supports up to one year, durable execution and normally 90 days of closed execution history; retries and independent duplicate starts still require business idempotence. Express supports up to five minutes. Asynchronous Express can execute more than once; synchronous Express has an at-most-once execution model, not an exactly-once business guarantee. Express history requires CloudWatch logging; logging delivery is not a durable business ledger. Express does not support .sync or .waitForTaskToken integration patterns or Distributed Map. Workflow type is fixed at creation. Verify current quotas before deploying.
Practice data flow
Trace approved=true and approved=false using the offline lab. Predict the output if Accept omits ResultPath. Choose a workflow type for a 30-minute approval and another for a 10-second idempotent transform. Explain why a Choice is not a Task. Next: handle transient errors and replay without unbounded side effects.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Step Functions states and data flow — knowledge check
Apply the lesson to offline event and workflow scenarios.
The example receives approved=true. What is its output?
Which state chooses a path without invoking an external task?
Which state processes a collection of items?
A workflow may wait 30 minutes for approval. Which type fits?
What does asynchronous Express at-least-once execution imply?