n8n - 💡(How to fix) Fix Streaming intermediate steps from AI Agent are lost in webhook responses [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
n8n-io/n8n#28271Fetched 2026-04-10 03:44:29
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
subscribed ×2commented ×1labeled ×1mentioned ×1

Code Example

User Request via Webhook
Webhook Node (streaming enabled)
AI Agent Node executes and generates:
  - Intermediate Step 1: "Calling search tool..."  
  - Intermediate Step 2: "Search result: [data]"
  - Intermediate Step 3: "Calling database query..."
  - Intermediate Step 4: "Query result: [data]"
  - Final Output: "Based on the search and database query, here's your answer..."
RespondToWebhook Node
Webhook Response  ("Calling search tool...") ("Search result: [data]"S) ("Calling database query...") ("Query result: [data]") (FINAL)

---

User Request via Webhook
Webhook Node (streaming enabled)
AI Agent Node executes and streams intermediate steps:
  - Intermediate Step 1: "Calling search tool..."  
  - Intermediate Step 2: "Search result: [data]"
  - Intermediate Step 3: "Calling database query..."
  - Intermediate Step 4: "Query result: [data]"
  - Final Output: "Based on the search and database query, here's your answer..."
RespondToWebhook Node (forwards all streamed data)
Webhook Response ("Calling search tool...") ("Search result: [data]"S) ("Calling database query...") ("Query result: [data]") (FINAL)
RAW_BUFFERClick to expand / collapse

Bug Description

Problem Description

When using an AI Agent node in a workflow with webhook streaming enabled, only the agent's final output is returned to the webhook client. The intermediate reasoning steps (tool calls, observations, agent thinking process) that the agent generates during execution are lost and not included in the streamed response.

What I'm Trying to Do

I want to build an LLM agent workflow that:

  1. Receives a user request via webhook with streaming enabled
  2. The AI Agent processes the request and calls multiple tools to gather information
  3. During execution, I want the webhook client to receive:
    • ✅ The agent's reasoning process
    • ✅ Each tool call the agent makes (e.g., "Searching for...", "Calling API...")
    • ✅ Results from each tool (observations)
  4. At last the final answer. But at the moment the step 3 doesn't happen.

Why This Matters

This is essential for:

  • User experience: Users see progress as the agent thinks through the problem
  • Transparency: Understanding what the agent is doing step-by-step
  • Real-time feedback: Long-running operations don't appear frozen
  • Server-Sent Events (SSE): Streaming responses pattern that's standard for LLM applications

To Reproduce

Steps to Reproduce

  1. Create a new workflow
  2. Add Webhook trigger with:
    • HTTP Method: POST
    • Response Mode: Streaming ← Key!
  3. Add AI Agent node connected to webhook
    • Enable agent streaming
    • Enable return intermediate steps
  4. Add RespondToWebhook node to return agent response
  5. Deploy and make webhook request with a complex prompt (one that requires multiple tool calls)
  6. Observe webhook response: Only final answer arrives, no intermediate steps in the response stream

Expected behavior

Current Behavior (Broken)

User Request via Webhook
Webhook Node (streaming enabled)
AI Agent Node executes and generates:
  - Intermediate Step 1: "Calling search tool..."  
  - Intermediate Step 2: "Search result: [data]"
  - Intermediate Step 3: "Calling database query..."
  - Intermediate Step 4: "Query result: [data]"
  - Final Output: "Based on the search and database query, here's your answer..."
RespondToWebhook Node
Webhook Response  (❌ "Calling search tool...") (❌ "Search result: [data]"S) (❌"Calling database query...") (❌ "Query result: [data]") (✅ FINAL)

Expected Behavior (What Should Happen)

User Request via Webhook
Webhook Node (streaming enabled)
AI Agent Node executes and streams intermediate steps:
  - Intermediate Step 1: "Calling search tool..."  
  - Intermediate Step 2: "Search result: [data]"
  - Intermediate Step 3: "Calling database query..."
  - Intermediate Step 4: "Query result: [data]"
  - Final Output: "Based on the search and database query, here's your answer..."
RespondToWebhook Node (forwards all streamed data)
Webhook Response (✅ "Calling search tool...") (✅ "Search result: [data]"S) (✅ "Calling database query...") (✅ "Query result: [data]") (✅ FINAL)

Debug Info

Following is a sample streamed response from the AI agent node.

{"type":"begin","metadata":{"nodeId":"b8","nodeName":"AI Agent","itemIndex":0,"runIndex":0,"timestamp":1775757598665}} {"type":"item", "content": "", "metadata":{"nodeId":"b8","nodeName":"AI Agent","itemIndex":0,"runIndex":0,"timestamp":1775757598665}} {"type":"item", "content": "First response chunk", "metadata":{"nodeId":"b8","nodeName":"AI Agent","itemIndex":0,"runIndex":0,"timestamp":1775757598665}} {"type":"item", "content": "Last response chunk", "metadata":{"nodeId":"b8","nodeName":"AI Agent","itemIndex":0,"runIndex":0,"timestamp":1775757598665}} {"type":"end","metadata":{"nodeId":"b8","nodeName":"AI Agent","itemIndex":0,"runIndex":0,"timestamp":1775757598665}}

Operating System

Ubuntu

n8n Version

2.14.2

Node.js Version

24

Database

SQLite (default)

Execution mode

main (default)

Hosting

self hosted

extent analysis

TL;DR

The AI Agent node in n8n workflow is not streaming intermediate steps to the webhook client, only the final output is returned, and a potential fix involves checking the configuration of the RespondToWebhook node to ensure it is properly set up to forward all streamed data from the AI Agent node.

Guidance

  • Verify that the RespondToWebhook node is correctly configured to forward all streamed data from the AI Agent node, including intermediate steps.
  • Check the AI Agent node's settings to ensure that "Enable agent streaming" and "Enable return intermediate steps" are both enabled.
  • Review the workflow's execution logs to confirm that the AI Agent node is generating the expected intermediate steps and that these steps are being lost between the AI Agent node and the RespondToWebhook node.
  • Consider adding additional logging or debugging statements to the workflow to better understand where the intermediate steps are being lost.

Example

No specific code example is provided as the issue seems to be related to the configuration of the n8n workflow rather than a code-level problem. However, ensuring that the RespondToWebhook node is set up to handle streamed responses correctly is crucial. This might involve checking the node's properties or adjusting its settings to properly forward all data received from the AI Agent node.

Notes

The issue might be specific to the version of n8n being used (2.14.2) or the configuration of the workflow. Upgrading n8n to a newer version or seeking support from the n8n community might provide additional insights or solutions.

Recommendation

Apply a workaround by carefully reviewing and adjusting the configuration of the RespondToWebhook node and the AI Agent node to ensure that all streamed data, including intermediate steps, are properly forwarded to the webhook client. This approach is recommended because it directly addresses the observed behavior without requiring changes to the underlying code or infrastructure.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING