Volume 10 · Chapter 11 — Messaging and Event-Driven Architecture

Step Functions in Depth and Messaging Service Selection

Goutham Mayaluri 4 min read AWSCloudStep FunctionsMessaging

11.1 Introduction

This chapter deepens Step Functions (Standard vs Express workflows, state types, error handling, and integration patterns) and consolidates the messaging services into a selection framework - because the exam frequently asks “which messaging/integration service fits this scenario?“

11.2 Standard vs Express Workflows

Step Functions has two workflow types.Standard workflowsare durable and long-running (up to a year), exactly-once execution, with full execution history - for long-running, auditable business processes and orchestration (a payment saga, an order fulfillment).Express workflowsare high-volume, short-duration (up to 5 minutes), at-least-once, and much cheaper per execution - for high-throughput event processing (IoT ingestion, streaming transforms). The exam distinction: Standard for durable, long, auditable, exactly-once orchestration; Express for high-volume, short, cheap event processing. Choose by duration, throughput, and cost profile.

11.3 State Types and Error Handling

A Step Functions state machine is composed ofstates:Task(do work - invoke a Lambda, call an AWS service),Choice(branch on conditions),Parallel(run branches concurrently),Map(iterate over an array, optionally in parallel),Wait(pause),Pass,Succeed, andFail. Robust error handling is built in:Retry(with backoff and max attempts on specified errors) andCatch(route to a fallback/compensation state on error) - which is exactly what makes Step Functions ideal for sagas (each step’s Catch triggers compensation). This built-in retry/catch and the visual state machine make complex, resilient workflows far easier than coding them, a key exam advantage over ad-hoc orchestration.

flowchart TD
  Q{Integration need?} -->|One consumer, decouple/buffer| SQS[SQS]
  Q -->|One event to many consumers| SNS[SNS fan-out]
  Q -->|Content routing, AWS/SaaS integration| EB[EventBridge]
  Q -->|Continuous ordered stream, replay| KDS[Kinesis]
  Q -->|Multi-step workflow, error handling| SF[Step Functions]
  Q -->|Existing broker/Kafka migration| MQ[Amazon MQ / MSK]

11.4 Integration Patterns

Step Functions Task states integrate with services in three patterns the exam tests.Request-Response(default): call the service and continue immediately.Run a Job (.sync): call the service andwaitfor the job to complete before continuing (e.g. wait for a Glue job or ECS task to finish).Wait for Callback (.waitForTaskToken): pause the workflow and wait until an external process calls back with a task token - for human approval steps or long external processes, so the workflow resumes only when the callback arrives. These patterns let a workflow coordinate synchronous calls, long-running jobs, and human/external steps. Knowing.sync(wait for completion) and.waitForTaskToken(wait for external callback) is a common exam point.

11.5 Choosing a Messaging/Integration Service

The consolidated decision:SQSto decouple and buffer work for a single consumer (load-leveling, competing consumers).SNSto fan one message out to many consumers (with SQS queues for durability).EventBridgefor content-based routing and integration across AWS services and SaaS.Kinesisfor continuous, ordered, multi-consumer, replayable streaming (Firehose for managed delivery).Step Functionsto orchestrate multi-step workflows with error handling.Amazon MQ/MSKto migrate existing broker/Kafka applications. The exam is largely these “which service?” judgments, and matching the scenario’s needs - decouple, fan-out, route, stream, orchestrate, or migrate - to the right service is the core skill.

11.6 Banking Production Scenario

A bank orchestrates its cross-account transfer as a Standard Step Functions workflow implementing a saga: Task states perform each step, Choice branches on results, Catch triggers compensation on failure, and a.waitForTaskTokenstate pauses for a manual approval on high-value transfers, resuming on callback. High-volume event preprocessing uses Express workflows. Around it, the bank uses SQS to decouple and buffer, SNS-to-SQS to fan events out, EventBridge to route by content and integrate SaaS, and Kinesis to stream the transaction feed - each chosen for its role. A legacy broker app migrates to Amazon MQ. This deliberate selection and orchestration across the messaging family is exactly the professional-level integration design the certification targets.

11.7 Chapter Revision Notes

  • Step Functions: Standard workflows (durable, up to 1 yr, exactly-once, auditable - orchestration/sagas) vs Express (high-volume, ≤5 min, at-least-once, cheap - event processing).
  • States: Task, Choice, Parallel, Map, Wait, Pass, Succeed, Fail; built-in Retry (backoff) and Catch (compensation) make sagas and resilient workflows easy.
  • Integration patterns: Request-Response (continue), .sync (wait for job completion), .waitForTaskToken (wait for external callback / human approval).
  • Service selection: SQS (decouple/buffer, one consumer), SNS (fan-out), EventBridge (content routing/integration), Kinesis (streaming), Step Functions (orchestration), MQ/MSK (migrate broker/Kafka).
  • The exam is largely matching the scenario to the right integration service.