4️⃣

4. Subworkflows

Sub-workflows improve workflow efficiency by allowing reuse across multiple tasks and simplifying maintenance.

Understanding Subworkflows: Improving Workflow Efficiency and Scalability

🔍 In the fourth video of the advanced course, we looked at the concept of sub-workflows, their application cases, and practical tips for implementation .
⚙ It is important to maintain a consistent format for key names or embedded JSON structures, as mismatching case sensitivities can cause errors in the workflow .
🔗 Since the output data of the last node of the workflow is used as input to the workflow execution node, it is essential to know the value of the key associated with the final node .
📊 Sub-workflows allow you to streamline processes across multiple workflows by extracting a set of commonly used tasks, such as data enrichment or database querying .
💡 Creating sub-workflows simplifies maintenance by automatically updating complex tasks in all workflows that utilize them with just one update.
📋 When setting up sub-workflows, it's a good idea to standardize fields and provide clear documentation so others can easily use them .
🔄 Workflow execution nodes allow you to seamlessly integrate one workflow into another, improving scalability and accelerating workflow construction.
✅ Ultimately, sub-workflows are a powerful tool for improving the efficiency and consistency of workflow management , allowing you to perform repetitive tasks without duplication.
LiveWiki, the key content on YouTube in 10 seconds! - https://livewiki.com/ko/content/n8n-advanced-course-subworkflows
In this video, we'll cover the concept of **Sub Workflows** and how you can use them to make your workflows more scalable.
Sub-workflow : One workflow can call another workflow and run them back-to-back, or separate specific parts of a workflow into separate workflows.
Example: The part that retrieves a user from the database can be replaced with a sub-workflow.
Sub-workflows are invoked using the Execute Workflow node.
Receive input data and return the output data from the last node of the sub-workflow to the original workflow.
Sub-workflows allow you to extract and reuse frequently used tasks across multiple workflows.
This simplifies complex tasks and makes maintenance much easier.
Things to keep in mind when using sub-workflows:
1.
Input data format needs to be standardized. Case inconsistencies can cause errors.
2.
You need to be careful about what data comes out of the last node .
Example: A workflow that receives webhook data, looks up the ID or email in Google Sheets, and returns an error if it is not found.
This query functionality can be extracted into a sub-workflow.
Cut out the existing node group and replace it with an Execute Workflow node.
Create a new workflow, paste the node into it, and start it with Execute Workflow Trigger .
04:58 – 05:54:
When setting up a sub-workflow, it is important to clearly set the last node.
Copy the workflow ID and insert it from the original workflow to the sub-workflow.
05:54 – 06:49:
Verify that the sub-workflow is working properly and returning the same output data.
When using sub-workflows, we need to add field standardization and documentation to make them easier to use.
06:49 – End:
This video covers how to use sub-workflows and what to watch out for.
In the next video, we'll cover an advanced error handling workflow .