

# Developing workflows in Step Functions Workflow Studio
<a name="workflow-studio"></a>

When editing a workflow in the AWS Step Functions console, you'll use a visual tool called Workflow Studio. With Workflow Studio, you can drag-and-drop states onto a canvas to build your workflows. You can add, edit, and configure states, set input and output filters, transform results, and set up error handling.

As you modify states in your workflow, Workflow Studio will validate and auto-generate the state machine definition. You can review the generated code, edit the configuration, and even modify the text definition with the built-in code editor. When you're finished, you can save your workflow, run it, and then examine the results.

You can access Workflow Studio from the Step Functions console, when you create or edit a workflow. 

You can also use Workflow Studio from **within** AWS Infrastructure Composer, a visual designer to create infrastructure as code with AWS Serverless Application Model and AWS CloudFormation. To discover the benefits of this approach, see [Using Workflow Studio in Infrastructure Composer](use-wfs-in-app-composer.md).

Workflow Studio has three modes: **Design**, **Code**, and **Config**. In *Design mode*, you can drag-and-drop states onto the canvas. *Code mode* provides a built-in code editor for editing your workflow definitions within the console. In *Config mode*, you can manage your workflow configuration.

**Working with Workflow Studio in Visual Studio Code**  
With the AWS toolkit, you can use Workflow Studio from within VS Code to visualize, build, and even test individual states in your state machines. You provide state inputs and set variables, start the test, then you can see how your data is transformed. You can adjust the workflow and re-test. When finished, you can apply the changes to update the state machine. For more information, see [Working with Workflow Studio](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/stepfunctions-workflowstudio.html) in the AWS Toolkit for Visual Studio Code. 

## Design mode
<a name="wfs-interface-design-mode"></a>

Design mode provides a graphical interface to visualize your workflows as you build their prototypes. The following image shows the states browser, workflow canvas, inspector, and contextual help panels in the **Design** mode of Workflow Studio.

