Diagram 7 of 12

Events and orchestration with Step Functions

An event enters through API Gateway, EventBridge routes it, and Step Functions coordinates the Lambda functions that validate and charge an order. Aurora Serverless v2 records the result. Each step can retry or compensate without manual orchestration code.

Amazon API GatewayAmazon EventBridgeAWS Step FunctionsAWS LambdaAmazon Aurora Serverless v2

Diagram

Diagram 7: events and orchestration (EventBridge + Step Functions)AWS CloudAPIAmazon APIGatewayEBAmazonEventBridgeSFNAWS StepFunctionsλAWS Lambda(validation)λAWS Lambda(payment)AURAmazon AuroraServerless v2123451. API Gateway receives the HTTP request and publishes an event to EventBridge.2. EventBridge evaluates its rules and sends the event to Step Functions.3. Step Functions invokes the validation Lambda function.4. If validation succeeds, Step Functions invokes the payment Lambda function.5. The payment function records the transaction in Aurora Serverless v2.

Comments

Information flow

  1. Amazon API Gateway

    API Gateway receives the HTTP request and publishes an event to EventBridge.

  2. Amazon EventBridge

    EventBridge evaluates the bus rules and sends the event to Step Functions.

  3. AWS Step Functions

    Step Functions starts the state machine and invokes the validation Lambda function.

  4. AWS Lambda (validation and payment)

    If validation succeeds, Step Functions invokes the payment Lambda function.

  5. Amazon Aurora Serverless v2

    The payment function records the transaction in Aurora.