Step Functions defines how tasks, decisions, delays, and external callbacks form a workflow. Choose the execution type and integration pattern before designing failure handling.
Standard and Express workflows
Step Functions runs a workflow, a sequence of steps with rules for moving between them. Its state machineA definition of workflow states and the transitions between them. is the workflow definition; an executionOne run of a state machine. is one run. Choose Standard for long processes and Express for short event processing.
How it works
- Select a workflow type when creating the state machine. Standard is the default, and the type is fixed after creation.
- Choose execution behavior using the table below. An idempotent actionAn action whose repeated execution does not change its intended outcome. has the same outcome when repeated, so duplicate processing does not change its result.
- Start asynchronous Express with
StartExecutionor synchronous Express withStartSyncExecutionwhen the caller needs to wait for the result. - Inspect state inputs and outputs in execution details. Enable CloudWatch Logs to record Express execution history.
| Workflow | Execution guarantee | Maximum duration | Billing basis |
|---|---|---|---|
| Standard | Exactly once, unless retries are configured | One year | State transitionsMovement from one workflow state to the next. |
| Asynchronous Express | At least once | Five minutes | Executions, duration, memory |
| Synchronous Express | At most once | Five minutes | Executions, duration, memory |
Exam cues
- If the question says a payment process waits for hours, think Standard, because it supports long runs without implicit task repetition.
- If the question says a short transformation must return results to its caller, think synchronous Express, because its start call waits for completion.
- If the question says Express failures need investigation, think enabled CloudWatch Logs, because Express does not retain execution history within Step Functions.
Remember
- Standard: up to one year and normally 90 days of completed execution history.
- Express: up to five minutes; design its work to be idempotent.
- Activities, Distributed Map, job waiting, and task-token callbacks require Standard.
Trap: Synchronous Express starting an execution is different from a Task using
.sync. Express does not support the job-waiting integration pattern.
Trap: Standard’s execution guarantee does not prevent the retries you explicitly configure.
From the AWS docs (15)
- A state machine defines a workflow; Standard is the default type, and its type cannot be changed after creation.
- Standard workflows can run for up to one year.
- Standard executes tasks and states exactly once unless the workflow explicitly configures retries.
- Standard execution history is normally retained for 90 days after completion.
- Standard workflow billing counts state transitions.
- Express workflows can run for up to five minutes.
- Asynchronous Express provides at-least-once execution; synchronous Express provides at-most-once execution.
- StartExecution starts asynchronous Express and returns before completion; StartSyncExecution waits for synchronous Express results.
- Express billing depends on execution count, duration, and memory consumption.
- Standard supports activities, Distributed Map, and supported job and callback integrations; Express does not support those features.
- An idempotent action tolerates repetition without changing the outcome; AWS recommends idempotent work for Express.
- Execution details expose state inputs and outputs; Express execution history requires CloudWatch Logs logging to be enabled.
- A Parallel state runs several branches at the same time and continues when all branches finish.
- Step Functions state types are Task (one unit of work), Choice (branch on input), Parallel (fixed parallel branches), Map (the same steps for each item of an array), Pass, Wait (pause for a time or until a date), and the terminal Succeed and Fail states.
- Amazon SWF coordinates tasks done by workers that run on EC2 or on premises; for most new workflows AWS recommends Step Functions instead.
Service integration patterns
Step Functions service integrations call work from a state machineA definition of workflow states and the transitions between them., the definition of a workflow. Amazon States LanguageThe JSON-based language used to define Step Functions state machines. (ASL) is the JSON-based language that describes its steps and transitions. The integration pattern determines what completion means: an API response, a finished job, or an external callback.
How it works
- Define the work in a
Taskstate. Grant its state machine an IAM execution roleAn IAM role granting a state machine permission to access AWS resources., the permission-bearing identity Step Functions uses to access AWS resources. - Choose the integration pattern below. Only use a job or callback pattern where that integration supports it.
- Route results with
Choice, delay withWait, or coordinate concurrent work withParallelandMap.
| Pattern | Continue when | Workflow support |
|---|---|---|
| Request-response | The API responds | Standard and Express |
.sync |
The supported job finishes | Standard |
.waitForTaskToken |
An external process reports using its token | Standard |
| Flow state | Purpose |
|---|---|
Choice |
Select a branch from conditions; Default handles no match |
Wait |
Delay for a duration or until a timestamp |
Parallel |
Run different branches and wait for all to terminate |
Map |
Repeat steps for every dataset item |
Exam cues
- If the question says a Batch job must finish before the next step, think
.syncon Standard, because submission success only means the API accepted the job. - If the question says repeat steps for each record, think Map; if it says run different checks together, think Parallel, because their units of concurrency differ.
- If the question says wait until a future time, think Wait, because it delays workflow progress without invoking a worker.
- If the question says coordinate remediation for an exposed IAM access key, think an EventBridge rule matching AWS Health
AWS_RISK_CREDENTIALS_EXPOSEDand targeting Step Functions, because service events can start a response workflow.
Remember
- Inline Map is the default: up to 40 concurrent iterations. Distributed Map: up to 10,000 parallel child executionsOne run of a state machine..
- Same-account
.syncmonitoring uses polling and EventBridge; cross-account monitoring uses polling only. .synccancellation is best effort, so an aborted workflow can leave a job running.
Trap: A successful request-response job submission does not mean the background job has completed. Choose a supported
.syncintegration when completion must precede the next step.
Step Functions starts an ECS task using the .sync pattern.
Step Functions waits for the job to finish before invoking the next task.
From the AWS docs (16)
- Amazon States Language is a JSON-based language for defining state machines, their work, and their transitions.
- A Task represents one unit of work, using an activity, Lambda, a supported service, or an HTTPS API.
- Request-response proceeds after the API responds and does not wait for a submitted background job to finish.
- The .sync suffix waits for completion of a supported job, including Batch, ECS, Glue, CodeBuild, or a nested Step Functions execution.
- The .waitForTaskToken suffix waits for an external process to return its task token using SendTaskSuccess or SendTaskFailure.
- Express supports request-response only; Standard also supports job and callback patterns for integrations that provide them.
- Same-account .sync monitoring uses API polling and EventBridge events; cross-account .sync uses polling only.
- When a .sync task is aborted, cancellation is best effort and the external job can keep running.
- Choice selects a branch by evaluating conditions; no match without a Default causes an error.
- Wait delays execution for a duration or until a timestamp without invoking a worker for the delay.
- Parallel runs separate branches concurrently and waits for all branches to terminate before continuing.
- Map repeats a set of steps for each input item; Inline is the default mode and Distributed runs child workflows.
- Inline Map supports up to 40 concurrent iterations; Distributed Map supports up to 10,000 parallel child workflow executions.
- The state machine IAM execution role grants permission to call integrated AWS resources.
- An EventBridge rule can target a Step Functions state machine and start a workflow when another service event matches.
- AWS Health emits AWS_RISK_CREDENTIALS_EXPOSED when AWS detects an exposed IAM access key; AWS documents routing that event to a Step Functions remediation workflow.
Flashcards
Nothing to review here right now. Pick other topics or another filter.
·
All 13 cards as a list
How do Step Functions Standard and Express differ in duration, history, billing, and integrations?
Standard: up to one year, normally 90-day history, billed per state transition, with supported job and callback patterns. Express: up to five minutes, history through enabled CloudWatch Logs, billed by executions, duration, and memory; request-response only.
What execution guarantees do Step Functions Standard, asynchronous Express, and synchronous Express provide?
Standard: exactly once unless retries are configured. Asynchronous Express: at least once. Synchronous Express: at most once. Use idempotent work for Express.
A Step Functions payment workflow can wait several hours and must avoid implicit duplicate task execution. Which workflow type fits?
Standard. It supports long executions and does not repeat tasks unless retries are configured. Make payment retry handling deliberate.
A short Step Functions transformation must return its result directly to an API caller. Which Express start API fits?
StartSyncExecution. Synchronous Express waits for completion and returns results; the workflow must finish within five minutes.
A Step Functions Express workflow fails, but its execution history is unavailable. What should the team configure?
Enable CloudWatch Logs for the Express state machine. Use execution details to inspect individual state inputs and outputs.
A Step Functions workflow must run three independent checks at the same time and continue when all finish. Which state type fits?
A Parallel state.
A workflow must run the same processing steps for every file listed in its input, and pause until a set date before reporting. Which Step Functions states fit?
A Map state for the per-file steps and a Wait state for the pause. Parallel runs fixed branches, and Choice picks one branch from the input.
An exam option offers Amazon SWF for a new workflow. When does SWF still fit, and what does AWS recommend first?
SWF coordinates tasks run by workers on EC2 or on premises. For most new workflows AWS recommends Step Functions.
How do Step Functions request-response, .sync, and .waitForTaskToken integrations differ?
Request-response waits for the API response. .sync waits for a supported job to finish. .waitForTaskToken waits for a token callback. Express supports request-response only.
A team chains Lambda functions and needs branching, retries, and delays between calls. How should it coordinate the process?
Define a Step Functions state machine in Amazon States Language. Task states call the functions; Choice selects branches and Wait implements delays without a worker.
A Step Functions workflow must process each item in an array, then run two different checks concurrently. Which states fit?
Map repeats the processing steps for each item. Parallel runs the different checks in separate branches and joins after all branches terminate.
A Step Functions state machine definition calls a service, but the call is denied. Which identity needs permission?
The state machine IAM execution role. Its policies must authorize access to the integrated AWS resource.
A team must coordinate credential remediation after AWS Health reports an exposed IAM access key. How can it start a Step Functions workflow?
Match AWS_RISK_CREDENTIALS_EXPOSED with an EventBridge rule targeting the remediation state machine. The workflow can coordinate the response tasks.