Sub-workflow
Category: Logic
Executes another automation as a sub-flow within the current automation. Use this to reuse common sequences across multiple automations without duplicating them.
When to use
- Reuse a common "security check" sequence across multiple automations
- Break a complex automation into smaller, testable pieces
- Call a shared "notification routine" from multiple triggers
- Implement modular automation patterns
Configuration
- Automation ID — The ID of the automation to execute as a sub-flow. You can find this ID in the automation's detail view.
Output data
{{ nodes['<id>'].data.response }}— The sub-automation's result (final variables){{ nodes['<id>'].data.scriptId }}— The automation ID that was called
Examples
Reusable "lock all doors" sub-flow:
- Create an automation "Lock All Doors" that sets all door locks to locked
- In your main automation:
- Schedule → 22:00
- Sub-workflow → "Lock All Doors"
- Notify → "All doors locked for the night"
Modular security check:
- Sub-workflow → "Check All Sensors" (returns
{ allClear: true/false }) - IF →
nodes.sub1.data.response.allClear == true - True → Set Device → arm security system
- False → Notify → "Cannot arm — a sensor is open"
Tips
- The sub-automation runs in its own execution context — it doesn't share variables with the parent
- Sub-automations can call other sub-automations (nested), but avoid circular references
- Test sub-automations independently before using them in a parent flow
- The parent automation waits for the sub-automation to complete before continuing