Make my executions DRY (Don't Repeat Yourself)

I want to reuse parts of my other executions as “starting blocks” for other workflows

The problem is that there are 3 types of Workflow Trigger node and it’s not clear which ones should be used where?

i.e.

  • Do I let the first section of the workflow run to completion then append one of the Workflow nodes at the end?
  • Do I then have to put another Workflow node at the start of the second Workflow that continues once the first workflow has completed and has passed the data to it?

In which case, which Workflow nodes go where?

Information on your n8n setup

  • n8n version: latest
  • Running n8n via (n8n cloud):
  • Operating system: Mac M1

Hi @hdotking :wave:

Let’s say you have two workflows - A and B. A is a larger workflow has the Execute Workflow node to call on another workflow, and B has the Execute Workflow trigger.

The execute workflow node allows you to call Workflow B from Workflow A, at any point in Workflow A’s execution. You can read more about that here: Execute Workflow | n8n Docs When Workflow A hits the Execute Workflow node, it’ll send data over to Workflow B.

Workflow B would need the Execute Workflow trigger at the start of its workflow. This would then run through Workflow B and the last node of Workflow B sends the data back to the Execute Workflow node in Workflow A, and then continue on with any additional nodes Workflow A might have.

You can learn more about triggers vs action nodes here: Built-in integrations | n8n Docs
Let me know if that helps!

This sounds great. I think I’ve understood this correctly. Is the following correct?

Say:

  • Workflow X is a Google Calendar Trigger for received events for User X
  • Workflow Y is a Google Calendar Trigger for received events for User Y
  • Workflow Z is some large workflow that does some work after receiving a calendar event

I can use the execute workflow node IN Workflow X and Workflow Y to call the same Workflow Z.

Will there be any problems with Workflow X and Workflow Y with regard to concurrency or a race conditions if both User X and User Y receive a notification at the same time?

How are they queued?

Hi @hdotking :wave: You got it :slight_smile: In the case of using Workflow Z as per your example, it would depend. There could be an issue though if that workflow was called at the same time for the same event.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.