Skip to main content
This lesson explains how to use the Execute Workflow (sub-workflow) node to break a large n8n workflow into smaller, independently testable segments. Splitting complex workflows into a main workflow and one or more sub-workflows improves observability, simplifies error handling, and speeds up iteration by keeping unrelated concerns separated. For illustration, we use an image-to-video pipeline that originally had two distinct triggers on the same canvas. Mixing triggers and heavy processing in one canvas can make debugging harder: an error may require inspecting nodes across multiple logical areas. Moving the processing into a sub-workflow isolates responsibilities and makes the main workflow focused on triggers and user interaction.
This image shows a workflow editor interface for creating automated processes, including triggers and actions using services like Telegram and Google Drive. The workflow includes elements to send messages, log data, and execute HTTP requests.
Main workflow (entry point)
  • Trigger: Google Drive — fires when a photo is uploaded.
  • User interaction: sends a Telegram message with the photo and asks for a prompt or ideas to generate a video from the image.
  • Logging: writes the image URL and metadata to a Google Sheet for auditability.
A sample Telegram prompt might look like:
/start 12:12 PM
Why use an Execute Workflow node
  • Decouples user-facing steps (triggers, prompts, logging) from heavy processing (image-to-video conversion).
  • Lets you run the same processing pipeline from multiple triggers by reusing the sub-workflow.
  • Enables independent testing, retry policies, and logging per sub-workflow.
How it works in n8n
  1. Add an Execute Workflow node to the main workflow where you want to hand off processing.
  2. From the Execute Workflow node’s dropdown, select the target sub-workflow (for example, Subworkflow Demo).
  3. Configure whether to pass the current item(s) or transform the data before the call.
  4. When the main workflow reaches the Execute Workflow node, it invokes the sub-workflow and passes the input items to it.
In this example a separate workflow named “Subworkflow Demo” was created — essentially a copy of the processing portion of the original image-to-video flow — so it can be edited, tested, and monitored independently.
The image shows a workflow interface from a platform called n8n, with one side displaying the settings for executing a workflow and the other side showing a visual representation of a "Subworkflow Demo" with various connected nodes.
Using sub-workflows improves observability and isolation: you can enable separate logging, retries, and error handling policies per sub-workflow. It also makes it easier to reuse common processing pipelines across multiple triggers.
Benefits at a glance
Improvement areaWhy it helpsExample
IsolationKeeps failures and retries scoped to processing logicRun retries in the sub-workflow without re-triggering notifications
ReusabilityCall the same processing pipeline from multiple triggersImage-to-video conversion used by Drive upload and an API trigger
ObservabilitySeparate logs and execution history per workflowEasier to monitor long-running or resource-heavy tasks
Faster iterationEdit and test sub-workflow without modifying main workflowDeploy new ML models or conversion steps independently
Quick step-by-step: adding and configuring the Execute Workflow node
  1. Open the main workflow (the entry-point canvas with the Google Drive trigger).
  2. Add an Execute Workflow node where processing should begin.
  3. In the node settings, choose the sub-workflow (Subworkflow Demo) from the dropdown.
  4. Configure input mapping: choose “Pass input data” or map fields explicitly.
  5. Optionally set “Wait for Workflow” depending on whether you need synchronous results.
  6. Save and activate both workflows. Test the end-to-end flow by uploading an image to the Drive trigger.
Best practices
  • Keep the main workflow focused on triggers, notifications, and logging.
  • Put long-running or retry-prone operations in sub-workflows and enable appropriate timeout and retry policies there.
  • Reuse sub-workflows when multiple triggers require the same processing steps.
  • Use clear naming (e.g., process-image-to-video) for sub-workflows to make their purpose obvious in the Execute Workflow dropdown.
Summary — architecture improvements
  • Triggers and user interaction remain in the main workflow (Google Drive trigger, Telegram prompt, Google Sheet logging).
  • Processing-heavy or reusable logic moves to sub-workflows for independent development and monitoring.
  • The Execute Workflow node calls the selected sub-workflow and forwards input items so the sub-workflow can continue processing.
Next steps
  • Edit the “Subworkflow Demo” to implement the full image-to-video conversion steps (e.g., add model calls, transcoding, storage).
  • Add retry logic, error handling, and monitoring to the sub-workflow so failures don’t affect the main trigger or user-facing nodes.
  • Consider adding versioning or change logs for sub-workflows you reuse across workflows.
Links and references

Watch Video