Create a state machine in Step Functions - AWS Step Functions

Create a state machine in Step Functions

You will create a state machine prototype for your credit card processing workflow using Step Functions’ Workflow Studio.

You’ll add all of the API actions and states from the Actions and Flow tabs using drag and drop in Workflow Studio. In the following topics, you'll define the conditions for the choice state, create your Lambda functions to process data, and configure all of the states in the workflow.

A Step Functions workflow diagram showing the steps of a credit card application process.
To create the state machine prototype
  1. Open the Step Functions console and choose Create state machine.

  2. In the Choose a template dialog box, select Blank.

  3. Choose Select to open Workflow Studio in Design mode.

To add actions to your workflow
  1. In Workflow Studio, from the Actions tab, drag an AWS Lambda Invoke API action and drop it to the empty state labelled Drag first state here. In the Configuration tab, for State name, enter Get credit limit.

  2. From the Flow tab, drag and drop a Choice state below the Get credit limit state. Rename the Choice state to Determine if credit limit >= 5000?.

  3. Drag and drop the following states as branches of the Choice state:

    1. Amazon SNS Publish – From the Actions tab, drag and drop the Amazon SNS Publish API action. Rename this state to Wait for human approval.

    2. Pass state — From the Flow tab, drag and drop the Pass state. Rename this branch to Auto-approve limit.

    3. Drag and drop a Pass state below the Wait for human approval state. Rename this Pass state to Credit limit approved.

  4. Add a Parallel state after the Choice state, configured as follows:

    1. Drop the Parallel state after the Credit limit approved state.

    2. Rename the Parallel state to Verify applicant's identity and address.

    3. Under both the branches of the Parallel state, drag and drop a Lambda Invoke API action.

    4. Rename the Lambda states to: Verify identity and Verify address

    5. Choose the Auto-approve limit state and for Next state, select Verify applicant's identity and address.

  5. Drag a DynamoDB Scan state and drop it below the Verify applicant's identity and address state. Rename the DynamoDB Scan state to Get list of credit bureaus.

  6. Drag and drop a Map state after the Get list of credit bureaus state. Configure the Map state as follows:

    1. Rename it to Get scores from all credit bureaus.

    2. For Processing mode, keep the default selection of Inline.

    3. Drag and drop an AWS Lambda Invoke API action to the empty state labelled Drop state here.

    4. Rename the AWS Lambda Invoke state to Get all scores.

Next steps

Now that you have a workflow prototype, you will learn how to set up and configure the resources. In the next section, Integrate a service, you will integrate a Lambda function into your workflow.