Step Functions

Definition: AWS Step Functions is a serverless workflow orchestration service.
Serverless does not mean there are no servers; it means that you do not manage, provision, or scale them
You define a state machine (steps, branches, retries, timeouts) in JSON called Amazon States Language (ASL). Step Functions runs the workflow, calls each step in order, tracks state, and handles failures — without you writing a custom coordinator in code.

Scenarios where Step Functions fits

Scenario Why Step Functions
Order processing Validate → charge → ship → notify; branch on payment failure
Human approval Wait for manager approve/reject, then continue or cancel
Media pipeline Upload → transcode → thumbnail → publish — parallel steps
Data ETL Extract → transform → load with retries on transient errors
Microservice saga Coordinate compensating steps if one service fails

Where it is placed in architecture

Step Functions sits in the orchestration layer — between the trigger and the workers:

Trigger (API Gateway, EventBridge, S3 event, manual)
        │
        ▼
  Step Functions  ◄── you are here (defines and runs the workflow)
        │
        ├──► Lambda
        ├──► ECS / Fargate task
        ├──► SNS / SQS
        ├──► DynamoDB
        └──► other AWS services / HTTP

Flow diagram

flowchart LR
    Start([Order placed]) --> V[ValidateOrder Lambda]
    V --> P[ChargePayment Lambda]
    P --> C{paymentStatus?}
    C -->|FAILED| N[SNS NotifyFailure]
    C -->|OK| S[ShipOrder Lambda]
    S --> End([Done])
    N --> End