Skip to content

Latest commit

 

History

History

Nested Workflows

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.

Requirements

Deployment Instructions

  1. If this is your first time using AWS CDK, bootstrap your environment.

    cdk bootstrap aws://{your-aws-account-number}/{your-aws-region}
  2. 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
  3. Change directory to the pattern directory:

    cd selective-checkpointing-cdk/typescript
  4. From the command line, use npm to install dependencies and run the build process.

    npm install
    npm run build
  5. From the command line, use CDK to deploy the AWS resources for the workflow as specified in the index.ts file:

    cdk deploy

Testing

  1. Deploy the State Machine via CDK using the instructions above.
  2. 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.

image image

Cleanup

To delete the resources created by this template:

  1. Delete the stack

    cdk destroy
  2. 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