No the latency has less to do with the database more with n8n starting every workflow by default in a new process. This takes very long time. You can however simply tell it to start them in the main process by setting the environment variable EXECUTIONS_PROCESS=main. As soon as you do that it will be blazing fast.
if we have several processes to deal with it will get really slow especially the GUI I think !
we can just send a response immediately before calling this line of code
response = await this.activeWorkflowRunner.executeWebhook(‘POST’, requestUrl, req, res);
or we cache webhook config somewhere and use them directely from memory
In the past it did cache the config in memory, that got however changed a while ago and will in the next week totally be served from a database with no information in memory anymore. It is maybe a bit slower but will make them stateless and so will scale easily. With the new design people can simply start multiple n8n instances, put a load-balancer in front of them and everything will scale horizontally.
do we need to know ? because its just a webhook, as soon as we receive we can send immidiate response like this
ResponseHelper.sendSuccessResponse(res, “Event Recieved”, true, 200);
if we go to search for response it will become and API not a webhook,