I am running a few workflows and would like to use the wait node to execute a few functions.
1, Wait for a specific amount of time eg, 5 hours, before it can trigger
2, Wait for a specific webhook to happen before it can start.
The documentation has some explanation on this but does not quite explain it. My main question is,
How can I make my workflow wait for more than 70 seconds ie hours or days, and also e able to wait until a webhook is called.
This is a useful one, especially if you are looking into doing some sequences that rely on specific workflow events that cannot be handled by the triggers or schedule node.
The wait can wait as long as you want.
Above a certain amount of time it saves the execution time to the database and then runs when it hits that time, so you could theoretically have a workflow wait for a year or more, though there would definitely be more practical ways to handle that.
See this workflow below on how to delay until a webhook is called.
I show it being emailed but you would likely send it over an http call or an execute workflow node. Once that url is called the workflow will resume.
If you click in the wait node you’ll also see there is a limit time. I set it to run in 24 hours whether or not the url was called.
If I have several workflows on one canvas that get triggered via webhooks ie if I have two webhook triggers, how do we identify which {{ $execution.resumeUrl }} to use?
There is not a way to identify which to use as the resume webhook works by execution for every resume on webhook node in the workflow.
The resume webhook is simply follows the syntax below:
https://{{ yourN8nUrl.com }}/webhook-waiting/{{ execution ID }}
So even if you have two wait nodes in a row like this:
The same link will resume both, but not both at once. the “Wait 1” node and “Wait 2” node will each need their own webhook call to resume, but using the same link.
Simply put, it doesn’t matter because it will always have the same resume link regardless of where in the workflow and all wait nodes share the same resume link