Question: - In terms of performance, is it any difference having multiple webhooks inside the same workflow, compared to having each webhook in a separated N8N workflow?
We have a workflow which contains multiple webhooks, each webhook have their own endpoint/logic and they don’t depend on each other, despite they are in the same workflow document.
This has been made this way for practical reasons (having all the webhooks on the same workflow document has made the work easier).
This workflow is soon to be launched to production, and these webhooks will receive a considerable amount of requests/load, the question is: is it any difference between having 30 webhooks in 1 workflow, vs. having 30 webhooks in 30 different workflows (1 webhook = 1 workflow)?
I have never thought to check, in theory it would only the bit of the workflow it needs to but it would need to load the entire workflow to run it so I suspect separate workflows would be better but I don’t think there would be much in it.
Personally purely for a debugging / maintenance view I keep most of my mine split up apart from ones where I have a few webhook nodes to display html content.
I would say though not all environments are equal and there are many factors to think about so I would suggest setting up a test environment as well and testing both options to see what works best for you.
I’ve seen some funky stuff posted on the community though. Where multiple triggers in a workflow could cause some issues.
Not sure how those were caused, but splitting the workflows did fix them.
So I would personally never use 30 triggers(webhooks) in one workflow.
But if it works it works. And should idd not be too bad on the performance side.
Now totally ignoring all the reasons (as mentioned above) why it is probably not a good idea to have 30 webhooks in one workflow and just answering the question about performance:
Without having tested it, just thinking about the code. Can not think of a reason why one should be much faster or slower than the other. There is probably a minimal advantage for the separate ones, as the workflow is then generally smaller, and can so be loaded faster. But can not imagine that it would make a huge difference, more in ms range.
Hey guys thank you all for your kind suggestions and clear explanations.
As you suggested, at the end of the day having all the webooks in separated worflows could improve performance (at least a little) but mainly it could prevent issues and it can help to debug and track executions more precisely by “distributing” them.
What did you end up doing for this? I have a workflow that if done combined would need 9 webhooks in it, but after reading this I’m thinking it may not be the best. Just wanted to see if you had any feedback on it. Thanks in advance!
@jhambach I ended up using multiple workflows (one for each webook), for performance reasons and mainly because it is much more clear to track executions. If you want to quickly see which webhook has been executed specifically, you can see the workflow name in the executions list. In other case, if you have all the webhooks inside the same workflow, you would see always the same workflow name in the executions list, no matter which webhook has been executed… making a bit tricky or annoying to see which one has been executed, as you would need to open each execution just to see which webhook has been called.