Lesson 3 of 3 Application Integration and Business Applications

Exposing APIs and Coordinating Workflows with API Gateway and Step Functions

This lesson explains how applications made of pieces that call each other use Amazon API Gateway to expose those pieces as APIs and AWS Step Functions to coordinate them into multi-step workflows.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe what Amazon API Gateway provides.
  • Describe how AWS Step Functions coordinates the steps of a business process.
  • Distinguish messaging services from workflow services.

Building APIs

An API lets applications, such as a mobile app, use back-end systems without knowing how they work. Amazon API Gateway creates, publishes and secures REST, HTTP and WebSocket APIs at any scale; for example, a mobile app calls an API that runs Lambda functions. API Gateway handles the work that every API needs: authorising callers, throttling requests so the back end is not overwhelmed, caching responses and monitoring usage. The following table summarises the service.

ServiceWhat it doesExample
Amazon API GatewayCreates, publishes and secures REST, HTTP and WebSocket APIs at any scaleA mobile app calls an API that triggers Lambda functions
Select all that apply

API Gateway

Exam skills 3.8.1 · 3.8.4

Identify what Amazon API Gateway handles for an API.

Log in to try this activity Interactive activities are free with an account.

Coordinating steps

Many business processes have several steps that must happen in order, such as checking an order, charging the customer, reserving stock and sending a confirmation. AWS Step Functions runs such processes as workflows, defined visually as a series of steps called a state machine. It provides built-in retries, error handling, waits for human approval and parallel branches, so this logic does not have to be written into each component. Each step can call AWS Lambda or one of hundreds of AWS services directly.

Messaging versus workflows

AWS provides several services for connecting application components through messages, events and workflows. They differ as follows.

  • Amazon SQS queues messages so components can work at their own pace.
  • Amazon SNS sends one message to many subscribers (fan-out), including email and SMS.
  • Amazon EventBridge routes events from AWS services, SaaS apps and your own apps to targets by rules, and schedules tasks.
  • Step Functions coordinates a sequence of steps with state, which messaging alone does not track.
Match the pairs

Messaging or workflow?

Exam skills 3.8.1

Match each requirement with the integration service that meets it.

Log in to try this activity Interactive activities are free with an account.
Worked example

An order process must check stock, take payment, wait for a warehouse to confirm shipment and then send an email, retrying failed steps automatically. Which service coordinates these steps?

AWS Step Functions. SQS and SNS move messages between components but do not track the progress of a multi-step process or handle retries per step.

Check yourself

What does AWS Step Functions do?

Show answer

It coordinates several steps, such as Lambda functions and service calls, into a visual workflow with retries and error handling.

Exam Tips

Remember for the exam

  • API Gateway creates and secures REST, HTTP and WebSocket APIs.
  • API Gateway can throttle and cache requests to protect the back end.
  • Step Functions coordinates multi-step workflows with retries and error handling.
  • SQS decouples with queues; SNS fans out; EventBridge routes events.