![\[Screenshot of Design mode, showing states browser, workflow canvas, inspector, and help panels.\]](http://docs.aws.amazon.com/step-functions/latest/dg/images/wfs_main_01.png)


1. Mode buttons switch between the three modes. You cannot switch modes if your ASL workflow definition is invalid.

1. The [States browser](#workflow-studio-components-states) contains the following three tabs:
   + The **Actions** tab provides a list of AWS APIs that you can drag and drop into your workflow graph in the canvas. Each action represents a [Task workflow state](state-task.md) state.
   + The **Flow** tab provides a list of flow states that you can drag and drop into your workflow graph in the canvas.
   + The **Patterns** tab provides several ready-to-use, reusable building blocks that you can use for a variety of use cases. For example, you can use these patterns to iteratively process data in an Amazon S3 bucket.

1. The [Canvas and workflow graph](#workflow-studio-components-grapheditor) is where you drag and drop states into your workflow graph, change the order of states, and select states to configure or view.

1. The [Inspector panel](#workflow-studio-components-formdefinition) panel is where you can view and edit the properties of any state you've selected on the canvas. Turn on the **Definition** toggle to view the Amazon States Language code for your workflow, with the currently selected state highlighted. 

1. **Info** links open a panel with contextual information when you need help. These panels also include links to related topics in the Step Functions documentation. 

1. Design toolbar – Contains a set of buttons to perform common actions, such as undo, delete, and zoom in.

1. Utility buttons – A set of buttons to perform tasks, such as saving your workflows or exporting their ASL definitions in a JSON or YAML file.

### States browser
<a name="workflow-studio-components-states"></a>

From the States browser, you can select states to drag and drop on to your workflow canvas. The **Actions** tab provides a list of task states that connect to 3rd party HTTP endpoints and AWS APIs. The **Flow** tab provides a list of states with which you can direct and control your workflow. Flow states include: Choice, Parallel, Map, Pass, Wait, Success, and Fail. The **Patterns** tab provides ready-to-use, reusable pre-defined building blocks. You can search among all state types with the search box at the top of the panel.

![\[Illustrative collection of screen shots showing Actions, Flow, Patterns, and search.\]](http://docs.aws.amazon.com/step-functions/latest/dg/images/wfe-states-browser-01.png)


### Canvas and workflow graph
<a name="workflow-studio-components-grapheditor"></a>

After you choose a state to add to your workflow, you can drag it to the canvas and drop it into your workflow graph. You can also drag and drop states to move them within your workflow. If your workflow is large, you can zoom in or out to view different parts of your workflow graph in the canvas. 

### Inspector panel
<a name="workflow-studio-components-formdefinition"></a>

You can configure any states that you add to your workflow from the **Inspector** panel on the right. Choose the state you want to configure, and you will see its configuration options in the **Inspector** panel. To see the auto-generated [ASL definition](concepts-amazon-states-language.md) for your workflow code, turn on the **Definition** toggle. The ASL definition associated with the state you've selected will appear highlighted.

![\[Illustrative screenshot of Workflow Studio inspector showing configuration panel\]](http://docs.aws.amazon.com/step-functions/latest/dg/images/wfe-forms-definitions-01.png)


![\[Illustrative screenshot of Workflow Studio inspector panel showing code definition\]](http://docs.aws.amazon.com/step-functions/latest/dg/images/wfe-forms-definitions-02.png)


## Code mode
<a name="wfs-interface-code-mode"></a>

In **Code** mode of Workflow Studio, you can use an integrated code editor to view, write, and edit the [Using Amazon States Language to define Step Functions workflows](concepts-amazon-states-language.md) (ASL) definition of your workflows within the Step Functions console. The following screenshot shows the components in the **Code** mode.

![\[Illustrative screenshot of editing a workflow definition in Code mode.\]](http://docs.aws.amazon.com/step-functions/latest/dg/images/wfs-code-mode.png)


1. Mode buttons switch between the three modes. You cannot switch modes if your ASL workflow definition is invalid.

1. The [Code editor](#wfs-interface-code-editor) is where you write and edit the [ASL definition](concepts-amazon-states-language.md) of your workflows within the Workflow Studio. The code editor also provides features, such as syntax highlighting and auto-completion.

1. [Graph visualization](#wfs-interface-code-graph-viz) – Shows a real-time graphical visualization of your workflow.

1. Utility buttons – A set of buttons to perform tasks, such as saving your workflows or exporting their ASL definitions in a JSON or YAML file.

1. Code toolbar – Contains a set of buttons to perform common actions, such as undoing an action or formatting the code.

1. Graph toolbar – Contains a set of buttons to perform common actions, such as zooming in and zooming out the workflow graph.

### Code editor
<a name="wfs-interface-code-editor"></a>

The code editor provides an IDE-like experience to write and edit your workflow definitions using JSON within the Workflow Studio. The code editor includes several features, such as syntax highlighting, auto-complete suggestions, [ASL definition](concepts-amazon-states-language.md) validation, and context-sensitive help display. As you update your workflow definition, the [Graph visualization](#wfs-interface-code-graph-viz) renders a real-time graph of your workflow. You can also see the updated workflow graph in the [Design mode](#wfs-interface-design-mode).

If you select a state in the [Design mode](#wfs-interface-design-mode) or the graph visualization pane, the ASL definition of that state appears highlighted in the code editor. The ASL definition of your workflow is automatically updated if you reorder, delete, or add a state in the **Design** mode or the graph visualization pane.

The code editor can make suggestions to auto-complete fields and states.
+ To see a list of fields you can include within a specific state, press **Ctrl\$1Space**.
+ To generate a code snippet for a new state in your workflow press **Ctrl\$1Space** after the current state's definition.
+ To display a list of all available commands and **keyboard shortcuts**, press **F1**.

### Graph visualization
<a name="wfs-interface-code-graph-viz"></a>

The graph visualization panel shows your workflow in a graphical format. When you write your workflow definitions in the [Code editor](#wfs-interface-code-editor) of Workflow Studio, the graph visualization pane renders a real-time graph of your workflow. 

As you reorder, delete, or duplicate a state in the graph visualization pane, the workflow definition in the Code editor is automatically updated. Similarly, as you update your workflow definitions, reorder, delete, or add a state in the Code editor, the visualization is automatically updated.

If the JSON in the ASL definition of your workflow is invalid, the graph visualization panel pauses the rendering and displays a status message at the bottom of the pane.

## Config mode
<a name="wfs-interface-config-mode"></a>

In the **Config** mode of Workflow Studio, you can manage the general configuration of your state machines. In this mode, you can specify settings, such as the following:
+ **Details**: Set the workflow **name** and **type**. Note that both **cannot** be changed after you create the state machine.
+ **Permissions **: you can create a new role (recommended), choose an existing role, or enter an ARN for a specific role. If you select the option to create a new role, Step Functions creates an execution role for your state machines using least privileges. The generated IAM roles are valid for the AWS Region in which you create the state machine. Prior to creation, you can review the permissions that Step Functions will automatically generate for your state machine.
+ **Logging**: You can enable and set a log level for your state machine. Step Functions logs the execution history events based on your selection. You can optionally use a customer managed key to encrypt your logs. For more information about log levels, see [Log levels for Step Functions execution events](cw-logs.md#cloudwatch-log-level).

In **Additional configuration**, you can set one or more of the following **optional** configuration options:
+ **Enable X-Ray tracing**: You can send traces to X-Ray for state machine executions, even when a trace ID is not passed by an upstream service. For more information, see [Trace Step Functions request data in AWS X-Ray](concepts-xray-tracing.md).
+ **Publish version on creation**: A *version* is a numbered, immutable snapshot of a state machine that you can run. Choose this option to publish a version of your state machine while creating the state machine. Step Functions publishes version 1 as the first revision of the state machine. For more information about versions, see [State machine versions in Step Functions workflows](concepts-state-machine-version.md).
+ **Encrypt with customer managed key **: You can provide a key that you mange directly to encrypt your data. For information, see [Data at rest encryption](encryption-at-rest.md)
+ **Tags**: Choose this box to add tags that can help you track and manage the costs associated with your resources, and provide better security in your IAM policies. For more information about tags, see [Tagging state machines and activities in Step Functions](sfn-best-practices.md#concepts-tagging).

# Creating a workflow with Workflow Studio in Step Functions
<a name="workflow-studio-create"></a>

Learn to create, edit, and run workflows using Step Functions Workflow Studio. After your workflow is ready, you can save, run, and export it. 

**Topics**
+ [Create a state machine](#workflow-studio-components-create)
+ [Design a workflow](#workflow-studio-build)
+ [Run your workflow](#workflow-studio-components-create-run)
+ [Edit your workflow](#workflow-studio-components-create-edit)
+ [Export your workflow](#workflow-studio-components-create-export)
+ [Creating a workflow prototype with placeholders](#workflow-studio-components-create-prototype)

## Create a state machine
<a name="workflow-studio-components-create"></a>

In Workflow Studio, you can either choose a starter template or a blank template to create a workflow.

A starter template is a ready-to-run sample project that automatically creates the workflow prototype and definition, and deploys all the related AWS resources that your project needs to your AWS account. You can use these starter templates to deploy and run them as is, or use the workflow prototypes to build on them. For more information about starter templates, see [Deploy a state machine using a starter template for Step Functions](starter-templates.md).

With a blank template, you use the [Design](workflow-studio.md#wfs-interface-design-mode) or [Code](workflow-studio.md#wfs-interface-code-mode) mode to create your custom workflow.

### Create a state machine using a starter template
<a name="wfs-create-workflow-templates"></a>

1. Open the [Step Functions console](https://console.aws.amazon.com/states/home?region=us-east-1#/) and choose **Create state machine**.

1. In the **Choose a template** dialog box, do one of the following to choose a sample project:
   + Type **Task Timer** in the Search by keyword box, and then choose **Task Timer** from the search results.
   + Browse through the sample projects listed under **All** on the right pane, and then choose **Task Timer**.

1. Choose **Next** to continue.

1. Choose how to use the template:

1. Choose **Use template** to continue with your selection.

1. **Run a demo** – creates a read-only state machine. After review, you can create the workflow and all related resources.

1. **Build on it** – provides an editable workflow definition that you can review, customize, and deploy with your own resources. (Related resources, such as functions or queues, will **not** be created automatically.)

### Create a workflow using a blank template
<a name="wfs-create-workflow-blank"></a>

When you want to start from a clean canvas, create a workflow from the blank template.

1. Open the [Step Functions console](https://console.aws.amazon.com/states/home?region=us-east-1#/).

1. Choose **Create state machine**.

1. Choose **Create from blank**.

1. Name your state machine, then choose **Continue** to edit your state machine in Workflow Studio.

   You can now start designing your workflow in [Design mode](workflow-studio.md#wfs-interface-design-mode) or writing your workflow definition in [Code mode](workflow-studio.md#wfs-interface-code-mode).

1. Choose **Config** to manage the configuration of your workflow in the [Config mode](workflow-studio.md#wfs-interface-config-mode). For example, provide a name for your workflow and choose its type.

## Design a workflow
<a name="workflow-studio-build"></a>

When you know the name of the state you want to add, use the search box at the top of the [States browser](workflow-studio.md#workflow-studio-components-states) to find it. Otherwise, look for the state you need in the browser and add it onto the canvas. 

You can reorder states in your workflow by dragging them to a different location in your workflow. As you drag a state onto the canvas, a line appears to show where the state will be inserted into your workflow, as shown in the following screenshot: 

![\[Illustrative screenshot showing the blue line that indicates the destination for a state.\]](http://docs.aws.amazon.com/step-functions/latest/dg/images/wfe-design-02.png)


After a state is dropped onto the canvas, its code is auto-generated and added inside the workflow definition. To see the definition, turn on the **Definition** toggle on the [Inspector panel](workflow-studio.md#workflow-studio-components-formdefinition). You can choose [Code mode](workflow-studio.md#wfs-interface-code-mode) to edit the definition with the built-in code editor.

After you drop a state onto the canvas, you can configure it in the [Inspector panel](workflow-studio.md#workflow-studio-components-formdefinition) panel on the right. This panel contains the **Configuration**, **Input**, **Output**, and **Error Handling** tabs for each of the state or API action that you place on the canvas. You configure the states you include in your workflows in the **Configuration** tab. 

For example, the **Configuration** tab for Lambda Invoke API action provides the following options:
+ **State name**: You can identify the state with a custom name or accept the default generated name.
+ **API** shows which API action is used by the state. 
+ **Integration type**: You can choose the service integration type used to call API actions on other services.
+ **Function name** provides options to:
  +  **Enter a function name**: You can enter your function name or its ARN. 
  +  **Get function name at runtime from state input**: You can use this option to dynamically get the function name from the state input based on the path you specify. 
  +  **Select function name**: You can directly select from the functions available in your account and region. 
+ **Payload** : you can choose to use the state input, a JSON object, or no payload to pass as the payload to your Lambda function. If you choose JSON, you can include both static values and values selected from the state input.
+ (Optional) Some states will have an option to select **Wait for task to complete** or **Wait for callback**. When available, you can choose one of the following [service integration patterns](connect-to-resource.md): 
  + **No option selected**: Step Functions will use the [Request Response](connect-to-resource.md#connect-default) integration pattern. Step Functions will wait for an HTTP response and then progress to the next state. Step Functions will not wait for a job to complete. When no options are available, the state will use this pattern. 
  + **Wait for task to complete**: Step Functions will use the [Run a Job (.sync)](connect-to-resource.md#connect-sync) integration pattern.
  + **Wait for callback**: Step Functions will use the [Wait for a Callback with Task Token](connect-to-resource.md#connect-wait-token) integration pattern.
+ (Optional) To access resources configured in different AWS accounts within your workflows, Step Functions provides [cross-account access](concepts-access-cross-acct-resources.md). **IAM role for cross-account access** provides options to:
  + **Provide IAM role ARN**: Specify the IAM role that contains appropriate resource access permissions. These resources are available in a target account, which is an AWS account to which you make cross-account calls.
  + **Get IAM role ARN at runtime from state input**: Specify a reference path to an existing key-value pair in the state’s JSON input which contains the IAM role.
+ **Next state** lets you to select the state you want to transition to next. 
+ (Optional) **Comment** field will not affect the workflow, but you can be use it to annotate your workflow.

Some states will have additional generic configuration options. For example, the Amazon ECS `RunTask` state configuration contains an `API Parameters` field populated with placeholder values. For these states, you can replace the placeholder values with configurations that are suited to your needs.

**To delete a state**

You can press backspace, right-click and choose **Delete state**, or choose **Delete** on the [Design toolbar](workflow-studio.md#wfs-interface-design-mode).

## Run your workflow
<a name="workflow-studio-components-create-run"></a>

When your workflow is ready to go, you can run it and view its execution from the [Step Functions console](https://console.aws.amazon.com/states/home).

**To run a workflow in Workflow Studio**

1. In the **Design**, **Code**, or **Config** mode, choose **Execute.**

   The **Start execution** dialog box opens in a new tab.

1. In the **Start execution** dialog box, do the following:

   1. (Optional) Enter a custom execution name to override the generated default.
**Non-ASCII names and logging**  
Step Functions accepts names for state machines, executions, activities, and labels that contain non-ASCII characters. Because such characters will prevent Amazon CloudWatch from logging data, we recommend using only ASCII characters so you can track Step Functions metrics.

   1. (Optional) In the **Input** box, enter input values in JSON format to run your workflow.

   1. Choose **Start execution**.

   1. The Step Functions console directs you to a page that's titled with your execution ID, known as the *Execution Details* page. You can review the execution results as the workflow progresses and after it completes.

      To review the execution results, choose individual states on the **Graph view**, and then choose the individual tabs on the [Step details](concepts-view-execution-details.md#exec-details-intf-step-details) pane to view each state's details including input, output, and definition respectively. For details about the execution information you can view on the *Execution Details* page, see [Execution details overview](concepts-view-execution-details.md#exec-details-interface-overview).

## Edit your workflow
<a name="workflow-studio-components-create-edit"></a>

You can edit an existing workflow visually in the [Design mode](workflow-studio.md#wfs-interface-design-mode) of Workflow Studio. 

In the [Step Functions console](https://console.aws.amazon.com/states/home), choose the workflow you want to edit from the **State machines** page. The workflow opens in **Design** mode of Workflow Studio.

You can also edit the workflow definition in [Code mode](workflow-studio.md#wfs-interface-code-mode). Choose the **Code** button to view or edit the workflow definition in Workflow Studio.

**Note**  
If you see errors in your workflow, you must fix them in **Design** mode. You can't switch to the **Code** or **Config** mode if any errors exist in your workflow.

When you save changes to your workflow, you have the option to also publish a new **version**. With versions, you can choose to run the original or alternate versions of your workflow. To learn more about managing workflows with versions, see [State machine versions in Step Functions workflows](concepts-state-machine-version.md)

## Export your workflow
<a name="workflow-studio-components-create-export"></a>

You can export your workflow's [Amazon States Language](concepts-amazon-states-language.md) (ASL) definition and your workflow graph:

1. Choose your workflow in the [Step Functions console](https://console.aws.amazon.com/states/home).

1. On the *State machine detail* page, choose **Edit**.

1. Choose the **Actions** dropdown button, and then do one or both of the following:
   + To export the workflow graph to an SVG or PNG file, under **Export graph**, select the format you want.
   + To export the workflow definition as a JSON or YAML file, under **Export definition**, select the format you want.

## Creating a workflow prototype with placeholders
<a name="workflow-studio-components-create-prototype"></a>

You can use Workflow Studio or [Workflow Studio in Infrastructure Composer](use-wfs-in-app-composer.md) to create prototypes of new workflows that contain *placeholder resources* which are named resources that do not exist yet.

To create a workflow prototype:

1. Sign in to the [Step Functions console](https://console.aws.amazon.com/states/home?region=us-east-1#/).

1. Choose **Create state machine**.

1. Choose **Create from blank**.

1. Name your state machine, then choose **Continue** to edit your state machine in Workflow Studio.

1. The [Design mode](workflow-studio.md#wfs-interface-design-mode) of Workflow Studio opens. Design your workflow in Workflow Studio. To include placeholder resources:

   1. Choose the state for which you want to include a placeholder resource, and then in **Configuration**:
      + For Lambda Invoke states, choose **Function name**, then choose **Enter function name**. You can also enter a custom name for your function.
      + For Amazon SQS Send Message states, choose **Queue URL**, then choose **Enter queue URL**. Enter a placeholder queue URL.
      + For Amazon SNS Publish states, from **Topic**, choose a topic ARN.
      + For all other states listed under **Actions**, you can use the default configuration.
**Note**  
If you see errors in your workflow, you must fix them in **Design** mode. You can't switch to the **Code** or **Config** mode if any errors exist in your workflow.

   1. (Optional) To view the auto-generated ASL definition of your workflow, choose **Definition**.

   1. (Optional) To update the workflow definition in Workflow Studio, choose the **Code** button.
**Note**  
If you see errors in your workflow definition, you must fix them in **Code** mode. You can't switch to the **Design** or **Config** mode if any errors exist in your workflow definition.

1. (Optional) To edit the state machine name, choose the edit icon next to the default state machine name of **MyStateMachine** and specify a name in the **State machine name** box.

   You can also switch to the [Config mode](workflow-studio.md#wfs-interface-config-mode) to edit the default state machine name.

1. Specify your workflow settings, such as state machine type and its execution role.

1. Choose **Create**.

You've now created a new workflow with placeholder resources that can be used to prototype. You can [export](#workflow-studio-components-create-export) your workflow definition and the workflow graph.
+ To export your workflow definition as a JSON or YAML file, in the **Design** or **Code** mode, choose the **Actions** dropdown button. Then, under **Export definition**, select the format you want to export. You can use this exported definition as the starting point for local development with the [AWS Toolkit for Visual Studio Code](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/building-stepfunctions.html).
+ To export your workflow graph to an SVG or PNG file, in the **Design** or **Code** mode, choose the **Actions** dropdown button. Then, under **Export definition**, select the format you want.

# Configure states inputs and outputs with Workflow Studio in Step Functions
<a name="workflow-studio-process"></a>

**Managing state and transforming data**  
Learn about [Passing data between states with variables](workflow-variables.md) and [Transforming data with JSONata](transforming-data.md).

Each state makes a decision or performs an action based on input that it receives. In most cases, it then passes output to other states. In Workflow Studio, you can configure how a state filters and manipulates its input and output data in the **Input** and **Output** tabs of the [Inspector panel](workflow-studio.md#workflow-studio-components-formdefinition) panel. Use the **Info** links to access contextual help when configuring inputs and outputs. 

![\[Illustrative screenshot showing state inputs, outputs, and the info help panel\]](http://docs.aws.amazon.com/step-functions/latest/dg/images/wfs_input_output_01.png)


For detailed information about how Step Functions processes input and output, see [Processing input and output in Step Functions](concepts-input-output-filtering.md). 

## Configure input to a state
<a name="workflow-studio-process-input"></a>

Each state receives input from the previous state as JSON. If you want to filter the input, you can use the `InputPath` filter under the **Input** tab in the [Inspector panel](workflow-studio.md#workflow-studio-components-formdefinition) panel. The `InputPath` is a string, beginning with `$`, that identifies a specific JSON node. These are called [reference paths](amazon-states-language-paths.md), and they follow JsonPath syntax. 

To filter the input:
+ Choose **Filter input with InputPath**.
+ Enter a valid [JsonPath](https://datatracker.ietf.org/wg/jsonpath/about/) for the `InputPath` filter. For example, **\$1.data**.

Your `InputPath` filter will be added to your workflow.

**Example 1: Use InputPath filter in Workflow Studio**  
Say the input to your state includes the following JSON data.  

```
{
  "comment": "Example for InputPath",
  "dataset1": {
    "val1": 1,
    "val2": 2,
    "val3": 3
  },
  "dataset2": {
    "val1": "a",
    "val2": "b",
    "val3": "c"
  }
}
```
To apply the `InputPath` filter, choose **Filter input with InputPath**, then enter an appropriate reference path. If you enter **\$1.dataset2.val1**, the following JSON is passed as input to the state.  

```
{"a"}
```
A reference path can also have a selection of values. If the data you reference is `{ "a": [1, 2, 3, 4] }` and you apply the reference path `$.a[0:2]` as the `InputPath` filter, the following is the result.  

```
[ 1, 2 ]
```

[Parallel workflow state](state-parallel.md), [Map workflow state](state-map.md), and [Pass workflow state](state-pass.md) flow states have an additional input filtering option called `Parameters` under their **Input** tab. This filter takes effect after the InputPath filter and can be used to construct a custom JSON object consisting of one or more key-value pairs. The values of each pair can either be static values, can be selected from the input, or can be selected from the [Accessing execution data from the Context object in Step Functions](input-output-contextobject.md) with a path. 

**Note**  
To specify that a parameter uses a reference path to point to a JSON node in the input, the parameter name must end with `.$`.

**Example 2: Create custom JSON input for Parallel state**  
Say the following JSON data is the input to a Parallel state.  

```
{
  "comment": "Example for Parameters",
  "product": {
    "details": {
      "color": "blue",
      "size": "small",
      "material": "cotton"
    },
    "availability": "in stock",
    "sku": "2317",
    "cost": "$23"
  }
}
```

To select part of this input and pass additional key-value pairs with a static value, you can specify the following in the **Parameters** field, under the **Parallel** state’s **Input** tab.

```
{
 "comment": "Selecting what I care about.",
 "MyDetails": {
    "size.$": "$.product.details.size",
    "exists.$": "$.product.availability",
    "StaticValue": "foo"
    }
 }
```

The following JSON data will be the result.

```
{
  "comment": "Selecting what I care about.",
  "MyDetails": {
    "size": "small",
    "exists": "in stock",
    "StaticValue": "foo"
  }
}
```

## Configure output of a state
<a name="workflow-studio-process-output"></a>

Each state produces JSON output that can be filtered before it is passed to the next state. There are several filters available, and each affects the output in a different way. Output filters available for each state are listed under the **Output** tab in the **Inspector** panel. For [Task workflow state](state-task.md) states, any output filters you select are processed in this order: 

1.  `ResultSelector`: Use this filter to manipulate the state’s result. You can construct a new JSON object with parts of the result. 

1.  `Specifying state output using ResultPath in Step Functions`: Use this filter to select a combination of the state input and the task result to pass to the output. 

1.  `Filtering state output using OutputPath`: Use this filter to filter the JSON output to choose which information from the result will be passed to the next state. 

### Use ResultSelector
<a name="workflow-studio-process-output-resultselector"></a>

`ResultSelector` is an optional output filter for the following states:
+  [Task workflow state](state-task.md) states, which are all states listed in the **Actions** tab of the [States browser](workflow-studio.md#workflow-studio-components-states). 
+  [Map workflow state](state-map.md) states, in the **Flow** tab of the States browser. 
+  [Parallel workflow state](state-parallel.md) states, in the **Flow** tab of the States browser. 

`ResultSelector` can be used to construct a custom JSON object consisting of one or more key-value pairs. The values of each pair can either be static values or selected from the state's result with a path. 

**Note**  
To specify that a parameter uses a path to reference a JSON node in the result, the parameter name must end with `.$`.

**Example to use ResultSelector filter**  
In this example, you use `ResultSelector` to manipulate the response from the Amazon EMR CreateCluster API call for an Amazon EMR `CreateCluster` state. The following is the result from the Amazon EMR `CreateCluster` API call.  

```
{
  "resourceType": "elasticmapreduce",
  "resource": "createCluster.sync",
  "output": {
    "SdkHttpMetadata": {
      "HttpHeaders": {
        "Content-Length": "1112",
        "Content-Type": "application/x-amz-JSON-1.1",
        "Date": "Mon, 25 Nov 2019 19:41:29 GMT",
        "x-amzn-RequestId": "1234-5678-9012"
      },
      "HttpStatusCode": 200
    },
    "SdkResponseMetadata": {
      "RequestId": "1234-5678-9012"
    },
    "ClusterId": "AKIAIOSFODNN7EXAMPLE"
  }
}
```
To select part of this information and pass an additional key-value pair with a static value, specify the following in the **ResultSelector** field, under the state’s **Output** tab.  

```
{
 "result": "found",
 "ClusterId.$": "$.output.ClusterId", 
 "ResourceType.$": "$.resourceType"
 }
```
Using `ResultSelector` produces the following result.  

```
{
 "result": "found",
 "ClusterId": "AKIAIOSFODNN7EXAMPLE",
 "ResourceType": "elasticmapreduce"
}
```

### Use ResultPath
<a name="workflow-studio-process-output-resultpath"></a>

The output of a state can be a copy of its input, the result it produces, or a combination of its input and result. Use `ResultPath` to control which combination of these is passed to the state output. For more use cases of `ResultPath`, see [Specifying state output using ResultPath in Step Functions](input-output-resultpath.md).

`ResultPath` is an optional output filter for the following states:
+  [Task workflow state](state-task.md) states, which are all states listed in the **Actions** tab of the States browser. 
+  [Map workflow state](state-map.md) states, in the **Flow** tab of the States browser. 
+  [Parallel workflow state](state-parallel.md) states, in the **Flow** tab of the States browser. 
+  [Pass workflow state](state-pass.md) states, in the **Flow** tab of the States browser. 

`ResultPath` can be used to add the result into the original state input. The specified path indicates where to add the result.

**Example to use ResultPath filter**  
Say the following is the input to a Task state.  

```
{
  "details": "Default example",
  "who": "AWS Step Functions"
}
```
The result of the Task state is the following.  

```
Hello, AWS Step Functions
```
You can add this result to the state’s input by applying `ResultPath` and entering a reference [path](amazon-states-language-paths.md) that indicates where to add the result, such as `$.taskresult`:  
With this `ResultPath`, the following is the JSON that is passed as the state’s output.  

```
{
  "details": "Default example",
  "who": "AWS Step Functions",
  "taskresult": "Hello, AWS Step Functions!"
}
```

### Use OutputPath
<a name="workflow-studio-process-output-resultselector"></a>

The `OutputPath` filter lets you filter out unwanted information, and pass only the portion of JSON that you need. The `OutputPath` is a string, beginning with `$`, that identifies nodes within JSON text.

**Example to use OutputPath filter**  
Imagine a Lambda Invoke API call returns metadata in addition to the Lambda function’s result.  

```
{
  "ExecutedVersion": "$LATEST",
  "Payload": {
     "foo": "bar",
     "colors": [
          "red",
          "blue",
          "green"    
     ],
     "car": {
          "year": 2008,
          "make": "Toyota",
          "model": "Matrix"
     }
   },
"SdkHttpMetadata": {
  "AllHttpHeaders": {
    "X-Amz-Executed-Version": ["$LATEST"]
...
```
You can use `OutputPath` to filter out the additional metadata. By default, the value of **OutputPath** filter for Lambda Invoke states created through the Workflow Studio is `$.Payload`. This default value removes the additional metadata and returns an output equivalent to running the Lambda function directly.  
The Lambda Invoke task result example and the value of `$.Payload` for the **Output** filter pass the following JSON data as the output.  

```
{
 "foo": "bar",
 "colors": [
      "red",
      "blue",
      "green"    
 ],
 "car": {
      "year": 2008,
      "make": "Toyota",
      "model": "Matrix"
 }
}
```
The `OutputPath` filter is the last output filter to take effect, so if you use additional output filters such as `ResultSelector` or `ResultPath`, you should modify the default value of `$.Payload` for the `OutputPath` filter accordingly. 

# Set up execution roles with Workflow Studio in Step Functions
<a name="manage-state-machine-permissions"></a>

You can use Workflow Studio to set up execution roles for your workflows. Every Step Functions state machine requires an AWS Identity and Access Management (IAM) role which grants the state machine permission to perform actions on AWS services and resources or call HTTPS APIs. This role is called an *execution role*. 

The execution role must contain IAM policies for each action, for example, policies that allow the state machine to invoke an AWS Lambda function, run an AWS Batch job, or call the Stripe API. Step Functions requires you to provide an execution role in the following cases:
+ You create a state machine in the console, AWS SDKs or AWS CLI using the [CreateStateMachine](https://docs.aws.amazon.com/step-functions/latest/apireference/API_CreateStateMachine.html) API.
+ You [test](test-state-isolation.md) a state in the console, AWS SDKs, or AWS CLI using the [TestState](https://docs.aws.amazon.com/step-functions/latest/apireference/API_TestState.html) API.

**Topics**
+ [About auto-generated roles](#wfs-auto-gen-roles)
+ [Automatically generating roles](#auto-generating-roles)
+ [Resolving role generation problems](#resolve-role-gen-problem)
+ [Role for testing HTTP Tasks in Workflow Studio](#test-state-role-http)
+ [Role for testing an optimized service integration in Workflow Studio](#test-state-role-optimized)
+ [Role for testing an AWS SDK service integration in Workflow Studio](#test-state-role-aws-sdk)
+ [Role for testing flow states in Workflow Studio](#test-state-role-flow)

## About auto-generated roles
<a name="wfs-auto-gen-roles"></a>

When you create a state machine in the Step Functions console, [Workflow Studio](workflow-studio.md) can automatically create an execution role for you which contains the necessary IAM policies. Workflow Studio analyzes your state machine definition and generates policies with the least privileges necessary to execute your workflow.

Workflow Studio can generate IAM policies for the following:
+ [HTTP Tasks](call-https-apis.md) that call HTTPS APIs.
+ Task states that call other AWS services using [optimized integrations](integrate-optimized.md), such as [Lambda Invoke](connect-lambda.md), [DynamoDB GetItem](connect-batch.md), or [AWS Glue StartJobRun](connect-glue.md).
+ Task states that run [nested workflows](connect-stepfunctions.md).
+ [Distributed Map states](state-map-distributed.md), including [policies](iam-policies-eg-dist-map.md) to start child workflow executions, list Amazon S3 buckets, and read or write S3 objects.
+ [X-Ray](concepts-xray-tracing.md) tracing. Every role that is auto-generated in Workflow Studio contains a [policy](concepts-xray-tracing.md#xray-iam) which grants permissions for the state machine to send traces to X-Ray.
+ [Using CloudWatch Logs to log execution history in Step Functions](cw-logs.md) when logging is enabled on the state machine.

Workflow Studio can't generate IAM policies for Task states that call other AWS services using [AWS SDK integrations](supported-services-awssdk.md).

## Automatically generating roles
<a name="auto-generating-roles"></a>

1. Open the [Step Functions console](https://console.aws.amazon.com/states/home), choose **State machines** from the menu, then choose **Create state machine**.

   You can also update an existing state machine. Refer Step 4 if you're updating a state machine.

1. Choose **Create from blank**.

1. Name your state machine, then choose **Continue** to edit your state machine in Workflow Studio.

1. Choose the **Config** tab.

1. Scroll down to the **Permissions** section, and do the following:

   1. For **Execution role**, make sure you keep the default selection of **Create new role**.

      Workflow Studio automatically generates all the required IAM policies for every valid state in your state machine definition. It displays a banner in with the message, **An execution role will be created with full permissions.**  
![\[Illustrative screenshot of the Config tab with preview of auto-generated permissions.\]](http://docs.aws.amazon.com/step-functions/latest/dg/images/wfs-full-permissions-role.png)
**Tip**  
To review the permissions that Workflow Studio automatically generates for your state machine, choose **Review auto-generated permissions**.
**Note**  
If you delete the IAM role that Step Functions creates, Step Functions can't recreate it later. Similarly, if you modify the role (for example, by removing Step Functions from the principals in the IAM policy), Step Functions can't restore its original settings later. 

      If Workflow Studio can't generate all the required IAM policies, it displays a banner with the message **Permissions for certain actions cannot be auto-generated. An IAM role will be created with partial permissions only.** For information about how to add the missing permissions, see [Resolving role generation problems](#resolve-role-gen-problem).

   1. Choose **Create** if you're creating a state machine. Otherwise, choose **Save**.

   1. Choose **Confirm** in the dialog box that appears.

      Workflow Studio saves your state machine and creates the new execution role.

## Resolving role generation problems
<a name="resolve-role-gen-problem"></a>

Workflow Studio can't automatically generate an execution role with all the required permissions in the following cases:
+ There are errors in your state machine. Make sure to resolve all validation errors in Workflow Studio. Also, make sure that you address any server-side errors you encounter in the course of saving.
+ Your state machine contains tasks use AWS SDK integrations. Workflow Studio can't [auto-generate](#auto-generating-roles) IAM policies in this case. Workflow Studio displays a banner with the message, **Permissions for certain actions cannot be auto-generated. An IAM role will be created with partial permissions only.** In the **Review auto-generated permissions** table, choose the content in **Status** for more information about the policies your execution role is missing. Workflow Studio can still generate an execution role, but this role will not contain IAM policies for all actions. See the links under **Documentation links** to write your own policies and add them to the role after it is generated. These links are available even after you save the state machine.

## Role for testing HTTP Tasks in Workflow Studio
<a name="test-state-role-http"></a>

[Testing](call-https-apis.md#http-task-test) an HTTP Task state requires an execution role. If you don’t have a role with sufficient permissions, use one of the following options to create a role:
+ **Auto-generate a role with Workflow Studio (recommended)** – This is the secure option. Close the **Test state** dialog box and follow the instructions in [Automatically generating roles](#auto-generating-roles). This will require you to create or update your state machine first, then go back into Workflow Studio to test your state.
+ **Use a role with Administrator access** – If you have permissions to create a role with full access to all services and resources in AWS, you can use that role to test any type of state in your workflow. To do this, you can create a Step Functions service role and add the [AdministratorAccess policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html#jf_administrator) to it in the IAM console [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/).

## Role for testing an optimized service integration in Workflow Studio
<a name="test-state-role-optimized"></a>

Task states that call [optimized service integrations](integrate-optimized.md) require an execution role. If you don’t have a role with sufficient permissions, use one of the following options to create a role:
+ **Auto-generate a role with Workflow Studio (recommended)** – This is the secure option. Close the **Test state** dialog box and follow the instructions in [Automatically generating roles](#auto-generating-roles). This will require you to create or update your state machine first, then go back into Workflow Studio to test your state.
+ **Use a role with Administrator access** – If you have permissions to create a role with full access to all services and resources in AWS, you can use that role to test any type of state in your workflow. To do this, you can create a Step Functions service role and add the [AdministratorAccess policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html#jf_administrator) to it in the IAM console [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/).

## Role for testing an AWS SDK service integration in Workflow Studio
<a name="test-state-role-aws-sdk"></a>

Task states that call [AWS SDK integrations](supported-services-awssdk.md) require an execution role. If you don’t have a role with sufficient permissions, use one of the following options to create a role:
+ **Auto-generate a role with Workflow Studio (recommended)** – This is the secure option. Close the **Test state** dialog box and follow the instructions in [Automatically generating roles](#auto-generating-roles). This will require you to create or update your state machine first, then go back into Workflow Studio to test your state. Do the following:

  1. Close the **Test state** dialog box

  1. Choose the **Config** tab to view the Config mode.

  1. Scroll down to the **Permissions** section.

  1. Workflow Studio displays a banner with the message, **Permissions for certain actions cannot be auto-generated. An IAM role will be created with partial permissions only.** Choose **Review auto-generated permissions**.

  1. The **Review auto-generated permissions** table displays a row that shows the action corresponding to the task state you want to test. See the links under **Documentation links** to write your own IAM policies into a custom role.
+ **Use a role with Administrator access** – If you have permissions to create a role with full access to all services and resources in AWS, you can use that role to test any type of state in your workflow. To do this, you can create a Step Functions service role and add the [AdministratorAccess policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html#jf_administrator) to it in the IAM console [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/).

## Role for testing flow states in Workflow Studio
<a name="test-state-role-flow"></a>

You require an execution role to test flow states in Workflow Studio. Flow states are those states that direct execution flow, such as [Choice workflow state](state-choice.md), [Parallel workflow state](state-parallel.md), [Map workflow state](state-map.md), [Pass workflow state](state-pass.md), [Wait workflow state](state-wait.md), [Succeed workflow state](state-succeed.md), or [Fail workflow state](state-fail.md). The [TestState](https://docs.aws.amazon.com/step-functions/latest/apireference/API_TestState.html) API doesn't work with Map or Parallel states. Use one of the following options to create a role for testing a flow state:
+ **Use any role in your AWS account (recommended)** – Flow states do not require any specific IAM policies, because they don’t call AWS actions or resources. Therefore, you can use any IAM role in your AWS account. 

  1. In the **Test state** dialog box, select any role from the **Execution role** dropdown list.

  1. If no roles appear in the dropdown list, do the following:

     1. In the IAM console [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/), choose **Roles**.

     1. Choose a role from the list, and copy its ARN from the role details page. You will need to provide this ARN in the **Test state** dialog box.

     1. In the **Test state** dialog box, select **Enter a role ARN** from the **Execution role** dropdown list.

     1. Paste the ARN in **Role ARN**.
+ **Use a role with Administrator access** – If you have permissions to create a role with full access to all services and resources in AWS, you can use that role to test any type of state in your workflow. To do this, you can create a Step Functions service role and add the [AdministratorAccess policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html#jf_administrator) to it in the IAM console [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/).

# Configure error handling with Workflow Studio in Step Functions
<a name="workflow-studio-process-error"></a>

**Managing state and transforming data**  
Learn about [Passing data between states with variables](workflow-variables.md) and [Transforming data with JSONata](transforming-data.md).

You can configure error handling within the Workflow Studio visual editor. By default, when a state reports an error, Step Functions causes the workflow execution to fail entirely. For actions and some flow states, you can configure how Step Functions handles errors. 

Even if you have configured error handling, some errors may still cause a workflow execution to fail. For more information, see [Handling errors in Step Functions workflows](concepts-error-handling.md). In Workflow Studio, configure error handling in the **Error handling** tab of the [Inspector panel](workflow-studio.md#workflow-studio-components-formdefinition). 

## Retry on errors
<a name="workflow-studio-process-error-retry"></a>

You can add one or more rules to action states and the [Parallel workflow state](state-parallel.md) flow state to retry the task when an error occurs. These rules are called *retriers*. To add a retrier, choose the edit icon in **Retrier \$11** box, then configure its options:
+ (Optional) In the **Comment** field, add your comment. It will not affect the workflow, but can be used to annotate your workflow. 
+ Place the cursor in the **Errors** field and choose an error that will trigger the retrier, or enter a custom error name. You can choose or add multiple errors.
+ (Optional) Set an **Interval**. This is the time in seconds before Step Functions make its first retry. Additional retries will follow at intervals that you can configure with **Max attempts** and **Backoff rate**.
+ (Optional) Set **Max attempts**. This is the maximum number of retries before Step Functions will cause the execution to fail.
+ (Optional) Set the **Backoff rate**. This is a multiplier that determines by how much the retry interval will increase with each attempt.

**Note**  
Not all error handling options are available for all states. Lambda Invoke has one retrier configured by default.

## Catch errors
<a name="workflow-studio-process-error-catch"></a>

You can add one or more rules to action states and to the [Parallel workflow state](state-parallel.md) and [Map workflow state](state-map.md) flow states to catch an error. These rules are called *catchers*. To add a catcher, choose **Add new catcher**, then configure its options:
+ (Optional) In the **Comment** field, add your comment. It will not affect the workflow, but can be used to annotate your workflow. 
+ Place the cursor in **Errors** field and choose an error that will trigger the catcher, or enter a custom error name. You can choose or add multiple errors.
+ In the **Fallback state** field, choose a [fallback state](concepts-error-handling.md#error-handling-fallback-states). This is the state that the workflow will move to next, after an error is caught.
+ (Optional) In the **ResultPath** field, add a `ResultPath` filter to add the error to the original state input. The [`ResultPath`](input-output-resultpath.md) must be a valid [JsonPath](https://datatracker.ietf.org/wg/jsonpath/about/). This will be sent to the fallback state.

## Timeouts
<a name="workflow-studio-process-error-timeout"></a>

You can configure a timeout for action states to set the maximum number of seconds your state can run before it fails. Use timeouts to prevent stuck executions. To configure a timeout, enter the number of seconds your state should wait before the execution fails. For more information about timeouts, see `TimeoutSeconds` in [Task workflow state](state-task.md) state.

## HeartbeatSeconds
<a name="workflow-studio-process-error-heartbeat"></a>

You can configure a *Heartbeat* or periodic notification sent by your task. If you set a heartbeat interval, and your state doesn't send heartbeat notifications in the configured intervals, the task is marked as failed. To configure a heartbeat, set a positive, non-zero integer number of seconds. For more information, see `HeartBeatSeconds` in [Task workflow state](state-task.md) state. 

# Using Workflow Studio in Infrastructure Composer to build Step Functions workflows
<a name="use-wfs-in-app-composer"></a>

Workflow Studio is available in Infrastructure Composer to help you design and build your workflows. Workflow Studio in Infrastructure 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 Infrastructure Composer is a visual builder that helps you develop AWS SAM and AWS CloudFormation templates using a simple graphical interface. With Infrastructure Composer, you design an application architecture by dragging, grouping, and connecting AWS services in a visual canvas. Infrastructure 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 Infrastructure Composer, see [What is Infrastructure Composer](https://docs.aws.amazon.com/application-composer/latest/dg/what-is-composer.html).

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

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

**Topics**
+ [Using Workflow Studio in Infrastructure Composer](#procedure-use-wfs-in-app-composer)
+ [Dynamically reference resources using CloudFormation definition substitutions](#use-cfn-sub-edit-state-machine-resource)
+ [Connect service integration tasks to enhanced component cards](#connect-service-integrations-enhanced-cards)
+ [Import existing projects and sync them locally](#import-projects-local-sync)
+ [Export Step Functions workflows directly into AWS Infrastructure Composer](#export-wsf-projects-into-app-composer)
+ [Unavailable Workflow Studio features in AWS Infrastructure Composer](#wfs-features-unavailable-app-composer)

## Using Workflow Studio in Infrastructure Composer to build a serverless workflow
<a name="procedure-use-wfs-in-app-composer"></a>

1. Open the [Infrastructure Composer console](https://console.aws.amazon.com/composer/home) and choose **Create project** to create a project.

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

1. Drag the **Step Functions State machine** resource onto the canvas. 

1. 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 Infrastructure Composer.\]](http://docs.aws.amazon.com/step-functions/latest/dg/images/use-wfs-in-app-composer.gif)

   The integration with Workflow Studio to edit state machines resources created in Infrastructure Composer is only available for [https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-statemachine.html](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-statemachine.html) resource. This integration is not available for templates that use the [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html) resource.

## Dynamically reference resources using CloudFormation definition substitutions in Workflow Studio
<a name="use-cfn-sub-edit-state-machine-resource"></a>

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](concepts-sam-sfn.md#sam-definition-substitution-eg).

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.\]](http://docs.aws.amazon.com/step-functions/latest/dg/images/use-def-sub-wfs-app-composer.gif)


## Connect service integration tasks to enhanced component cards
<a name="connect-service-integrations-enhanced-cards"></a>

You can connect the tasks that call [optimized service integrations](integrate-optimized.md) to [enhanced component cards](https://docs.aws.amazon.com/application-composer/latest/dg/reference-cards.html#reference-cards-enhanced-components) in Infrastructure 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](https://docs.aws.amazon.com/application-composer/latest/dg/using-composer-cards.html#using-composer-cards-component-intro), the connection line doesn't appear on the Infrastructure Composer canvas.

The following animation shows how you can connect an optimized task to an enhanced component card and view the changes in [https://docs.aws.amazon.com/application-composer/latest/dg/using-change-inspector.html](https://docs.aws.amazon.com/application-composer/latest/dg/using-change-inspector.html).

![\[Animation showing how to connect tasks and optimized service integrations.\]](http://docs.aws.amazon.com/step-functions/latest/dg/images/make-connections-wfs-app-composer.gif)


You can't connect [AWS SDK integrations](supported-services-awssdk.md) 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 Infrastructure 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](manage-state-machine-permissions.md).

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.\]](http://docs.aws.amazon.com/step-functions/latest/dg/images/manual-update-placeholder-mapping.gif)


## Import existing projects and sync them locally
<a name="import-projects-local-sync"></a>

You can open existing CloudFormation and AWS SAM projects in Infrastructure Composer to visualize them for better understanding and modify their designs. Using Infrastructure Composer's [local sync](https://docs.aws.amazon.com/application-composer/latest/dg/reference-features-local-sync.html) 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](https://docs.aws.amazon.com/application-composer/latest/dg/reference-fsa.html), which allows web applications to read, write, and save files in your local file system. We recommend using either Google Chrome or Microsoft Edge.

## Export Step Functions workflows directly into AWS Infrastructure Composer
<a name="export-wsf-projects-into-app-composer"></a>

The AWS Step Functions console provides the ability to export a saved state machine workflow as a template that's recognized as an advanced IaC resource by Infrastructure Composer. This feature creates an IaC template as an AWS SAM schema and navigates you to Infrastructure Composer. For more information, see [Exporting your workflow to IaC templates](exporting-iac-templates.md).

## Unavailable Workflow Studio features in AWS Infrastructure Composer
<a name="wfs-features-unavailable-app-composer"></a>

When you use Workflow Studio in Infrastructure Composer, some of the Workflow Studio features are unavailable. In addition, the **API Parameters** section available in the [Inspector panel](workflow-studio.md#workflow-studio-components-formdefinition) panel supports CloudFormation definition substitutions. You can add the substitutions in the [Code mode](workflow-studio.md#wfs-interface-code-mode) using the `${dollar_sign_brace}` notation. For more information about this notation, see [DefinitionSubstitutions in AWS SAM templates](concepts-sam-sfn.md#sam-definition-substitution-eg).

The following list describes the Workflow Studio features that are unavailable when you use Workflow Studio in Infrastructure Composer:
+ [Starter templates](starter-templates.md) – 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](workflow-studio.md#wfs-interface-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 Infrastructure Composer canvas. For information about updating configurations in the **Resource properties** panel, see [Connect service integration tasks to enhanced component cards](#connect-service-integrations-enhanced-cards).
+ [TestState](test-state-isolation.md) API
+ Option to import or export workflow definitions from the **Actions** dropdown button in Workflow Studio. Instead, from the Infrastructure Composer **menu**, select **Open** > **Project folder**. Make sure that you've enabled the [local sync](https://docs.aws.amazon.com/application-composer/latest/dg/reference-features-local-sync.html) mode to automatically save your changes in the Infrastructure Composer canvas directly to your local machine.
+ **Execute** button. When you use Workflow Studio in Infrastructure Composer, Infrastructure 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).