Running Step Functions Local on Your Computer - Amazon Step Functions
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Running Step Functions Local on Your Computer

Use the local version of Step Functions to configure, develop and test state machines on your computer.

Run a HelloWorld state machine locally

After you run Step Functions locally with the Amazon Command Line Interface (Amazon CLI), you can start a state machine execution.

  1. Create a state machine from the Amazon CLI by escaping out the state machine definition.

    aws stepfunctions --endpoint-url http://localhost:8083 create-state-machine --definition "{\ \"Comment\": \"A Hello World example of the Amazon States Language using a Pass state\",\ \"StartAt\": \"HelloWorld\",\ \"States\": {\ \"HelloWorld\": {\ \"Type\": \"Pass\",\ \"End\": true\ }\ }}" --name "HelloWorld" --role-arn "arn:aws:iam::012345678901:role/DummyRole"
    Note

    The role-arn is not used for Step Functions Local, but you must include it with the proper syntax. You can use the Amazon Resource Name (ARN) from the previous example.

    If you successfully create the state machine, Step Functions responds with the creation date and the state machine ARN.

    { "creationDate": 1548454198.202, "stateMachineArn": "arn:aws:states:us-east-1:123456789012:stateMachine:HelloWorld" }
  2. Start an execution using the ARN of the state machine you created.

    aws stepfunctions --endpoint-url http://localhost:8083 start-execution --state-machine-arn arn:aws:states:us-east-1:123456789012:stateMachine:HelloWorld

Step Functions Local with Amazon SAM CLI Local

You can use the local version of Step Functions with a local version of Amazon Lambda. To configure this, you must install and configure Amazon SAM.

For information about configuring and running Amazon SAM, see the following:

When Lambda is running on your local system, you can start Step Functions Local. From the directory where you extracted your Step Functions local JAR files, start Step Functions Local and use the --lambda-endpoint parameter to configure the local Lambda endpoint.

java -jar StepFunctionsLocal.jar --lambda-endpoint http://127.0.0.1:3001 command

For more information about running Step Functions Local with Amazon Lambda, see Tutorial: Testing workflows using Step Functions and Amazon SAM CLI Local.