Cost-optimization using Express Workflows - 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.

Cost-optimization using Express Workflows

Step Functions determines pricing for Standard and Express workflows based on the workflow type you use to build your state machines. To optimize the cost of your serverless workflows, you can follow either or both of the following recommendations:

For information about how choosing a Standard or Express workflow type affects billing, see Amazon Step Functions Pricing.

Tip #1: Nesting Express workflows inside Standard workflows

Step Functions runs workflows that have a finite duration and number of steps. Some workflows may complete execution within a short period of time. Others may require a combination of both long-running and high-event-rate workflows. With Step Functions, you can build large, complex workflows out of multiple smaller, simpler workflows.

For example, to build an order processing workflow, you can include all non-idempotent actions into a Standard workflow. This could include actions, such as approving order through human interaction and processing payments. You can then combine a series of idempotent actions, such as sending payment notifications and updating product inventory, in an Express workflow. You can nest this Express workflow within the Standard workflow. In this example, the Standard workflow is known as the parent state machine. The nested Express workflow is known as a child state machine.

Tip #2: Convert Standard workflows into Express workflows

You can convert your existing Standard workflows into Express workflows if they meet the following requirements:

  • The workflow must complete its execution within five minutes.

  • The workflow conforms to an at-least-once execution model. This means that each step in the workflow may run more than exactly once.

  • The workflow doesn't use the .waitForTaskToken or .sync service integration patterns.

Important

Express workflows use Amazon CloudWatch Logs to record execution histories. You will incur additional costs when using CloudWatch Logs.

To convert a Standard workflow into an Express workflow using the console

  1. Open the Step Functions console.

  2. On the State machines page, choose a Standard type state machine to open it.

    Tip

    From the Any type dropdown list, choose Standard to filter the state machines list and view only Standard workflows.

  3. Choose Actions, and then choose Copy to new.

  4. On the Choose authoring method page, choose Express for Type and keep all default selections.

  5. Choose Next.

  6. (Optional) Update the workflow design, if required, and then choose Next.

  7. On the Review generated code page, choose Next.

  8. On the Specify state machine settings page, specify details for the new Express state machine, such as a name, permissions, and logging level.

    Note

    If you're converting a Standard workflow previously defined in Amazon CDK or Amazon SAM, you must change the value of Type and Resource name.

  9. Choose Create state machine.

For more information about best practices and guidelines when you manage cost-optimization for your workflows, see Building cost-effective Amazon Step Functions workflows.