What is AWS Step Functions? - AWS Step Functions

What is AWS Step Functions?

AWS Step Functions is a serverless orchestration service that lets you integrate with AWS Lambda functions and other AWS services to build business-critical applications. Through Step Functions' graphical console, you see your application’s workflow as a series of event-driven steps.

Step Functions is based on state machines and tasks. In Step Functions, a workflow is called a state machine, which is a series of event-driven steps. Each step in a workflow is called a state. A Task state represents a unit of work that another AWS service, such as AWS Lambda, performs. A Task state can call any AWS service or API.

With Step Functions' built-in controls, you examine the state of each step in your workflow to make sure that your application runs in order and as expected. Depending on your use case, you can have Step Functions call AWS services, such as Lambda, to perform tasks. You can create workflows that process and publish machine learning models. You can have Step Functions control AWS services, such as AWS Glue, to create extract, transform, and load (ETL) workflows. You also can create long-running, automated workflows for applications that require human interaction.

Tip

To familiarize yourself with the primary features of Step Functions through a series of interactive modules, see The AWS Step Functions Workshop. Or start using Step Functions by following these Getting Started tutorials to create a credit card application workflow.

AWS SDK and Optimized integrations

To call other AWS services, you can use Step Functions' AWS SDK integrations, or you can use one of Step Functions' Optimized integrations.

Standard and Express workflows

Step Functions has two workflow types. Standard workflows have exactly-once workflow execution and can run for up to one year. This means that each step in a Standard workflow will execute exactly once. Express workflows, however, have at-least-once workflow execution and can run for up to five minutes. This means that one or more steps in an Express Workflow can potentially run more than once, while each step in the workflow executes at least once.

Executions are instances where you run your workflow to perform tasks. Standard workflows are ideal for long-running, auditable workflows, as they show execution history and visual debugging. Express workflows are ideal for high-event-rate workloads, such as streaming data processing and IoT data ingestion.

Standard workflows specifications

  • 2,000 per second execution rate

  • 4,000 per second state transition rate

  • Priced by state transition

  • Show execution history and visual debugging

  • Support all service integrations and patterns

Express workflows specifications

  • 100,000 per second execution rate

  • Nearly unlimited state transition rate

  • Priced by number and duration of executions

  • Send execution history to Amazon CloudWatch

  • Show execution history and visual debugging based on the Log level enabled

  • Support all service integrations and most patterns

For more information about Standard and Express workflows, including Step Functions pricing, see the following:

Use cases

Step Functions manages your application's components and logic, so you can write less code and focus on building and updating your application quickly. This section describes typical use cases for working with Step Functions.

Use case #1: Function orchestration


          Chaining

You create a workflow that runs a group of Lambda functions (steps) in a specific order. One Lambda function's output passes to the next Lambda function's input. The last step in your workflow gives a result. With Step Functions, you can see how each step in your workflow interacts with one other, so you can make sure that each step performs its intended function.

For a tutorial that shows you how to create a state machine with a group of functions, see the following:

Use case #2: Branching


          Branching

A customer requests a credit limit increase. Using a Choice state, you can have Step Functions make decisions based on the Choice state’s input. If the request is more than your customer’s pre-approved credit limit, you can have Step Functions send your customer's request to a manager for sign-off. If the request is less than your customer’s pre-approved credit limit, you can have Step Functions approve the request automatically.

Use case #3: Error handling


          Retry/Catch

Retry

In this use case, a customer requests a username. The first time, your customer’s request is unsuccessful. Using a Retry statement, you can have Step Functions try your customer's request again. The second time, your customer’s request is successful.

Catch

In a similar use case, a customer requests an unavailable username. Using a Catch statement, you have Step Functions suggest an available username. If your customer takes the available username, you can have Step Functions go to the next step in your workflow, which is to send a confirmation email. If your customer doesn’t take the available username, you have Step Functions go to a different step in your workflow, which is to start the sign-up process over.

For more detailed examples of Retry and Catch statements, see the following:

Use case #4: Human in the loop


          Chaining

Using a banking app, one of your customers sends money to a friend. Your customer waits for a confirmation email. With a callback and a task token, you have Step Functions tell Lambda to send your customer’s money and report back when your customer’s friend receives it. After Lambda reports back that your customer’s friend received the money, you can have Step Functions go to the next step in your workflow, which is to send your customer a confirmation email.

To see a sample project that shows a callback with a task token, see the following:

Use case #5: Parallel processing


          Parallelism

A customer converts a video file into five different display resolutions, so viewers can watch the video on multiple devices. Using a Parallel state, Step Functions inputs the video file, so Lambda can process it into the five display resolutions at the same time.

Use case #6: Dynamic parallelism


          Chaining

A customer orders three items, and you need to prepare each item for delivery. You check each item's availability, gather each item, and then package each item for delivery. Using a Map state, Step Functions has Lambda process each of your customer's items in parallel. Once all of your customer's items are packaged for delivery, Step Functions goes to the next step in your workflow, which is to send your customer a confirmation email with tracking information.

To see a sample project that shows dynamic parallelism using a Map state, see the following:

Service integrations

Step Functions integrates with multiple AWS services. To combine Step Functions with these services, use the following service integration patterns:

Request a response (default)
  • Call a service, and let Step Functions progress to the next state after it gets an HTTP response.

Run a job (.sync)
  • Call a service, and have Step Functions wait for a job to complete.

Wait for a callback with a task token (.waitForTaskToken)
  • Call a service with a task token, and have Step Functions wait until the task token returns with a callback.

The table below shows the available service integrations and service integration patterns for Step Functions.

Standard Workflows and Express Workflows support the same integrations but do not support the same integration patterns. Express Workflows do not support Run a Job (.sync) or Wait for Callback (.waitForTaskToken). Optimized integrations pattern support is different for each integration. For more information, see Standard vs. Express Workflows.

Standard Workflows
Supported service integrations
Service Request Response Run a Job (.sync) Wait for Callback (.waitForTaskToken)
Optimized integrations Lambda
AWS Batch
DynamoDB
Amazon ECS/AWS Fargate
Amazon SNS
Amazon SQS
AWS Glue
SageMaker
Amazon EMR
Amazon EMR on EKS
Amazon EMR Serverless
CodeBuild
Athena
Amazon EKS
API Gateway
AWS Glue DataBrew
Amazon EventBridge
AWS Step Functions
AWS SDK integrations Over two hundred
Express Workflows

Supported regions

Most AWS regions support Step Functions. For a complete list of AWS regions where Step Functions is available, see the AWS Region Table.

Is this your first time using Step Functions?

If this is your first time using Step Functions, the following topics help you understand different parts of working with Step Functions, including how Step Functions combines with other AWS services: