mirror of
https://github.com/n8n-io/n8n-docs.git
synced 2025-11-20 17:48:34 +00:00
Doc 1279 execute workflow (#2817)
This commit is contained in:
parent
90e4c1fa41
commit
a8fd1e2d1a
@ -1,4 +1,4 @@
|
||||
As an example, imagine you have an Execute Workflow node in **Workflow A**. The Execute Workflow node calls another workflow called **Workflow B**:
|
||||
As an example, imagine you have an Execute Sub-workflow node in **Workflow A**. The Execute Sub-workflow node calls another workflow called **Workflow B**:
|
||||
|
||||
1. The Execute Workflow node passes the data to the Execute Workflow Trigger node of **Workflow B**.
|
||||
2. The last node of **Workflow B** sends the data back to the Execute Workflow node in **Workflow A**.
|
||||
1. The Execute Sub-workflow node passes the data to the Execute Sub-workflow Trigger node (titled "When executed by another node" in the canvas) of **Workflow B**.
|
||||
2. The last node of **Workflow B** sends the data back to the Execute Sub-workflow node in **Workflow A**.
|
||||
|
||||
@ -4,13 +4,13 @@
|
||||
1. Create a new workflow.
|
||||
|
||||
/// note | Create sub-workflows from existing workflows
|
||||
You can optionally create a sub-workflow directly from an existing parent workflow using the [Execute Workflow](/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow/) node. In the node, select the **Database** and **From list** options and select **Create a sub-workflow** in the list.
|
||||
You can optionally create a sub-workflow directly from an existing parent workflow using the [Execute Sub-workflow](/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow/) node. In the node, select the **Database** and **From list** options and select **Create a sub-workflow** in the list.
|
||||
///
|
||||
|
||||
1. **Optional**: configure which workflows can call the sub-workflow:
|
||||
1. Select the **Options** <span class="inline-image">{.off-glb}</span> menu > **Settings**. n8n opens the **Workflow settings** modal.
|
||||
1. Change the **This workflow can be called by** setting. Refer to [Workflow settings](/workflows/settings/) for more information on configuring your workflows.
|
||||
1. Add the **Execute Workflow Trigger** node.
|
||||
1. Add the **Execute Sub-workflow** trigger node (if you are searching under trigger nodes, this is also titled **When Executed by Another Workflow**).
|
||||
1. Set the **Input data mode** to choose how you will define the sub-workflow's input data:
|
||||
* **Define using fields below**: Choose this mode to define individual input names and data types that the calling workflow needs to provide.
|
||||
* **Define using JSON example**: Choose this mode to provide an example JSON object that demonstrates the expected input items and their types.
|
||||
@ -26,7 +26,7 @@ This requires the ability to [load data from previous executions](/workflows/exe
|
||||
|
||||
If you want to load data into your sub-workflow to use while building it:
|
||||
|
||||
1. Create the sub-workflow and add the **Execute Workflow Trigger**.
|
||||
1. Create the sub-workflow and add the **Execute Sub-workflow Trigger**.
|
||||
1. Set the node's **Input data mode** to **Accept all data** or define the input items using fields or JSON if they're already known.
|
||||
1. In the sub-workflow [settings](/workflows/settings/), set **Save successful production executions** to **Save**.
|
||||
1. Skip ahead to setting up the parent workflow, and run it.
|
||||
@ -40,8 +40,8 @@ You can now pin example data in the trigger node, enabling you to work with real
|
||||
### Call the sub-workflow
|
||||
|
||||
1. Open the workflow where you want to call the sub-workflow.
|
||||
1. Add the **Execute Workflow** node.
|
||||
1. In the **Execute Workflow** node, set the sub-workflow you want to call. You can choose to call the workflow by ID, load a workflow from a local file, add workflow JSON as a parameter in the node, or target a workflow by URL.
|
||||
1. Add the **Execute Sub-workflow** node.
|
||||
1. In the **Execute Sub-workflow** node, set the sub-workflow you want to call. You can choose to call the workflow by ID, load a workflow from a local file, add workflow JSON as a parameter in the node, or target a workflow by URL.
|
||||
|
||||
/// note | Find your workflow ID
|
||||
Your sub-workflow's ID is the alphanumeric string at the end of its URL.
|
||||
@ -52,4 +52,4 @@ You can now pin example data in the trigger node, enabling you to work with real
|
||||
|
||||
When your workflow executes, it will send data to the sub-workflow, and run it.
|
||||
|
||||
You can follow the execution flow from the parent workflow to the sub-workflow by opening the Execute Workflow node and selecting the **View sub-execution** link. Likewise, the sub-workflow's execution contains a link back to the parent workflow's execution to navigate in the other direction.
|
||||
You can follow the execution flow from the parent workflow to the sub-workflow by opening the Execute Sub-workflow node and selecting the **View sub-execution** link. Likewise, the sub-workflow's execution contains a link back to the parent workflow's execution to navigate in the other direction.
|
||||
|
||||
@ -3,6 +3,6 @@ Set values to pass to the workflow you're calling.
|
||||
These values appear in the output data of the trigger node in the workflow you call. You can access these values in expressions in the workflow. For example, if you have:
|
||||
|
||||
* **Workflow Values** with a **Name** of `myCustomValue`
|
||||
* A workflow with an Execute Workflow Trigger node as its trigger
|
||||
* A workflow with an Execute Sub-workflow Trigger node as its trigger
|
||||
|
||||
The expression to access the value of `myCustomValue` is `{{ $('Execute Workflow Trigger').item.json.myCustomValue }}`.
|
||||
The expression to access the value of `myCustomValue` is `{{ $('Execute Sub-workflow Trigger').item.json.myCustomValue }}`.
|
||||
|
||||
@ -45,7 +45,7 @@ Access these settings by selecting the three dots in the upper right corner of t
|
||||
In the **Workflow Settings** window you can configure the following settings:
|
||||
|
||||
- [**Error Workflow**](/flow-logic/error-handling/): A workflow to run in case the execution of the current workflow fails.
|
||||
- **This workflow can be called by**: Workflows that are allowed to call this workflow using the [Execute Workflow node](/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow/).
|
||||
- **This workflow can be called by**: Workflows that are allowed to call this workflow using the [Execute Sub-workflow node](/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow/).
|
||||
- **Timezone**: The timezone to use in the current workflow. If not set, the global timezone (by default "New York") is used. This setting is particularly important for the [Schedule Trigger node](/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/), as you want to make sure that the workflow gets executed at the right time.
|
||||
- **Save failed production executions**: If the Execution data of the workflow should be saved when it fails. Default is to save.
|
||||
- **Save successful production executions**: If the Execution data of the workflow should be saved when it succeeds. Default is to save.
|
||||
|
||||
@ -6,7 +6,7 @@ description: Call workflows from other workflows, and split large workflows into
|
||||
|
||||
# Sub-workflows
|
||||
|
||||
You can call one workflow from another workflow. This allows you to build modular, microservice-like workflows. It can also help if your workflow grows large enough to encounter [memory issues](/hosting/scaling/memory-errors/). Creating sub-workflows uses the [Execute Workflow](/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow/) and [Execute Workflow Trigger](/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflowtrigger/) nodes.
|
||||
You can call one workflow from another workflow. This allows you to build modular, microservice-like workflows. It can also help if your workflow grows large enough to encounter [memory issues](/hosting/scaling/memory-errors/). Creating sub-workflows uses the [Execute Workflow](/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow/) and [Execute Sub-workflow Trigger](/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflowtrigger/) nodes.
|
||||
|
||||
## Set up and use a sub-workflow
|
||||
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
---
|
||||
#https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
|
||||
title: Execute Workflow
|
||||
description: Documentation for the Execute Workflow node in n8n, a workflow automation platform. Includes guidance on usage, and links to examples.
|
||||
title: Execute Sub-workflow
|
||||
description: Documentation for the Execute Sub-workflow node in n8n, a workflow automation platform. Includes guidance on usage, and links to examples.
|
||||
contentType: [integration, reference]
|
||||
priority: high
|
||||
---
|
||||
|
||||
# Execute Workflow
|
||||
# Execute Sub-workflow
|
||||
|
||||
Use the Execute Workflow node to run a different workflow on the host machine that runs n8n.
|
||||
Use the Execute Sub-workflow node to run a different workflow on the host machine that runs n8n.
|
||||
|
||||
## Node parameters
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
---
|
||||
#https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
|
||||
title: Execute Workflow Trigger node documentation
|
||||
description: Learn how to use the Execute Workflow Trigger node in n8n. Follow technical documentation to integrate Execute Workflow Trigger node into your workflows.
|
||||
title: Execute Sub-workflow Trigger node documentation
|
||||
description: Learn how to use the Execute Sub-workflow Trigger node in n8n. Follow technical documentation to integrate Execute Sub-workflow Trigger node into your workflows.
|
||||
contentType: [integration, reference]
|
||||
priority: high
|
||||
---
|
||||
|
||||
# Execute Workflow Trigger node
|
||||
# Execute Sub-workflow Trigger node
|
||||
|
||||
Use this node to start a workflow in response to another workflow. It should be the first node in the workflow.
|
||||
|
||||
|
||||
@ -389,7 +389,7 @@ nav:
|
||||
- Execute Command: integrations/builtin/core-nodes/n8n-nodes-base.executecommand/index.md
|
||||
- Common issues: integrations/builtin/core-nodes/n8n-nodes-base.executecommand/common-issues.md
|
||||
- integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow.md
|
||||
- Execute Workflow Trigger: integrations/builtin/core-nodes/n8n-nodes-base.executeworkflowtrigger.md
|
||||
- Execute Sub-workflow Trigger: integrations/builtin/core-nodes/n8n-nodes-base.executeworkflowtrigger.md
|
||||
- integrations/builtin/core-nodes/n8n-nodes-base.executiondata.md
|
||||
- integrations/builtin/core-nodes/n8n-nodes-base.extractfromfile.md
|
||||
- integrations/builtin/core-nodes/n8n-nodes-base.filter.md
|
||||
|
||||
Loading…
Reference in New Issue
Block a user