AWS Step Functions
Cloud service · AWS · Updated

AWS Step Functions

In short

AWS Step Functions is a cloud service from Amazon Web Services that enables developers to coordinate multiple AWS services into serverless workflows, allowing the creation and execution of complex business processes and applications through visual workflows.

Cloud Services Hub →

12 key features of AWS Step Functions

AWS Step Functions is a cloud service that coordinates multiple AWS services into serverless workflows, allowing for the visual orchestration of complex, multi-step applications through a graphical interface and providing state management, error handling, and parallel execution capabilities.

01
Visual Workflows

AWS Step Functions provides a visual workflow editor that allows you to design and visualize your application's components as a series of steps. This makes it easier to understand, create, and modify complex processes.

02
Serverless Orchestration

Enables you to orchestrate microservices, serverless applications, and workflows without worrying about the infrastructure. Step Functions automatically triggers and scales your functions or services in response to events or step completions.

03
Built-in Error Handling

Offers several options for handling errors, including retries, catching errors, and implementing fallback paths. This ensures your workflows are robust and can handle unexpected failures gracefully.

04
Integration with AWS Services

Provides seamless integration with various AWS services such as Lambda, Amazon SNS, Amazon SQS, and Amazon DynamoDB, allowing you to build complex workflows that interact with these services without writing additional code.

05
Synchronous and Asynchronous Execution

Supports both synchronous and asynchronous execution of workflows. You can wait for a workflow to complete and get an immediate response, or you can check the execution status at a later time, providing flexibility in how you handle workflow execution.

06
State Management

Automatically tracks the state of each step in your workflow, allowing you to pause, resume, and retry steps as needed. This state management capability ensures the integrity and reliability of your application's processes.

07
High Availability and Scalability

Built on AWS’s highly available and scalable infrastructure, Step Functions automatically scales to meet the demands of your application, ensuring that your workflows can handle high volumes of transactions without manual intervention.

08
Cost-effective

Standard Workflows are charged for state transitions rather than idle time; Express Workflows are charged for workflow requests and execution duration.

09
Activity Workers

Workflow tasks can be performed by activity workers that run outside Step Functions.

10
AWS SDK and Optimized Integrations

AWS SDK integrations call AWS service APIs directly from a state machine, while optimized integrations streamline calls and data exchange for selected services, such as automatically converting a Lambda Invoke response's Payload from an escaped JSON string into a JSON object.

11
Workflow Redrive

The Step Functions API supports redriving workflows.

12
Distributed Map

A Distributed Map Run supports up to 10,000 parallel child executions, a hard quota.

Where AWS Step Functions is used

AWS Step Functions orchestrates complex, multi-step workflows and applications, including data processing, web application back-ends, and serverless microservice orchestration.

  1. 01
    Orchestration of Microservices

    AWS Step Functions can be used to orchestrate microservices for complex applications. By defining workflows that coordinate the execution of different microservices, developers can ensure that services are invoked in the correct order, manage error handling, and maintain transaction integrity across distributed systems.

  2. 02
    Data Processing Pipelines

    Leverage AWS Step Functions to create robust, scalable data processing pipelines. Users can design workflows to automate the movement and transformation of data between various AWS services, such as Amazon S3, Amazon DynamoDB, and AWS Lambda, facilitating batch processing, stream processing, and ETL tasks.

  3. 03
    Serverless Application Workflows

    AWS Step Functions is ideal for orchestrating serverless application workflows. By managing the execution order and state of serverless functions (like those deployed on AWS Lambda), developers can build complex applications without worrying about the underlying infrastructure, improving scalability and reducing costs.

  4. 04
    Automated IT and DevOps Tasks

    Automate IT and DevOps tasks using AWS Step Functions. This includes tasks such as infrastructure provisioning with AWS CloudFormation, code deployments using AWS CodeDeploy, and automated testing. This automation ensures consistent, repeatable processes that can help reduce human error and save time.

  5. 05
    Machine Learning Workflows

    Organize and manage machine learning workflows with AWS Step Functions. This involves automating the various stages in a machine learning pipeline, including data preparation, model training, evaluation, and deployment. By coordinating these tasks, users can more efficiently manage model updates and deployments, while keeping track of the versioning and execution status of different components.

How AWS Step Functions is priced

AWS Step Functions pricing is primarily based on the number of state transitions executed, with different rates for standard and express workflows, and optional additional charges for integrations and other features.

Standard Workflows

Standard workflows are priced based on the number of state transitions. A state transition is counted each time a step executes, including retries. Pricing varies by region.

