# Dynamic Workflows

Building new Cascade workflows can be even easier with Dynamic Workflows. Sometimes workflow tool steps can be repetitive or convoluted within the Canvas. Dynamic Workflows allow you to clean up your canvas by isolating groups of tool steps and placing them in a separate, reusable workflow.&#x20;

## How to Create a Dynamic Workflow

Creating a Dynamic workflow couldn't be easier. Simply scroll to the "Dynamic Workflows" section of your right navigation bar and drag the "Add Dynamic Input" tool onto the canvas. Then connect the dynamic input tool to a sample dataset that looks like the expected datasets for Dynamic workflow.

{% hint style="success" %}
Pro tip: For your sample dataset, you can use the [New Table](/cascade/tools/import/newtable.md) tool to define the schema and data types that you want in your dynamic workflow.
{% endhint %}

<img src="/files/3MGEolRq95DAlIpKypK2" alt="" data-size="original">

Once your dynamic input is on the canvas, you can build out the workflow with as many tool steps as necessary. Use any tools available on the canvas after your dynamic input, including additional dynamic workflows. Dynamic workflows can be nested within each other to create multiple levels of dynamic logic.

{% hint style="warning" %}
Note: Be careful not to create circular dependencies within Dynamic Workflows, as they will create never ending loops and your workflow with fail.
{% endhint %}

When you're done building out the steps of the Dynamic Workflow, drag the "Add Dynamic Output" tool onto the canvas and connect it to your final step. Everything in between the square input and output tools will be run when this Dynamic Workflow is used.&#x20;

![Don't forget to Deploy your workflow!](/files/cX4XhJYniEn9JyzSyleK)

Dynamic Workflows are extremely powerful, but can only be put to use if [Deployed](/cascade/workflows/workflow-deployment.md). When creating or updating workflows while working in "Draft" mode, don't forget to click the orange "Deploy" button in the top right corner of your canvas so that dependent workflows have the most up-to-date logic. If you are working in "Live" mode, your work will automatically be deployed.

## Example: *Cryptocurrency Prices*

Dynamic Workflows can be valuable in many different use cases, but are especially helpful when trying to cleanup and transform multiple datasets with the same schema.&#x20;

Below we have an example Dynamic Workflow called "Crypto Avgs". We can see that the Dynamic Input takes in an example cryptocurrency\_prices dataset, executes a Validate Schema tool against a template file, transforms the data with a Pivot tool, and finally outputs our new data with the Dynamic Output.&#x20;

![Dynamic Workflow that validates and pivots data](/files/lSuraQtFR0N1zBvZJfIy)

Then, in a New Workflow, we can use the "Crypto Avgs" Dynamic Workflow to transform multiple Crypto\_Prices files in just one step each. To access the Dynamic Workflows, scroll down to the "Dynamic Workflows" section in the right navigation bar and click on "Link to Workflow". All *deployed* Dynamic Workflows will show up in that list. Simply drag out the Dynamic Workflow you want to use and connect it to tool nodes as if it were any other tool.&#x20;

![Workflows can use a Dynamic Workflow to complete repetitive transformations in one step](/files/TnI9gTG7hCe1M7cx8Am9)

If you don't see your Dynamic Workflow in the "Link to Workflow" list, it likely has not been deployed yet. Jump back into your Dynamic Workflow and deploy the most recent version and then refresh your New Workflow to see it in the list.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cascade.io/cascade/workflows/dynamic-workflows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
