Having some gateway errors on longer executions so made a simple 3 node workflow: a webhook, a wait node, and a respond to webhook. The webhook gets a query param of time=Ns. This is used by the wait node. I can increase the wait progressively. When I get to 75s.
What is the error message (if any)?
Not an error message, but the wrong message. It returns
{“message”:“Workflow executed successfully”}
Instead of the correct message defined in the responde to webhook message.
After a certain amount of time the workflow sits in the database to resume at a later time so I suspect the issue you are seeing is related to that process and is to be expected.
I thought it was around 60 seconds that we did that process though so getting to 75 is not bad.
Ok, I tried the code node and waiting for a promise. Runs fine at 55s, it fails at 75s with an 502 error:
502 - Web server received an invalid response while acting as a gateway or proxy server.
There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.
I’m running a reverse proxy on front of n8n, and it’s working for other apps that take longer. So I’m looking at n8n for the root cause. What can I configure to avoid this? It seems a timeout…
The worflow is this one:
On a related note, it was really hard to know the correct syntax to use in the code node to access the input json. Couldn’t figure it out from the docs… and the one I found to work is marked as wrong in the code editor (red underline):
So I run the workflow by accessing N8N’s direct IP address. It run fine with a 3s delay. When I tried a 75s delay, and after a while I got an extensive error message:
{"code":404,"message":"The requested webhook \"d16fc0a6-cbdc-4f8a-9fcc-99042d0f4563\" is not registered.","hint":"Click the 'Execute workflow' button on the canvas, then try again. (In test mode, the webhook only works for one call after you click this button)","stacktrace":"ResponseError: The requested webhook \"d16fc0a6-cbdc-4f8a-9fcc-99042d0f4563\" is not registered.\n at TestWebhooks.getWebhookMethods (/home/ubuntu/.npm-global/lib/node_modules/n8n/src/TestWebhooks.ts:165:10)\n at TestWebhooks.callTestWebhook (/home/ubuntu/.npm-global/lib/node_modules/n8n/src/TestWebhooks.ts:73:32)\n at /home/ubuntu/.npm-global/lib/node_modules/n8n/src/AbstractServer.ts:364:35\n at newFn (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express-async-errors/index.js:16:20)\n at Layer.handle [as handle_request] (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at next (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/route.js:144:13)\n at next (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/route.js:140:7)\n at next (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/route.js:140:7)\n at next (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/route.js:140:7)\n at next (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/route.js:140:7)\n at next (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/route.js:140:7)\n at next (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/route.js:140:7)\n at Route.dispatch (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/route.js:114:3)\n at newFn (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express-async-errors/index.js:16:20)\n at Layer.handle [as handle_request] (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at /home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:284:15\n at param (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:365:14)\n at param (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:376:14)\n at Function.process_params (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:421:3)\n at next (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:280:10)\n at refreshExpiringCookie (/home/ubuntu/.npm-global/lib/node_modules/n8n/src/middlewares/auth.ts:55:2)\n at newFn (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express-async-errors/index.js:16:20)\n at Layer.handle [as handle_request] (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at trim_prefix (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:328:13)\n at /home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:286:9\n at Function.process_params (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:346:12)\n at next (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:280:10)\n at /home/ubuntu/.npm-global/lib/node_modules/n8n/src/middlewares/auth.ts:101:11\n at newFn (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express-async-errors/index.js:16:20)\n at Layer.handle [as handle_request] (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at trim_prefix (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:328:13)\n at /home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:286:9\n at Function.process_params (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:346:12)\n at next (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:280:10)\n at initialize (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/passport/lib/middleware/initialize.js:98:5)\n at newFn (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express-async-errors/index.js:16:20)\n at Layer.handle [as handle_request] (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at trim_prefix (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:328:13)\n at /home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:286:9\n at Function.process_params (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:346:12)\n at next (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:280:10)\n at cookieParser (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/cookie-parser/index.js:46:14)\n at newFn (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express-async-errors/index.js:16:20)\n at Layer.handle [as handle_request] (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at trim_prefix (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:328:13)\n at /home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:286:9\n at Function.process_params (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:346:12)\n at next (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:280:10)\n at /home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/connect-history-api-fallback/lib/index.js:66:16\n at newFn (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express-async-errors/index.js:16:20)\n at Layer.handle [as handle_request] (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at trim_prefix (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:328:13)\n at /home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:286:9\n at Function.process_params (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:346:12)\n at next (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/express/lib/router/index.js:280:10)\n at cookieParser (/home/ubuntu/.npm-global/lib/node_modules/n8n/node_modules/cookie-parser/index.js:71:5)"}
Are you using the execute workflow button? That only runs for a limited amount of time to test, Try making the workflow active and using the production link and see if that changes anything.