Express Workflows

Express Workflows are designed for high-volume, event-driven workloads and are priced based on the number of requests and the duration of the workflow execution. Duration runs from the start of execution until it completes or otherwise terminates, rounded up to the nearest 100ms. Duration charges also account for memory used, billed in 64-MB chunks. Pricing varies by region.

Free Tier

The Step Functions Free Tier includes 4,000 state transitions per month and is available indefinitely to both new and existing AWS customers.

Data Transfer

Workflow data transfers may incur additional charges. Invoking private endpoints through AWS PrivateLink and Amazon VPC Lattice incurs their standard data-transfer charges.

Services AWS Step Functions works with

Amazon API GatewayAmazon API Gateway

Step Functions can invoke API Gateway endpoints from workflow tasks, including passing a task token for callback-based processing. API Gateway can also expose an endpoint that starts a state machine execution.

Amazon AppFlowAmazon AppFlow

Step Functions can start AppFlow flows through its AWS SDK integration and check flow execution records before continuing with downstream processing.

Amazon AthenaAmazon Athena

Step Functions can start Athena queries, wait for query completion, and retrieve results through its optimized integration.

Amazon Augmented AI (Amazon A2I)Amazon Augmented AI (Amazon A2I)

Step Functions can start human review loops through the Augmented AI runtime API and check their status, coordinating manual review with automated processing.

Amazon AuroraAmazon Aurora

Step Functions can execute SQL against supported Aurora clusters through the RDS Data API. Workflows can also use RDS API operations to manage clusters and snapshots.

Amazon Aurora ServerlessAmazon Aurora Serverless

Step Functions can use the RDS Data API to execute SQL statements and manage transactions on Aurora Serverless configurations that support the Data API.

Amazon Bedrock

Step Functions provides optimized integrations for invoking Bedrock models and creating model customization jobs. Workflows can coordinate inference with validation, retries, and downstream processing.

Amazon Bedrock AgentCore

Step Functions provides an optimized integration for invoking agents hosted in Bedrock AgentCore Runtime, allowing agent responses to become inputs to subsequent workflow steps.

Amazon BraketAmazon Braket

Step Functions can create Braket quantum tasks or hybrid jobs through AWS SDK integrations and poll their status before processing results.

What is AWS Step Functions

3 min read

AWS Step Functions is a cloud service provided by Amazon Web Services that orchestrates various AWS services, allowing developers to design and execute serverless workflows. This service is particularly essential for automating complex processes that involve multiple AWS services, enabling tasks that can range from simple to highly complex, to be carried out in a seamless, scalable, and reliable manner. 

Its capabilities are a boon for developers looking to implement applications that need to handle long-running processes, with tasks that may involve conditional logic, parallel processing, and state management. 

At the core of AWS Step Functions is the concept of state machines. A state machine is a model of computation that consists of a set of states, actions, and transitions. States represent the status of the workflow at any point in time, while transitions define the path from one state to another based on the output of actions executed in the current state. This model allows Step Functions to keep track of the execution state of each workflow, pause and resume tasks as needed, and execute steps in a defined order or in parallel, based on the logic defined within the state machine. 

A state machine definition has a hard size limit of 1 MB.

One of the key advantages of using AWS Step Functions is its ability to handle error scenarios gracefully. It provides built-in support for retry policies, error handling, and timeout configurations, which are critical for building robust and resilient applications. Moreover, the service integrates seamlessly with various AWS services such as AWS Lambda, Amazon SNS, Amazon SQS, and Amazon DynamoDB, among others, thereby allowing a wide range of tasks to be executed as part of the workflows. These tasks can include running code, sending notifications, writing to databases, and much more, without the need to manage the underlying infrastructure. 

Step Functions can invoke endpoints in private networks, including Amazon VPCs, through integrations with AWS PrivateLink and Amazon VPC Lattice.

AWS Step Functions also offers a visual interface where developers can define, visualize, and test their workflows. This interface makes it simpler to understand the flow of operations, identify potential issues, and make necessary adjustments swiftly. The visual aspect, combined with the ability to define workflows as code using JSON, makes Step Functions a versatile tool for both visual thinkers and those who prefer to write code. In addition to providing a powerful orchestration capability, AWS Step Functions also offers detailed logging and monitoring features. It integrates with Amazon CloudWatch to provide real-time monitoring of workflows, including execution history, performance metrics, and operational health. This visibility is crucial for diagnosing issues, optimizing performance, and ensuring that workflows are running as expected. 

AWS Step Functions is a managed service, which means AWS handles the scaling, high availability, and maintenance of the underlying infrastructure. This enables developers to focus on building and refining their applications instead of managing servers or clusters. Step Functions offers Standard Workflows, charged by the number of state transitions, and Express Workflows, charged by workflow requests and execution duration. 

The default quota for open executions is 1,000,000 per AWS account per Region and can be increased. Exceeding it causes an ExecutionLimitExceeded error; this quota does not apply to Express Workflows.

In summary, AWS Step Functions is a powerful service for building and running serverless workflows on AWS. Its support for complex workflows, integration with other AWS services, visual workflow definition, robust error handling, and detailed monitoring capabilities make it an essential tool for developers looking to automate tasks and orchestrate multi-step processes in the cloud.

Concepts related to AWS Step Functions

AWS Step Functions exam questions

Real practice exam questions on AWS Step Functions, with the correct answer and its explanation. Answer them with every option in the exam simulator.

AIB-C01

A retailer uses generative AI to draft product descriptions. An independent validation service checks each draft against approved product specifications before publication. Failed drafts are automatically returned to the model for revision. During a pilot, some descriptions repeatedly fail validation, creating long-running revision loops and unpredictable costs. Leadership requires a maximum of three automated revision attempts, followed by a merchandising specialist’s decision if validation still fails. A description that fails validation must never be published automatically. Which workflow design BEST meets these requirements?

Show answerCORRECT ANSWER

Use an AWS Step Functions workflow to track revision attempts and branch on validation results. After three unsuccessful revisions, pause for a specialist’s disposition. Publish only a validated description or a specialist-approved replacement, and escalate overdue reviews without publishing.

Step Functions can maintain attempt counts, evaluate conditions, and wait for a human decision. This design bounds automated revisions, makes human intervention mandatory when the limit is reached, and prevents unresolved descriptions from being published.

MLA-C02

A company runs a high-volume ML inference pipeline as an AWS Step Functions Express workflow. The workflow validates records, invokes a model, and routes predictions to downstream systems. Some predictions reach the wrong destination even though the workflow executions succeed. An ML engineer needs to investigate the sequence of states and routing decisions for both successful and failed executions, with diagnostic records retained for 14 days. Company policy prohibits storing workflow input and output payloads in monitoring logs because they contain sensitive customer features.

Which solution meets these requirements with the LEAST operational overhead?

Show answerCORRECT ANSWER

Configure workflow logging to Amazon CloudWatch Logs at the ALL level, disable inclusion of execution data, and set the log group's retention period to 14 days.

ALL-level logging captures events for normal state transitions as well as failures, allowing engineers to investigate workflow paths and correlate events by execution. Disabling inclusion of execution data excludes input and output payloads while retaining execution metadata. CloudWatch Logs provides managed retention, which is particularly useful because Express workflows do not retain execution history in Step Functions.

SAP-C03

A company publishes custom operational events to an Amazon EventBridge event bus. Events with a detail-type of Fleet Remediation Requested identify a tag value that selects affected Amazon EC2 instances. Other events on the bus must not initiate remediation. A tested AWS Systems Manager Automation runbook repairs and validates one instance.

Each selected fleet contains between 200 and 2,000 instances, always in multiples of 100. For each incident, the configured concurrency ceiling must automatically equal 5% of the selected fleet, without maintaining fleet-specific settings. Systems Manager must stop dispatching remediation to additional instances after the first failed instance-level execution is reported. Executions already in progress must be allowed to finish, even if additional failures occur. The company does not want to implement a custom dispatch queue.

Which solution meets these requirements?

Show answerCORRECT ANSWER

Create an EventBridge rule that matches the required detail-type and starts a Step Functions workflow. Have the workflow call Systems Manager StartAutomationExecution with tag-based Targets, the instance-ID TargetParameterName, MaxConcurrency set to "5%", and MaxErrors set to "0". Allow running executions to finish.

EventBridge filters the incident events and starts the workflow. The workflow supplies Systems Manager Automation's native fleet-dispatch settings. MaxConcurrency of 5% automatically sets the required ceiling for each selected fleet. MaxErrors of 0 stops further dispatch after the first reported failure, but does not terminate executions already in progress. Those executions can finish and can produce additional failures.

Practice AWS Step Functions in a full exam

Questions on AWS Step Functions in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

Learn AWS Step Functions in lessons

27 short lessons on AWS Step Functions in 10 certification courses.

and 21 more lessons

Open the lessons

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.