Calling a subworkflow from the same page

I’ve come across systems that have an agent with a “Call n8n Workflow Tool” but then there’s a “When Executed by Another Workflow” node on the same page. Here’s an example

I know how to create a completely new workflow, and link it that way, but I can’t find any tutorials, or descriptions of the process of setting up and calling a subworkflow from within a parent workflow.

Thank you.

1 Like

@Motionharvest

The image that you show isnt actually using the workflow below. The builder selected the sub workflow nodes, and pasted them into the call workflow node. The builder just keeps the original nodes there for reference.

All you need to do is add an execute workflow node and connect it to the nodes that you want to run. Select all of the nodes, copy them, and paste them into the tool as json.

:heart:If this response helped you, please click the heart to show that it is useful
:white_check_mark:If this response solved your issue, mark it as the solution to help the community

Here’s an example.

1 Like

Let me make sure I understand this. Selecting nodes and copying them puts the JSON version of them on your clipboard. Then inside the Call n8n Workflow Tool you set “Source” to “Define Below” and then paste the JSON into the “Workflow JSON” field?

1 Like

@Motionharvest

Thats it!

:white_check_mark:If the response above solved your issue, please mark it as the solution to help the community

I found an alternate option. If your workflow starts with a trigger other than “When executed by another workflow”, then you can create one, and for the “subworkflow” choose “By ID” and use the ID of your current workflow.


It looks for the trigger in the workflow with the id you submit. it can even be the same one you’re in.

1 Like

@Motionharvest

That can work, but most of what I see others doing is with json. Workflows get complex, and often need multiple sub workflows.

Make sure to mark an answer as the solution so others can beninifit once this chat is closed :slight_smile: