Q&A
i have a main workflow thats getting really long and complex (about 30 nodes). want to break it into smaller workflows that call each other
like: main workflow handles the form submission and basic validation, then triggers a "process order" sub-workflow, then triggers a "send notifications" sub-workflow
is there a way to call another workflow from within a workflow? or do i need to use a webhook as a bridge between them?
also wondering if the sub-workflow gets the data from the parent workflow or do i need to pass it explicitly
you can use the "execute workflow" node to call another workflow and pass data to it. the sub-workflow receives whatever data you send as its trigger payload
this is great for:
- breaking up complex flows into logical pieces
- reusing common patterns (like notification sending) across multiple workflows
- keeping each workflow focused and easy to understand
we have a "send notification" sub-workflow that gets called by 6 different parent workflows
exactly what i was looking for. the reusability aspect is huge. instead of duplicating notification logic in every workflow we can maintain it in one place
one thing to note: errors in sub-workflows propagate up to the parent. so if the sub-workflow fails the parent catches the error and you can handle it there. nice for centralized error handling
oh sweet i didnt know you could chain workflows. this changes everything