AWS Step Functions – DVA-C02 Bare Essentials

1. What is AWS Step Functions?

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.


2. State Machine

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.


3. Task State

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.


4. Why Step Functions instead of Lambda chaining?

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


5. Built-in Retry

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.


6. Catch (Error Handling)

Explanation: After retries are exhausted:

Use Catch to move the workflow to another state.

Example:

Task
   ↓
Retry
   ↓
Still fails
   ↓
Catch
   ↓
NotifyFailure

Exam Tip: Retry = try again

Catch = what to do after failure


7. Retry + Catch Together

Explanation:

Typical pattern:

Task
   ↓
Retry (3 attempts)
   ↓
Failure
   ↓
Catch
   ↓
Cleanup
Notify
Rollback

This keeps error handling outside Lambda code.


8. Wait State

Explanation: Wait pauses the workflow.

Can wait: - Seconds - Minutes - Hours - Days - Until a timestamp

Useful for: - Delays - Scheduling - Human approval


9. Human Approval (WaitForTaskToken)

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


10. Long-running Workflows

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


11. Visual Monitoring

Explanation: Step Functions provides: - Visual execution graph - Current state - Success/failure - Input/output of each step - Execution history

Very useful for debugging workflows.


12. Parallel State

Explanation: Run multiple branches simultaneously.

Example:

Order
   ↓
Parallel
 ↙     ↘
Payment Inventory
 ↘     ↙
 Continue

Useful when tasks are independent.


13. Choice State

Explanation: Acts like an if/else.

Example:

Amount > 10000?
       ↓
     Yes
      ↓
Manager Approval

No
 ↓
Process Order

14. Common Exam Trap

Wrong - 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.


15. Services Comparison

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

DVA-C02 Exam Memory Sheet