Describe the problem/error/question
Every time an Agent makes a LLM query that last more than 4 minutes (exactly) it crashes with this error message:
Problem in node ‘AI Agent1‘
Gateway timed out - perhaps try again later?
I know a similar problem was supposed to be solved. But I am running version 2.5.0 and still have the problem.
What is the error message (if any)?
Here is the error log:
{
“errorMessage”: “Gateway timed out - perhaps try again later?”,
“errorDescription”: “504 stream timeout”,
“errorDetails”: {
“rawErrorMessage”: [
“504 stream timeout”
]
},
“n8nDetails”: {
“nodeName”: “AI Agent1”,
“nodeType”: “@n8n/n8n-nodes-langchain.agent”,
“nodeVersion”: 3.1,
“time”: “1/26/2026, 2:32:50 PM”,
“n8nVersion”: “2.5.0 (Self Hosted)”,
“binaryDataMode”: “filesystem”,
“stackTrace”: [
“NodeOperationError: Gateway timed out - perhaps try again later?”,
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_5e964642f84eebe7ab5946b9e3444692/node_modules/@n8n/n8n-nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/executeBatch.ts:95:11",
" at Array.forEach ()“,
" at executeBatch (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_5e964642f84eebe7ab5946b9e3444692/node_modules/@n8n/n8n-nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/executeBatch.ts:84:15)”,
" at processTicksAndRejections (node:internal/process/task_queues:105:5)“,
" at ExecuteContext.toolsAgentExecute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_5e964642f84eebe7ab5946b9e3444692/node_modules/@n8n/n8n-nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/V3/execute.ts:46:66)”,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_5e964642f84eebe7ab5946b9e3444692/node_modules/@n8n/n8n-nodes-langchain/nodes/agents/Agent/V3/AgentV3.node.ts:139:10)“,
" at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1046:8)”,
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1227:11)“,
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1659:27”,
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2301:11"
]
}
}
Please share your workflow
Any AI Agent that call my LLM with a prompt and an output big enough to last more than 4 minutes leads to the problem. The endpoint I call is LiteLLM. However when walling it from my machine with basic python code I do not have any timeout issue.
Information on your n8n setup
- n8n version: 2.5.0
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): local docker
- Operating system: WSL/Windows