Explanation: - AWS Step Functions is a workflow orchestration service. - It coordinates multiple AWS services (especially Lambda) into a State Machine. - Instead of Lambda functions calling each other, Step Functions controls the workflow.
Remember:
Step Functions = Orchestrate workflows, not business logic.
Explanation: A workflow in Step Functions is called a State Machine.
A State Machine consists of States, such as: - Task - Choice - Wait - Parallel - Map - Pass - Succeed - Fail
Exam Tip:
Step Functions workflows are defined as State Machines.
Explanation: A Task state performs actual work.
Typical Task actions: - Invoke Lambda - Call AWS SDK - Invoke ECS task - Run Batch job - Start another Step Function
Remember:
Task = Do something.
Explanation: Instead of:
Lambda A → Lambda B → Lambda C
Use:
Step Functions → Lambda A → Lambda B → Lambda C
Benefits: - Easier maintenance - Visual workflow - Built-in retries - Built-in error handling - Parallel execution - Less custom code
Exam Tip: If the question says: - many Lambda functions - difficult orchestration - complex workflow
Answer = Step Functions
Explanation: Task states support automatic retries.
Configure: - MaxAttempts - IntervalSeconds - BackoffRate
Example:
Retry:
- MaxAttempts: 3
- IntervalSeconds: 5
Meaning: - Retry 3 times - Wait 5 seconds between retries
Remember:
Retry is configured in Step Functions, not inside Lambda.
Explanation: After retries are exhausted:
Use Catch to move the workflow to another state.
Example:
Task
↓
Retry
↓
Still fails
↓
Catch
↓
NotifyFailureExam Tip: Retry = try again
Catch = what to do after failure
Explanation:
Typical pattern:
Task
↓
Retry (3 attempts)
↓
Failure
↓
Catch
↓
Cleanup
Notify
RollbackThis keeps error handling outside Lambda code.
Explanation: Wait pauses the workflow.
Can wait: - Seconds - Minutes - Hours - Days - Until a timestamp
Useful for: - Delays - Scheduling - Human approval
Explanation: For human review:
Step Functions can pause using the WaitForTaskToken pattern.
The workflow waits until an external system returns the task token.
Useful for: - Insurance approval - Manager approval - Manual verification - Human review
Explanation:
Standard Workflow - Runs up to 1 year - Supports Wait states - Supports human approval
Express Workflow - Short-running - High-volume - Lower cost - Not designed for long-running approvals
Exam Tip: If workflow lasts: - days - weeks - months - human approval
Answer = Standard Step Functions
Explanation: Step Functions provides: - Visual execution graph - Current state - Success/failure - Input/output of each step - Execution history
Very useful for debugging workflows.
Explanation: Run multiple branches simultaneously.
Example:
Order
↓
Parallel
↙ ↘
Payment Inventory
↘ ↙
ContinueUseful when tasks are independent.
Explanation: Acts like an if/else.
Example:
Amount > 10000?
↓
Yes
↓
Manager Approval
No
↓
Process OrderWrong - Put retry logic inside Lambda.
Correct - Configure Retry in Step Functions.
Wrong - Use EventBridge to orchestrate workflows.
Correct - EventBridge routes events. - Step Functions orchestrates workflows.
Wrong - Use SNS/SQS to replace workflow logic.
Correct - SNS/SQS provide messaging. - Step Functions controls workflow execution.
| Requirement | AWS Service |
|---|---|
| Multi-step workflow | Step Functions |
| Retry failed task | Step Functions Retry |
| Error handling | Step Functions Catch |
| Human approval | WaitForTaskToken |
| Pause workflow | Wait State |
| Run tasks in parallel | Parallel State |
| Branch workflow | Choice State |
| Long-running workflow (up to 1 year) | Standard Workflow |
| High-volume short workflows | Express Workflow |
| Visual workflow execution | Step Functions |