Combine Standard and Express Workflows by running a mock e-commerce workflow that does selective checkpointing (Nested workflows). Deploying this sample project creates a Standard workflows state machine, a nested Express Workflows state machine, an AWS Lambda function, an Amazon Simple Queue Service (Amazon SQS) queue, and an Amazon Simple Notification Service (Amazon SNS) topic.
Browse through this example state machine to see how Step Functions processes input from Amazon SQS and Amazon SNS, and then uses a nested Express Workflows state machine to update backend systems.
The child state machine in this sample project updates backend information when called by the parent state machine.
- Create an AWS account if you do not already have one and log in. The IAM user that you use must have sufficient permissions to make necessary AWS service calls and manage AWS resources.
- AWS CLI installed and configured
- Git Installed
- AWS CDK Installed
-
If this is your first time using AWS CDK, bootstrap your environment.
cdk bootstrap aws://{your-aws-account-number}/{your-aws-region}
-
Create a new directory, navigate to that directory in a terminal and clone the GitHub repository:
git clone https://github.com/aws-samples/step-functions-workflows-collection
-
Change directory to the pattern directory:
cd selective-checkpointing-cdk/typescript
-
From the command line, use npm to install dependencies and run the build process.
npm install npm run build
-
From the command line, use CDK to deploy the AWS resources for the workflow as specified in the
index.ts
file:cdk deploy
- Deploy the State Machine via CDK using the instructions above.
- Start an execution of the parent state machine. You should be able to trace the parent workflow from start to finish including the child workflow illustrating the update to backend systems.
To delete the resources created by this template:
-
Delete the stack
cdk destroy
-
During the prompts:
Are you sure you want to delete: SelectiveCheckpointingStack (y/n)? Y
Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0