# Invoke Workflow

Runs another workflow in the project and waits for it to finish. If the invoked workflow throws an error, the error is passed on to this activity.


---

### :arrow_left:**INPUT**

| **Parameter** | **Type** | **Required** | **Description** |
|-----------|------|----------|-------------|
| `WorkflowFileName` | `String` | ✅ Yes    | The path of the workflow to invoke within the project: the folder names and the workflow name, separated by `\` or `/` (e.g. `Folder\Workflow`). Names are case-sensitive. If the workflow is not found, the activity throws an error. |
| `Arguments` | `Dictionary<String, Argument>` | ❌ No     | The values to pass to the arguments of the invoked workflow and the variables to write the returned values to. Set with the **Map Variables** button. If empty, variables are passed by name (see Usage). |


---

### Usage

* On the canvas there are the **Workflow Path** field and the **Map Variables** and **Open Workflow** buttons.
* If **Workflow Path** is a fixed text and does not exist in the project, the designer shows a validation error. A path given with a variable is checked at run time.
* **Map Variables** lists the arguments of the invoked workflow: it adds new arguments, removes those that are no longer in the workflow, and updates those whose type or direction has changed. In the window that opens, enter the values to pass to `In` and `InOut` arguments, and the variables to write the values of `Out` and `InOut` arguments to.
* **Open Workflow** opens the invoked workflow in the designer.

**Passing values**

* If `Arguments` is set, the values of `In` and `InOut` arguments are passed to the invoked workflow. When the workflow finishes, the values of `Out` and `InOut` arguments are written to the bound variables; an argument that returns no value gets the default value of its type.
* If `Arguments` is empty, the values of all variables in the invoking workflow are passed by name. When the workflow finishes, the returned values are written to the variables with the same name.

**Execution**

* If the invoked workflow is already running, the warning "The workflow is already in progress and cannot be invoked." is shown and the activity throws an error.
* When running in PAW Studio, if the invoked workflow is not open, it is opened in a tab in the background; step-by-step execution continues in the invoked workflow as well.