n8n - 💡(How to fix) Fix DeepSeek v4-flash tool calling fails in AI Agent with 400: reasoning_content must be passed back [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#29661Fetched 2026-05-05 06:03:18
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
commented ×1labeled ×1mentioned ×1subscribed ×1

Error Message

When using the n8n AI Agent node with the DeepSeek Chat Model node and model deepseek-v4-flash, tool calling fails with a 400 Bad Request error: 7. n8n returns a DeepSeek API error.

  • error: all

Root Cause

There is already a related issue/PR for deepseek-reasoner, but this now affects deepseek-v4-flash as well because DeepSeek V4 thinking mode is enabled by default and deepseek-chat is no longer a reliable workaround for some users/accounts.

Fix Action

Fix / Workaround

There is already a related issue/PR for deepseek-reasoner, but this now affects deepseek-v4-flash as well because DeepSeek V4 thinking mode is enabled by default and deepseek-chat is no longer a reliable workaround for some users/accounts.

RAW_BUFFERClick to expand / collapse

Bug Description

When using the n8n AI Agent node with the DeepSeek Chat Model node and model deepseek-v4-flash, tool calling fails with a 400 Bad Request error:

Bad request - please check your parameters. The reasoning_content in the thinking mode must be passed back to the API.

This happens when the AI Agent invokes any connected tool.

DeepSeek's current documentation states that deepseek-v4-flash supports both thinking and non-thinking modes, and that thinking mode is enabled by default. Their Thinking Mode documentation also states that when the model performs tool calls, the assistant message's reasoning_content must be passed back to the API in the following request so the model can continue the tool-calling reasoning loop.

It looks like n8n's AI Agent / DeepSeek Chat Model integration is not preserving or re-sending reasoning_content during tool execution.

There is already a related issue/PR for deepseek-reasoner, but this now affects deepseek-v4-flash as well because DeepSeek V4 thinking mode is enabled by default and deepseek-chat is no longer a reliable workaround for some users/accounts.

To Reproduce

  1. Create an AI Agent node.
  2. Connect a DeepSeek Chat Model node.
  3. Select model: deepseek-v4-flash.
  4. Connect at least one tool to the AI Agent.
    • Example: Calculator tool, HTTP Request Tool, or any custom tool.
  5. Send a prompt that forces the model to use a tool.
    • Example: "Use the tool to calculate 187 * 43 and tell me the result."
  6. The agent starts the tool-calling flow.
  7. n8n returns a DeepSeek API error.

Expected behavior

The workflow fails with:

Bad request - please check your parameters. The reasoning_content in the thinking mode must be passed back to the API.

This makes DeepSeek deepseek-v4-flash unusable with AI Agent tool calling in n8n.

Expected behavior

n8n should preserve the reasoning_content field returned by DeepSeek during tool-calling turns and pass it back to the DeepSeek API in the following request, together with the assistant message containing tool_calls and the tool response messages.

Alternatively, the DeepSeek Chat Model node should expose a parameter to disable thinking mode explicitly, for example:

{
  "thinking": {
    "type": "disabled"
  }
}

### Debug Info

# Debug info

## core

- n8nVersion: 2.16.1
- platform: docker (self-hosted)
- nodeJsVersion: 24.14.1
- nodeEnv: production
- database: postgres
- executionMode: scaling (single-main)
- concurrency: -1
- license: enterprise (production)
- consumerId: 8f1f5aa1-ceaf-4014-b2d6-a1791a852bea

## storage

- success: all
- error: all
- progress: false
- manual: true
- binaryMode: database

## pruning

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

## client

- userAgent: mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/147.0.0.0 safari/537.36
- isTouchDevice: false

Generated at: 2026-05-04T04:27:03.856Z

### Operating System

Ubuntu

### n8n Version

2.16.1

### Node.js Version

24

### Database

PostgreSQL

### Execution mode

main (default)

### Hosting

self hosted

extent analysis

TL;DR

The n8n AI Agent node with the DeepSeek Chat Model node and deepseek-v4-flash model fails due to missing reasoning_content in tool-calling requests, which can be mitigated by preserving and re-sending this field.

Guidance

  • Verify that the reasoning_content field is indeed missing from the requests sent to the DeepSeek API during tool execution.
  • Check the n8n AI Agent node and DeepSeek Chat Model node configurations to ensure they are correctly set up for tool calling with the deepseek-v4-flash model.
  • Consider modifying the DeepSeek Chat Model node to expose a parameter for disabling thinking mode, as suggested in the issue description.
  • Investigate the related issue/PR for deepseek-reasoner to see if it provides any insights or solutions for this problem.

Example

No code snippet is provided as it is not clearly supported by the issue, but the suggested parameter to disable thinking mode could look like this:

{
  "thinking": {
    "type": "disabled"
  }
}

Notes

The provided information suggests that the issue is specific to the deepseek-v4-flash model with thinking mode enabled, and the n8n AI Agent node's handling of tool-calling requests.

Recommendation

Apply a workaround by preserving and re-sending the reasoning_content field in tool-calling requests, as this is the most direct way to address the issue based on the provided information.

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

n8n should preserve the reasoning_content field returned by DeepSeek during tool-calling turns and pass it back to the DeepSeek API in the following request, together with the assistant message containing tool_calls and the tool response messages.

Alternatively, the DeepSeek Chat Model node should expose a parameter to disable thinking mode explicitly, for example:

{
  "thinking": {
    "type": "disabled"
  }
}

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

n8n - 💡(How to fix) Fix DeepSeek v4-flash tool calling fails in AI Agent with 400: reasoning_content must be passed back [1 comments, 2 participants]