MCP Server Trigger returns 502 after ~125s while subworkflow completes successfully and is triggered twice
Describe the problem/error/question
Hi everyone,
I am trying to diagnose a reproducible issue with an n8n Cloud MCP Server Trigger and a long-running tool/subworkflow.
Setup:
- n8n Cloud, Starter plan
- n8n version 2.36.5
- MCP Server Trigger using the published Production URL (/mcp/…, not /mcp-test/…)
- Authentication: n8n User Auth (OAuth2)
- Require Workflow Execute Permission: enabled
- External MCP client user-agent shown by n8n: openai-mcp/1.0.0
- The MCP client is a custom MCP app in a ChatGPT Business workspace
- The MCP tool starts another n8n workflow which calls Anthropic Claude Sonnet 5 and returns one text field
The downstream Claude workflow itself completes successfully.
In the first affected run: - the reviewer/subworkflow started at about 08:59:40
- total runtime was 3m 13s
- n8n status was Success
- Claude returned a thinking block and a normal text block
- stop_reason was end_turn
- the following Edit Fields node successfully produced a non-empty result
The Claude configuration was:
Model: claude-sonnet-5
Maximum Number of Tokens: 32768
Simplify Output: off
Usage in that run was approximately:
input_tokens: 2977
output_tokens: 16689
thinking_tokens: 11195
So the Claude call itself did not fail, and the expected text result existed successfully inside n8n.
However, the external MCP caller receives a 502 instead of the completed result.
The timing is very reproducible:
First reviewer starts: 08:59:40
First MCP event: 09:01:45
Difference: ~125 seconds
Immediately afterwards a second reviewer execution starts with the same tool payload:
Second reviewer starts: 09:01:46
Second MCP event: 09:03:51
Difference: ~125 seconds
The two incoming MCP requests have: - the same tool name
- the same payload on the visible field level
- the same request body size
- the same openai-mcp/1.0.0 user-agent
but they have different MCP session IDs and different request/trace identifiers.
So they appear to be two separate external MCP requests, not one n8n execution being displayed twice.
I have also verified that the ChatGPT MCP app is using the published n8n Production URL, not the Test URL.
My current hypothesis, not yet verified, is that there may be a synchronous MCP timeout around 120 seconds:
MCP request starts
→ long-running subworkflow continues
→ MCP request/connection times out after about 120 seconds
→ external caller receives 502
→ n8n subworkflow continues and eventually succeeds
→ another external MCP request arrives and starts another execution
Questions:
- Is there currently a ~120 second timeout for MCP Server Trigger tool calls on n8n Cloud?
- Can a worker/subworkflow continue running after the synchronous MCP request has already timed out?
- Is such a timeout configurable on n8n Cloud?
- Is a second MCP request after such a timeout a known retry/reconnect behavior?
- Does n8n itself ever replay/retry an MCP tool call, or would a new MCP session necessarily originate from the external client?
- Is there a known issue in n8n 2.36.5 involving MCP Server Trigger, long-running tools and 502/timeouts?
- What is the recommended n8n architecture for an MCP tool that may legitimately take 2–4 minutes?
- Is there an n8n-native way to implement idempotency/duplicate protection so that a reconnect or retry cannot execute the same external action twice?
I have stopped further testing for now because the downstream call has real external cost and I need to make sure that one approved tool invocation cannot silently result in two executions.
What is the error message (if any)?
Please share your workflow
I cannot share the full production workflow publicly because it contains internal configuration and confidential payload definitions.
The relevant workflow structure is very small:
MCP Server Trigger
↓ tool call
Execute Workflow Tool: claude_review
↓
Subworkflow:
When Executed by Another Workflow
↓
Anthropic "Message a Model" (claude-sonnet-5)
↓
Edit Fields
The Edit Fields node extracts the Claude text block into one field called:
claude_review
No additional HTTP Request, Code, retry, wait, loop, or response-processing nodes are present in this path.
I can provide a sanitized/minimal reproduction workflow if that is required for diagnosis.
Share the output returned by the last node
The last node of the reviewer subworkflow successfully returns a non-empty field:
{
“claude_review”: “[REDACTED - non-empty Claude review text]”
}
The Claude node immediately before it also shows:
content[0].type = “thinking”
content[1].type = “text”
stop_reason = “end_turn”
So the expected review text exists successfully inside the downstream workflow before the MCP response fails.
In the MCP execution log, however, the tool output visible after the ~125 second interval contains the original query/input structure rather than the completed claude_review result.
Information on your n8n setup
n8n version: 2.36.5
- Database (default: SQLite): n8n Cloud managed / unknown to me
- n8n EXECUTIONS_PROCESS setting (default: own, main): n8n Cloud managed / unknown to me
- Running n8n via: n8n Cloud, Starter plan
- Operating system: n8n Cloud managed / unknown to me