Getting Started with Step Functions - AWS Step Functions

Getting Started with Step Functions

This tutorial introduces you to the basics of working with AWS Step Functions.

To get started, you create a simple, independently running state machine using two Pass states. A Pass state represents a no-op (an instruction with no operation).

Step Functions offers various predefined state machines as templates. Create your first state machine using the Hello World template.

Create a State Machine

  1. Sign in to the AWS Management Console and open the Step Functions console at

  2. On the Define state machine page, choose Start with a template, and then choose Hello world.

            Hello world.
  3. Under Type, choose Standard, then review the State machine definition and the visual workflow.


    You cannot change the state machine type (Standard or Express) once it is created. For more information about the differences between Standard and Express Workflows, see Standard vs. Express Workflows.

    Step Functions fills in the name of the state machine automatically. It also populates the Code pane with the Amazon States Language description of the state machine.

    The following JSON text defines two Pass states. The first is named Hello, and the second is named World. For more information, see State Machine Structure.

    { "Comment": "A Hello World example of the Amazon States Language using Pass states", "StartAt": "Hello", "States": { "Hello": { "Type": "Pass", "Result": "Hello", "Next": "World" }, "World": { "Type": "Pass", "Result": "World", "End": true } } }
  4. Use the graph in the Visual Workflow pane to check that your Amazon States Language code describes your state machine correctly.

    If you don't see the graph, choose 
    in the Visual Workflow pane.

            Visual Workflow.
  5. Choose Next.

  6. Create or enter an IAM role:

    • To create an IAM role for Step Functions, select Create an IAM role for me, and enter a Name for your role.

    • If you have previously created an IAM role with the correct permissions for your state machine, select Choose an existing IAM role. Select a role from the list, or provide an ARN for that role.


    If you delete the IAM role that Step Functions creates, Step Functions can't recreate it later. Similarly, if you modify the role (for example, by removing Step Functions from the principals in the IAM policy), Step Functions can't restore its original settings later.

  7. Choose Create state machine.

Start a New Execution

After you create your state machine, you can start an execution.

  1. On the Helloworld page, choose Start execution.

  2. (Optional) To help identify your execution, you can specify an ID for it in the Enter an execution name box. If you don't enter an ID, Step Functions generates a unique ID automatically.


    Step Functions allows you to create state machine, execution, and activity names that contain non-ASCII characters. These non-ASCII names don't work with Amazon CloudWatch. To ensure that you can track CloudWatch metrics, choose a name that uses only ASCII characters.

  3. On the New execution page, choose Start execution.

    A new execution of your state machine starts, and a new page showing your running execution is displayed.

  4. (Optional) In the Execution Details section, choose the Info tab to view the Execution Status and the Started and Closed timestamps.

  5. To view the results of your execution, choose the Output tab.

            State machine results.

Update a State Machine

You can update your state machine for future executions.


State machine updates in Step Functions are eventually consistent. After a few seconds, all newly started executions will use the updated definition and roleArn. Executions started immediately after updating a state machine can use the previous state machine definition and roleArn. Executions that were already running will run to completion with the definition and roleArn that they were started with.

  1. On the Helloworld page, choose Edit state machine.

  2. In the Code pane on the Edit page, edit the Amazon States Language description of the state machine. Update the second Result to read World has been updated!

    { "Comment": "A Hello World example of the Amazon States Language using Pass states", "StartAt": "Hello", "States": { "Hello": { "Type": "Pass", "Result": "Hello", "Next": "World" }, "World": { "Type": "Pass", "Result": "World has been updated!", "End": true } } }
  3. (Optional) Select a new AWS Identity and Access Management (IAM) role from the IAM role for executions list.


    You can also choose Create new role to create an IAM role. For more information, see How AWS Step Functions Works with IAM.

  4. Choose Save, and then choose Start execution.

  5. On the New execution page, choose Start Execution.

  6. To view the results of your execution, select the HelloWorld state in the Visual workflow, and expand the Output section under Step details.

            Execution output

    The output text matches your newly updated state machine.

Next Steps

Now that you've created a simple state machine using Pass states, try the following: