What is Step Functions? - AWS Step Functions (original) (raw)

With AWS Step Functions, you can create workflows, also called State machines, to build distributed applications, automate processes, orchestrate microservices, and create data and machine learning pipelines.

Step Functions is based on state machines and tasks. In Step Functions, state machines are called workflows, which are a series of event-driven steps. Each step in a workflow is called a state. For example, a Task state represents a unit of work that another AWS service performs, such as calling another AWS service or API. Instances of running workflows performing tasks are called executions in Step Functions.

The work in your state machine tasks can also be done using Activities which are workers that exist outside of Step Functions.

Illustrative example of a Step Functions workflow diagram.

In the Step Functions' console, you can visualize, edit, and debug your application’s workflow. You can 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 have Step Functions control AWS services, such as AWS Glue, to create extract, transform, and load workflows. You also can create long-running, automated workflows for applications that require human interaction.

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

Standard and Express workflows types

Step Functions has two workflow types:

Standard workflows Express workflows
2,000 per second execution rate 100,000 per second execution rate
4,000 per second state transition rate Nearly unlimited state transition rate
Priced by state transition Priced by number and duration of executions
Show execution history and visual debugging Show execution history and visual debugging based onlog level
See execution history in Step Functions Send execution history to CloudWatch
Support integrations with all services.Support optimized integrations with some services. Support integrations with all services.
Support Request Response pattern for all servicesSupport Run a Job and/or Wait for Callback patterns in specific services (see following section for details) Support _Request Response_pattern for all services

For more information on Step Functions pricing and choosing workflow type, see the following:

Integrating with other services

Step Functions integrates with multiple AWS services. To call other AWS services, you can use two integration types:

To combine Step Functions with other services, there are three service integration patterns:

Standard Workflows and Express Workflows support the same integrations but not the same integration patterns.

To help decide between the two types, see Choosing workflow type in Step Functions.

AWS SDK integrations in Step Functions

Integrated service Request Response Run a Job - .sync Wait for Callback - .waitForTaskToken
Over two hundred services Standard & Express Not supported Standard

Optimized integrations in Step Functions

Example use cases for workflows

Step Functions manages your application's components and logic, so you can write less code and focus on building and updating your application quickly. The following image shows six use cases for Step Functions workflows.

Visual examples of six common workflow use cases, described in the following text.

  1. Orchestrate tasks – You can create workflows that orchestrate a series of tasks, or steps, in a specific order. For example, Task A might be a Lambda function which provides inputs for another Lambda function in Task B. The last step in your workflow provides the final result.
  2. Choose tasks based on data – Using a [Choice](./state-choice.html) state, you can have Step Functions make decisions based on the state’s input. For example, imagine that a customer requests a credit limit increase. 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.
  3. Error handling (Retry /Catch) – You can retry failed tasks, or catch failed tasks and automatically run alternative steps.
    For example, after a customer requests a username, perhaps the first call to your validation service fails, so your workflow may retry the request. When the second request is successful, the workflow can proceed.
    Or, perhaps the customer requested a username that is invalid or unavailable, aCatch statement could lead to a Step Functions workflow step that suggests an alternative username.
    For examples of Retry and Catch, see Handling errors in Step Functions workflows.
  4. Human in the loop – Step Functions can include human approval steps in the workflow. For example, imagine a banking customer attempts to send funds to a friend. With a callback and a task token, you can have Step Functions wait until the customers friend confirms the transfer, and then Step Functions will continue the workflow to notify the banking customer that the transfer has completed.
    For an example, see Create a callback pattern example with Amazon SQS, Amazon SNS, and Lambda.
  5. Process data in parallel steps – Using a[Parallel](./state-parallel.html) state, Step Functions can process input data in parallel steps. For example, a customer might need to convert a video file into several display resolutions, so viewers can watch the video on multiple devices. Your workflow could send the original video file to several Lambda functions or use the optimized AWS Elemental MediaConvert integration to process a video into multiple display resolutions at the same time.
  6. Dynamically process data elements – Using a[Map](./state-map.html) state, Step Functions can run a set of workflow steps on each item in a dataset. The iterations run in parallel, which makes it possible to process a dataset quickly. For example, when your customer orders thirty items, your system needs to apply the same workflow to prepare each item for delivery. After all items have been gathered and packaged for delivery, the next step might be to quickly send your customer a confirmation email with tracking information.
    For an example starter template, seeProcess data with a Map.