n8n - 💡(How to fix) Fix [Bug] DeepSeek AI Agent node fails with 400 "Missing reasoning_content" when using tools with thinking mode (deepseek-v4-flash) [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#29119Fetched 2026-04-25 06:21:43
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
subscribed ×2commented ×1labeled ×1mentioned ×1

Error Message

  1. Observe the error: Bad request - please check your parameters. The reasoning_content in the thinking mode must be passed back to the API.
  • error: all
RAW_BUFFERClick to expand / collapse

Bug Description

The n8n DeepSeek Chat Model node does not preserve and resend the reasoning_content field in assistant messages during multi-turn tool calls when thinking mode is active.

Since DeepSeek V3.2 (December 2025) and now with the newly released DeepSeek V4 (April 24, 2026), models with thinking mode enabled require that every assistant message containing tool_calls must include the reasoning_content field when resent to the API in subsequent requests. The n8n AI Agent node strips this field, causing the DeepSeek API to respond with HTTP 400: "The reasoning_content in the thinking mode must be passed back to the API."

This affects any workflow using an AI Agent node with DeepSeek models that have thinking enabled — including deepseek-v4-flash (which is now the default routing for both deepseek-chat and deepseek-reasoner).

To Reproduce

  1. Create an AI Agent node in n8n
  2. Set the chat model to DeepSeek with model deepseek-v4-flash (or deepseek-chat / deepseek-reasoner)
  3. Attach at least one tool to the agent (e.g., a sub-workflow or HTTP tool)
  4. Send a prompt that requires tool use
  5. Observe the error: Bad request - please check your parameters. The reasoning_content in the thinking mode must be passed back to the API.

Expected behavior

When the AI Agent receives a response from DeepSeek that includes both tool_calls and reasoning_content, it should preserve the reasoning_content field in the assistant message and include it in the next API request — as required by DeepSeek's thinking mode specification for tool calls.

Reference: https://api-docs.deepseek.com/guides/thinking_mode

Debug Info

Debug info

core

  • n8nVersion: 2.18.0
  • platform: docker (self-hosted)
  • nodeJsVersion: 24.14.1
  • nodeEnv: production
  • database: postgres
  • executionMode: scaling (single-main)
  • concurrency: -1
  • license: enterprise (production)
  • consumerId: c71ec3e3-1f56-4fc2-bb98-843360f0e582

storage

  • success: none
  • error: all
  • progress: true
  • manual: true
  • binaryMode: database

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/147.0.0.0 safari/537.36 edg/147.0.0.0
  • isTouchDevice: false

Generated at: 2026-04-24T19:14:53.259Z

Operating System

MacOS Tahoe 26.4

n8n Version

2.18.0

Node.js Version

24.14.1

Database

PostgreSQL

Execution mode

main (default)

Hosting

self hosted

extent analysis

TL;DR

The n8n AI Agent node needs to preserve and resend the reasoning_content field in assistant messages during multi-turn tool calls when thinking mode is active to fix the HTTP 400 error.

Guidance

  • Verify that the reasoning_content field is being stripped by the n8n AI Agent node by checking the request payload sent to the DeepSeek API.
  • Check the n8n AI Agent node configuration to see if there are any settings that can be adjusted to preserve the reasoning_content field.
  • Consider modifying the n8n AI Agent node to include the reasoning_content field in the request payload when thinking mode is active.
  • Review the DeepSeek API documentation to ensure that the reasoning_content field is being formatted correctly.

Example

No code snippet is provided as the issue does not specify the exact code changes required.

Notes

The issue is specific to the n8n AI Agent node and DeepSeek API, and the solution may require modifications to the node or the API request payload. The reasoning_content field is required by the DeepSeek API when thinking mode is active, and preserving this field should resolve the HTTP 400 error.

Recommendation

Apply a workaround to preserve the reasoning_content field in the n8n AI Agent node, as the issue is specific to the node's behavior and not a version-specific bug that can be fixed by upgrading.

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…

FAQ

Expected behavior

When the AI Agent receives a response from DeepSeek that includes both tool_calls and reasoning_content, it should preserve the reasoning_content field in the assistant message and include it in the next API request — as required by DeepSeek's thinking mode specification for tool calls.

Reference: https://api-docs.deepseek.com/guides/thinking_mode

Still need to ship something?

×6

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

Back to top recommendations

TRENDING