Using Workflow Studio in Application Composer to build Step Functions workflows - AWS Step Functions

Using Workflow Studio in Application Composer to build Step Functions workflows

Workflow Studio is available in Application Composer to help you design and build your workflows. Workflow Studio in Application Composer provides a visual infrastructure as code (IaC) environment that makes it easy for you to incorporate workflows in your serverless applications built using IaC tools, such as CloudFormation templates.

AWS Application Composer is a visual builder that helps you develop AWS SAM and AWS CloudFormation templates using a simple graphical interface. With Application Composer, you design an application architecture by dragging, grouping, and connecting AWS services in a visual canvas. Application Composer then creates an IaC template from your design that you can use to deploy your application with the AWS SAM Command Line Interface (AWS SAM CLI) or CloudFormation. To learn more about Application Composer, see What is Application Composer.

When you use Workflow Studio in Application Composer, Application Composer connects the individual workflow steps to AWS resources and generates the resource configurations in an AWS SAM template. Application Composer also adds the IAM permissions required for your workflow to run. Using Workflow Studio in Application Composer, you can create prototypes of your applications and turn them into production-ready applications.

When you use Workflow Studio in Application Composer, you can switch back and forth between the Application Composer canvas and Workflow Studio.

Using Workflow Studio in Application Composer to build a serverless workflow

  1. Open the Application Composer console and choose Create project to create a project.

  2. In the search field in the Resources palette, enter state machine.

  3. Drag the Step Functions State machine resource onto the canvas.

  4. Choose Edit in Workflow Studio to edit your state machine resource.

    The following animation shows how you can switch to the Workflow Studio for editing your state machine definition.

    An animation that illustrates how you can use Workflow Studio in Application Composer.

    The integration with Workflow Studio to edit state machines resources created in Application Composer is only available for AWS::Serverless::StateMachine resource. This integration is not available for templates that use the AWS::StepFunctions::StateMachine resource.

Dynamically reference resources using CloudFormation definition substitutions in Workflow Studio

In Workflow Studio, you can use CloudFormation definition substitutions in your workflow definition to dynamically reference resources that you've defined in your IaC template. You can add placeholder substitutions to your workflow definition using the ${dollar_sign_brace} notation and they are replaced with actual values during the CloudFormation stack creation process. For more information about definition substitutions, see DefinitionSubstitutions in AWS SAM templates.

The following animation shows how you can add placeholder substitutions for the resources in your state machine definition.

Animation showing how to add placeholder substitutions for resources in your state machine.

Connect service integration tasks to enhanced component cards

You can connect the tasks that call optimized service integrations to enhanced component cards in Application Composer canvas. Doing this automatically maps any placeholder substitutions specified by the ${dollar_sign_brace} notation in your workflow definition and the DefinitionSubstitution property for your StateMachine resource. It also adds the appropriate AWS SAM policies for the state machine.

If you map optimized service integration tasks with standard component cards, the connection line doesn't appear on the Application Composer canvas.

The following animation shows how you can connect an optimized task to an enhanced component card and view the changes in Change Inspector.

Animation showing how to connect tasks and optimized service integrations.

You can't connect AWS SDK integrations in your Task state with enhanced component cards or optimized service integrations with standard component cards. For these tasks, you can map the substitutions in the Resource properties panel in Application Composer canvas, and add policies in the AWS SAM template.

Tip

Alternatively, you can also map placeholder substitutions for your state machine under Definition Substitutions in the Resource properties panel. When you do this, you must add the required permissions for the AWS service your Task state calls in the state machine execution role. For information about permissions your execution role might need, see Set up execution roles with Workflow Studio in Step Functions.

The following animation shows how you can manually update the placeholder substitution mapping in the Resource properties panel.

Animation showing how to update placeholder substitution mapping in the resource properties panel.

Import existing projects and sync them locally

You can open existing CloudFormation and AWS SAM projects in Application Composer to visualize them for better understanding and modify their designs. Using Application Composer's local sync feature, you can automatically sync and save your template and code files to your local build machine. Using the local sync mode can compliment your existing development flows. Make sure that your browser supports the File System Access API, which allows web applications to read, write, and save files in your local file system. We recommend using either Google Chrome or Microsoft Edge.

Unavailable Workflow Studio features in AWS Application Composer

When you use Workflow Studio in Application Composer, some of the Workflow Studio features are unavailable. In addition, the API Parameters section available in the Inspector panel panel supports CloudFormation definition substitutions. You can add the substitutions in the Code mode using the ${dollar_sign_brace} notation. For more information about this notation, see DefinitionSubstitutions in AWS SAM templates.

The following list describes the Workflow Studio features that are unavailable when you use Workflow Studio in Application Composer:

  • Starter templates – Starter templates are ready-to-run sample projects that automatically create the workflow prototypes and definitions. These templates deploys all the related AWS resources that your project needs to your AWS account.

  • Config mode – This mode lets you manage the configuration of your state machines. You can update your state machine configurations in your IaC templates or use the Resource properties panel in Application Composer canvas. For information about updating configurations in the Resource properties panel, see Connect service integration tasks to enhanced component cards.

  • TestState API

  • Option to import or export workflow definitions from the Actions dropdown button in Workflow Studio. Instead, from the Application Composer menu, select Open > Project folder. Make sure that you've enabled the local sync mode to automatically save your changes in the Application Composer canvas directly to your local machine.

  • Execute button. When you use Workflow Studio in Application Composer, Application Composer generates the IaC code for your workflow. Therefore, you must first deploy the template. Then, run the workflow in the console or through the AWS Command Line Interface (AWS CLI).