AWS Step Function Tutorial

Prakash AgrawalPrakash Agrawal
2 min read

In this tutorial we will execute the following steps for AWS Step Functions

a. Create a Step Functions State machine

  1. Search for Step Functions in AWS console and select the Step Functions

AWS Step Functions is a visual workflow service that helps developers use AWS services to build distributed applications, automate processes, orchestrate microservices, and create data and machine learning (ML) pipelines.

  1. Select State Machines from the menu on the left side

  1. Click on the button on the right, button is Create state machine

  1. Select a Blank Template on the next screen, then select Code button on the top to type in the below code and build a simple State Machine.

    Providing code here that can be copied:

     {
       "Comment": "A Hello World Example of Amazon States using Pass States",
       "StartAt": "Hello",
       "States": {
         "Hello": {
           "Type": "Pass",
           "Result": "Hello",
           "Next": "World"
         },
         "World": {
           "Type": "Pass",
           "Result": "World",
           "End": true
         }
       }
     }
    

  1. Click on the Create button on top right of the screen

  1. AWS will automatically create roles and permissions required for state machine execution and ask for confirmation:

  1. AWS will create State Machine and IAM role successfully and show success messages:

b. Start a new Execution

  1. After the state machine is created, click on the button Start Execution:

  1. In the next pop-up screen, you can enter new name for the execution or keep the name generated by AWS and click on Start execution.

  1. As the execution starts AWS will show the message that Execution started successfully

  1. In the event view you will see that Execution completed successfully.

c. Update the Step Function state machine

  1. Click on the button for Edit State machine

  1. Click on the button for Code

  1. Change the code as shown for the World state:

  1. Choose the Save button

  1. Click on the Execute button

  1. In the Graph view select World and see the Output section on right, you will see the updated output.

7. Clean up the resources after the State Machine execution, select the State Machine and click on the Delete button to delete the same.

This completes a simple Step Function and State Machine tutorial.

About me: I am an independent technical writer and if you are an organization that want to hire me then I can be contacted at techonlinewriter@gmail.com.

0
Subscribe to my newsletter

Read articles from Prakash Agrawal directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Prakash Agrawal
Prakash Agrawal