Orchestrating AWS resources with AWS Step Functions - AWS Serverless Application Model

Orchestrating AWS resources with AWS Step Functions

You can use AWS Step Functions to orchestrate AWS Lambda functions and other AWS resources to form complex and robust workflows.


To manage AWS SAM templates that contain Step Functions state machines, you must use version 0.52.0 or later of the AWS SAM CLI. To check which version you have, execute the command sam --version.

Step Functions is based on the concepts of tasks and state machines. You define state machines using the JSON-based Amazon States Language. The Step Functions console displays a graphical view of your state machine's structure so you can visually check your state machine's logic and monitor executions.

With Step Functions support in AWS Serverless Application Model (AWS SAM), you can do the following:

  • Define state machines, either directly within an AWS SAM template or in a separate file

  • Create state machine execution roles through AWS SAM policy templates, inline policies, or managed policies

  • Trigger state machine executions with API Gateway or Amazon EventBridge events, on a schedule within an AWS SAM template, or by calling APIs directly

  • Use available AWS SAM Policy Templates for common Step Functions development patterns.


The following example snippet from a AWS SAM template file defines a Step Functions state machine in a definition file. Note that the my_state_machine.asl.json file must be written in Amazon States Language.

AWSTemplateFormatVersion: "2010-09-09" Transform: AWS::Serverless-2016-10-31 Description: Sample SAM template with Step Functions State Machine Resources: MyStateMachine: Type: AWS::Serverless::StateMachine Properties: DefinitionUri: statemachine/my_state_machine.asl.json ...

To download a sample AWS SAM application that includes a Step Functions state machine, see Create a Step Functions State Machine Using AWS SAM in the AWS Step Functions Developer Guide.

More information

To learn more about Step Functions and using it with AWS SAM, see the following: