Tutorial 1: Create the prototype for your state machine
In this tutorial, you create the prototype for your credit card processing workflow using Step Functions’ Workflow Studio. You’ll choose the required API actions and states from the Actions and Flow tabs respectively, and use the drag and drop feature of Workflow Studio to create the workflow prototype. In the subsequent tutorials, you’ll learn how to configure the Amazon Web Services and the Step Functions’ states you’ll be using in this workflow.
To create the state machine prototype
-
Open the Step Functions console
and choose Create state machine. -
In the Choose a template dialog box, select Blank.
-
Choose Select. This opens Workflow Studio in Design mode.
-
In Workflow Studio, from the Actions tab, drag an Amazon Lambda Invoke API action and drop it to the empty state labelled Drag first state here. Configure it as follows:
-
In the Configuration tab, for State name, enter
Get credit limit
.
-
-
From the Flow tab, drag and drop a Choice state below the Get credit limit state. Rename the Choice state to
Credit applied >= 5000?
. -
Drag and drop the following states as branches of the Credit applied >= 5000? state.
-
Amazon SNS Publish – From the Actions tab, drag and drop the Amazon SNS Publish API action. Rename this state to
Wait for human approval
. -
Pass state — From the Flow tab, drag and drop the Pass state. Rename this branch to
Auto-approve limit
.
-
-
Drag and drop a Pass state below the Wait for human approval state. Rename this Pass state to
Credit limit approved
. -
Drag and drop a Parallel state after the Choice state as follows:
Drop the Parallel state after the Credit limit approved state.
-
Rename the Parallel state to
Verify applicant's identity and address
. -
Under both the branches of the Parallel state, drag and drop two Amazon Lambda Invoke API actions.
-
Rename these states as
Verify identity
andVerify address
respectively. Choose the Auto-approve limit state and for Next state, select Verify applicant's identity and address.
-
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
. -
Drag and drop a Map state after the Get list of credit bureaus state. Configure the Map state as follows:
Rename it to
Get scores from all credit bureaus
.For Processing mode, keep the default selection of Inline.
Drag and drop an Amazon Lambda Invoke API action to the empty state labelled Drop state here.
Rename the Amazon Lambda Invoke state to
Get all scores
.
-
Keep this window open and proceed to the next tutorial for further actions.
Next steps
In the next tutorial, you learn how to integrate the Lambda function used by the Get credit limit state.