Last updated: May 25, 2026
Integrating DeepSeek into n8n is usually done by adding the DeepSeek Chat Model node to an AI workflow, connecting it to a Basic LLM Chain or AI Agent, and authenticating with a DeepSeek API key. You can also run DeepSeek with n8n through the HTTP Request node for direct API control, a self-hosted community node, or a local DeepSeek model through Ollama.
Best method for most users: Use the native DeepSeek Chat Model node if you are building standard n8n AI workflows. Use HTTP Request if you want full control over the DeepSeek API payload, model parameters, thinking mode, JSON output, or troubleshooting.
As of May 2026, DeepSeek’s official API docs list deepseek-v4-flash and deepseek-v4-pro as current models. The older deepseek-chat and deepseek-reasoner names are compatibility aliases that currently route to DeepSeek V4 Flash modes and are scheduled to be fully retired and inaccessible after July 24, 2026, 15:59 UTC. DeepSeek’s OpenAI-format base URL is https://api.deepseek.com, and the chat endpoint is /chat/completions. DeepSeek also documents an Anthropic-format base URL at https://api.deepseek.com/anthropic.
Table of Contents
What you’ll build
By the end of this guide, you’ll know how to:
- Connect DeepSeek to n8n.
- Choose the right integration method.
- Use DeepSeek in an AI Agent or Basic LLM Chain.
- Call the DeepSeek API directly with the HTTP Request node.
- Run a local DeepSeek model through Ollama.
- Troubleshoot common authentication, model, JSON, Docker, and rate-limit errors.
This guide focuses on practical workflow automation, not just API theory. The examples are written for automation builders, developers, AI workflow creators, and technical founders who want to use DeepSeek inside real n8n workflows.
Quick answer: How to run DeepSeek with n8n
To run DeepSeek with n8n:
- Create a DeepSeek account and generate a DeepSeek API key.
- Open n8n and create a new workflow.
- Add a trigger, such as Manual Trigger, Chat Trigger, Webhook, Gmail, Slack, or another app trigger.
- Add either DeepSeek Chat Model, Basic LLM Chain, AI Agent, or HTTP Request, depending on your workflow.
- Configure the credentials, choose the model, write your prompt, test the workflow, then activate it.
n8n’s official DeepSeek credential documentation says the DeepSeek credential uses an API key and can authenticate the Chat DeepSeek node. n8n’s DeepSeek Chat Model node dynamically loads models from your DeepSeek account, so the model list you see in n8n may depend on your account and DeepSeek’s current API availability.
DeepSeek + n8n integration methods compared
There is no single “best” DeepSeek integration for every n8n workflow. The best option depends on whether you want a no-code AI node, raw API control, self-hosted customization, or local model execution.
| Method | Best for | Works on n8n Cloud? | Requires code? | Pros | Cons |
|---|---|---|---|---|---|
| Native DeepSeek Chat Model node | Most AI workflows, chat agents, chains | Yes, when the node is available in your workspace | No | Simple setup, built into n8n, works with AI workflows | Less raw API control than HTTP Request |
| HTTP Request node | Direct DeepSeek API calls, advanced options, fallback setup | Yes | Low | Full control over endpoint, headers, model, thinking mode, JSON body | Requires API payload knowledge |
Community node, such as n8n-nodes-deepseek | Self-hosted users who want a custom DeepSeek node | Mostly self-hosted | Low | May offer dedicated actions or UI | Depends on third-party maintenance and compatibility |
| Ollama Chat Model for local DeepSeek | Local/private workflows, offline testing, self-hosted AI | Usually self-hosted or reachable remote Ollama | No to low | Local model control, no hosted API dependency | Hardware dependent; Docker networking can be tricky |
| OpenAI-compatible gateway/provider | Teams already routing models through a gateway | Depends on gateway and n8n node support | Low | Centralized model routing and billing | Another dependency layer |
n8n’s HTTP Request node can make REST API calls and can also be attached to an AI Agent as a tool. n8n’s community-node docs also note that unverified community nodes are not available on n8n Cloud and require self-hosting, so community DeepSeek nodes should be treated as a self-hosted option unless n8n or the node maintainer states otherwise.
Prerequisites
Before integrating DeepSeek into n8n, prepare the following:
- An n8n Cloud workspace or a self-hosted n8n instance.
- A DeepSeek account.
- A DeepSeek API key.
- Available API balance if your DeepSeek account requires prepaid usage.
- A basic understanding of triggers, nodes, credentials, and expressions in n8n.
- Optional: Ollama installed if you want to run a local DeepSeek model.
For API workflows, use n8n credentials instead of hardcoding secrets into prompts, Code nodes, or HTTP payloads. n8n stores credentials separately and lets nodes request credential information when needed.
Method 1: Integrating DeepSeek into n8n with the native DeepSeek Chat Model node
The native DeepSeek Chat Model node is the cleanest path for most users. n8n describes this node as a way to use DeepSeek’s chat models with conversational agents, and it includes a model parameter plus a Base URL option for overriding the default API URL when needed.
Step-by-step setup
- Create or open a workflow
Open n8n and create a new workflow, or open an existing workflow where you want DeepSeek to process text. - Add a trigger
Use a Manual Trigger for testing, a Chat Trigger for a chatbot-style interface, a Webhook for external requests, or an app trigger such as Gmail, Slack, Telegram, Notion, or Google Sheets. - Add a Basic LLM Chain or AI Agent
Use Basic LLM Chain for straightforward prompt-response tasks. Use AI Agent when the model needs to choose tools or perform actions. - Attach the DeepSeek Chat Model
Under the model connection on your chain or agent, add the DeepSeek Chat Model node. - Create DeepSeek credentials
Add your DeepSeek API key in n8n’s DeepSeek credential screen. Do not paste the API key into the prompt. - Select the model
Choose a current model such asdeepseek-v4-flashordeepseek-v4-pro, depending on availability in your account. - Configure the prompt
Add a concise system instruction and pass dynamic content from earlier nodes. - Test the workflow
Run the workflow manually. Check the input, model response, and downstream nodes. - Save and activate
Once the workflow behaves correctly, save it and activate it.
Basic LLM Chain vs AI Agent
Use Basic LLM Chain when the model only needs to transform or generate text. Good examples include summarization, classification, rewriting, extraction, keyword clustering, support-ticket labeling, and structured JSON generation.
Use AI Agent when the model needs to decide which tools to call. Good examples include looking up data in Google Sheets, sending a Slack message, searching a CRM, calling an internal API, or routing a support ticket to the right team.
n8n’s Basic LLM Chain node is designed to set the prompt used by a connected model and can use an optional parser. The AI Agent node, by contrast, uses external tools and APIs to perform actions and retrieve information.
Example prompt
System message:
You are an automation assistant. Return concise, structured answers.
User message:
Summarize this incoming support ticket and classify its urgency:
{{$json.message}}
For a chain, this is enough. For an agent, add clear boundaries, such as which tools it may use, when it should ask for clarification, and when it must avoid taking action without approval.
Method 2: How to run DeepSeek with n8n using HTTP Request
The HTTP Request method is the most flexible way to run DeepSeek with n8n. It is useful when you want direct control over the API endpoint, headers, body, model, response format, thinking mode, or error handling.
Use this method when:
- The native DeepSeek Chat Model node is not available.
- You want to call the DeepSeek API exactly as documented.
- You need advanced request parameters.
- You want a fallback method that is not tied to a specific n8n AI node.
- You are debugging model names, authentication, rate limits, or JSON output.
HTTP Request node setup
In n8n, add an HTTP Request node and configure it like this:
| Setting | Value |
|---|---|
| Node | HTTP Request |
| Method | POST |
| URL | https://api.deepseek.com/chat/completions |
| Authentication | Header Auth, Bearer token, or generic credential |
| Header | Authorization: Bearer YOUR_DEEPSEEK_API_KEY |
| Header | Content-Type: application/json |
| Body type | JSON |
The DeepSeek quick-start docs show the same chat-completions endpoint, Bearer authorization header, JSON content type, and stream: false example structure.
Copy-ready JSON body: fast automation
Use deepseek-v4-flash with thinking disabled for fast automations such as classification, extraction, rewriting, chat replies, and general workflow text generation.
{
"model": "deepseek-v4-flash",
"messages": [
{
"role": "system",
"content": "You are a concise automation assistant. Return clear, actionable output."
},
{
"role": "user",
"content": "{{$json.chatInput || $json.prompt || $json.message || ''}}"
}
],
"thinking": {
"type": "disabled"
},
"stream": false
}
Copy-ready JSON body: reasoning or deeper analysis
Use deepseek-v4-pro when the workflow needs deeper reasoning, planning, comparison, or analysis.
{
"model": "deepseek-v4-pro",
"messages": [
{
"role": "system",
"content": "Think carefully and return a structured answer."
},
{
"role": "user",
"content": "{{$json.task}}"
}
],
"thinking": {
"type": "enabled"
},
"reasoning_effort": "high",
"stream": false
}
DeepSeek’s thinking-mode docs state that thinking can be controlled with {"thinking": {"type": "enabled/disabled"}}, and reasoning effort can be set to high or max. They also note that thinking mode does not support parameters such as temperature, top_p, presence_penalty, or frequency_penalty, even if compatibility layers accept them without error.
JSON output for downstream n8n nodes
If your next node is Slack, Telegram, Google Sheets, Notion, email, or Respond to Webhook, structured output is usually safer than free text.
For JSON output, add response_format and explicitly mention JSON in the prompt:
{
"model": "deepseek-v4-flash",
"messages": [
{
"role": "system",
"content": "Return only valid JSON. Do not include markdown."
},
{
"role": "user",
"content": "Classify this support ticket as JSON with fields: summary, urgency, category, suggested_reply, next_action. Ticket: {{$json.message}}"
}
],
"response_format": {
"type": "json_object"
},
"max_tokens": 800,
"stream": false
}
DeepSeek’s JSON Output guide says to set response_format to {'type': 'json_object'}, include the word “json” in the system or user prompt, provide an example format, and set max_tokens reasonably to avoid truncating JSON.
Mapping the response in n8n
The main answer is typically inside:
choices[0].message.content
In n8n, you can pass that value to:
- Slack for team notifications.
- Telegram for chat alerts.
- Google Sheets for logging.
- Email for summaries or drafts.
- Respond to Webhook for API-style responses.
- Set/Edit Fields to rename or normalize fields.
- Code to parse JSON if you need advanced validation.
Use stream: false for most n8n workflows unless you have deliberately built a streaming response pipeline.
Method 3: Using DeepSeek with an n8n AI Agent
Use DeepSeek with an n8n AI Agent when the model needs to do more than answer a prompt. Agents are useful when the model needs to choose tools, call APIs, retrieve data, update records, or decide the next action.
A simple AI Agent workflow can look like this:
Chat Trigger → AI Agent → DeepSeek Chat Model
→ HTTP Request tool
→ Google Sheets tool
→ Slack tool
→ Gmail or Notion tool
n8n’s AI Agent node uses tools and APIs to perform actions and retrieve information. n8n also says an AI Agent must have at least one tool sub-node connected, and current AI Agent nodes work as Tools Agents.
Best practices for DeepSeek agents in n8n
Give your agent a narrow job. Instead of saying “manage customer support,” say:
You are a support triage agent. Your job is to classify incoming tickets, summarize the issue, decide whether escalation is needed, and draft a reply. You may use the connected tools only when necessary. Never send a customer-facing message without human approval.
Then follow these rules:
- Define a clear system prompt.
- Limit tool permissions.
- Use human approval for risky actions.
- Log agent outputs and tool calls.
- Validate JSON before sending data downstream.
- Use deterministic routing where possible instead of asking the model to decide everything.
- Keep memory off unless the workflow truly needs conversation history.
DeepSeek’s API supports tool calls, but the model itself does not execute functions; your application or n8n workflow must execute the tool and return the result.
Method 4: Running DeepSeek locally with n8n and Ollama
Running DeepSeek locally is different from using the hosted DeepSeek API.
With the API method, n8n sends requests to DeepSeek’s hosted endpoint. With Ollama, you run a local or self-hosted model, such as a DeepSeek-R1 distilled model, on your own machine or server. This is different from using DeepSeek’s hosted V4 API models, so behavior, latency, context handling, and tool support may differ.
This can be useful for:
- Local testing.
- Privacy-sensitive workflows.
- Offline experimentation.
- Self-hosted AI workflows.
- Reducing dependency on hosted model APIs.
It also has trade-offs. Local model performance depends heavily on CPU, GPU, RAM, model size, quantization, and concurrent workload.
Steps to run a local DeepSeek model with n8n and Ollama
- Install Ollama
Install Ollama on your local machine or server. - Pull a DeepSeek model
For example:ollama pull deepseek-r1:7bOllama’s model library lists DeepSeek-R1 variants including1.5b,7b,8b,14b,32b,70b, and671b, withdeepseek-r1:7bshown as a distilled model option. - Add the Ollama Chat Model node in n8n
In your n8n workflow, add Ollama Chat Model and connect it to a Basic LLM Chain or AI Agent. - Configure Ollama credentials
Use the correct instance URL. - Choose the correct base URL
Common examples:Local non-Docker:
http://localhost:11434
n8n in Docker and Ollama on the host:
http://host.docker.internal:11434
Separate Docker containers:
http://YOUR_OLLAMA_CONTAINER_NAME:11434 - Connect to a chain or agent
Use Basic LLM Chain for simple prompts or AI Agent for tool-based workflows. - Test with a small prompt
Start with a short classification or summary before using longer prompts.
Docker troubleshooting note
In Docker, localhost inside a container means the container itself, not your host machine. n8n’s Ollama troubleshooting docs explain that if n8n or Ollama runs in Docker, you need correct networking; for n8n in Docker on Linux, mapping host.docker.internal may require --add-host host.docker.internal:host-gateway, and separate containers can communicate by container name on a shared Docker network.
Choosing the right DeepSeek model for n8n
As of May 2026, the practical choice for DeepSeek API workflows is usually between deepseek-v4-flash and deepseek-v4-pro.
| Model | Best use case | Speed | Cost | Reasoning capability | Recommended n8n use |
|---|---|---|---|---|---|
deepseek-v4-flash | Fast automations, chat, extraction, classification, rewriting | Faster | Usually better for high-volume tasks | Supports thinking/non-thinking modes | Default for most workflows |
deepseek-v4-pro | Deeper analysis, planning, complex reasoning, agentic tasks | Slower than flash | Usually higher than flash | Stronger reasoning target | Use for complex workflows |
deepseek-chat | Legacy tutorials and compatibility | Deprecated path | Check current docs | Compatibility alias | Avoid for new production workflows |
deepseek-reasoner | Legacy reasoning tutorials | Deprecated path | Check current docs | Compatibility alias | Avoid for new production workflows |
Local deepseek-r1:* via Ollama | Local reasoning and experimentation | Hardware dependent | No hosted API cost, but local compute cost | Depends on model size | Use for local/private workflows |
DeepSeek’s current model details page lists both deepseek-v4-flash and deepseek-v4-pro, says both support JSON Output and Tool Calls, and lists a 1M context length. It also points readers to the Thinking Mode guide for switching thinking behavior.
For production, always check DeepSeek’s current model list before deploying. Model names, pricing, feature support, and deprecation timelines can change.
Example workflow: Support ticket triage with DeepSeek and n8n
Here is a practical workflow that uses DeepSeek to triage support tickets.
Goal
When a support message arrives, DeepSeek should:
- Summarize the issue.
- Classify urgency.
- Identify the category.
- Draft a suggested reply.
- Recommend the next action.
- Send a Slack notification.
- Save the result to Google Sheets.
- Optionally create a draft email or helpdesk reply.
Workflow structure
Webhook or Gmail Trigger
→ Set/Edit Fields
→ Basic LLM Chain or HTTP Request to DeepSeek
→ Parse JSON
→ Slack notification
→ Google Sheets row
→ Optional draft reply
Example input
{
"customer_email": "alex@example.com",
"message": "I reset my password twice but still cannot access my account. This is blocking our team from submitting today’s report."
}
Example prompt
Return only valid JSON.
Classify the following support ticket. Use this JSON structure:
{
"summary": "",
"urgency": "low | medium | high",
"category": "",
"suggested_reply": "",
"next_action": ""
}
Ticket:
{{$json.message}}
Example JSON output
{
"summary": "Customer cannot access their account after password reset.",
"urgency": "high",
"category": "account_access",
"suggested_reply": "Thanks for reaching out. We’ll help you restore access...",
"next_action": "Escalate to support tier 2"
}
Suggested nodes
| Step | n8n node |
|---|---|
| Receive ticket | Webhook, Gmail Trigger, IMAP Email, Intercom, Zendesk, HubSpot, or Help Scout |
| Normalize input | Set/Edit Fields |
| Analyze ticket | DeepSeek Chat Model + Basic LLM Chain, or HTTP Request |
| Validate output | Structured Output Parser, Code, or JSON parse step |
| Notify team | Slack, Telegram, Microsoft Teams |
| Log result | Google Sheets, Airtable, Notion, Postgres |
| Reply workflow | Gmail draft, Zendesk update, or human approval flow |
For production, keep the output schema strict. A malformed JSON response can break downstream nodes, so validate the model output before writing to a database or sending customer-facing messages.
Troubleshooting DeepSeek in n8n
| Problem | Likely cause | Fix |
|---|---|---|
| 401 authentication error | Wrong or missing DeepSeek API key | Recreate the API key, update the n8n credential, and confirm the Authorization header is Bearer YOUR_KEY. DeepSeek lists 401 as authentication failure caused by a wrong API key. |
| 402 insufficient balance | DeepSeek account has no available balance | Check your DeepSeek billing or top-up page. DeepSeek lists 402 as insufficient balance. |
| 429 rate limit | Too many requests too quickly | Add delays, batching, or retry logic. n8n’s HTTP Request node supports batching and Retry on Fail. |
| Model not found | Deprecated or unavailable model name | Use deepseek-v4-flash or deepseek-v4-pro, and check /models or the official model list. |
| HTTP Request JSON body invalid | Missing quotes, extra comma, invalid expression, or malformed JSON | Validate the JSON body and ensure expressions are placed correctly. n8n’s HTTP Request docs list invalid JSON formatting as a common issue. |
| Basic LLM Chain says no prompt specified | Prompt field is empty or expected chatInput is missing | Add a prompt manually or map an incoming field to chatInput. n8n documents this as a Basic LLM Chain issue. |
| Chat Model sub-node not connected | DeepSeek model node is not attached to the chain or agent | Connect the DeepSeek Chat Model under the model connector of the chain or AI Agent. |
| Ollama cannot connect in Docker | localhost points to the wrong container | Use host.docker.internal, a shared Docker network, or the Ollama container name depending on your setup. |
| Local model is too slow | Model too large for your hardware | Try a smaller Ollama model, reduce prompt size, or move to a GPU-backed server. |
Old tutorials use deepseek-chat or deepseek-reasoner | Legacy model names | Use current model names for new workflows; keep legacy names only when maintaining old workflows before deprecation. |
| Community node not available in n8n Cloud | Unverified community nodes require self-hosting | Use the native DeepSeek node or HTTP Request on n8n Cloud. |
| Tool calling does not behave as expected | Tool schema, model support, or agent setup issue | Simplify the agent, define tools clearly, validate schema, and test with HTTP Request if you need raw API-level control. |
Security and production best practices
DeepSeek + n8n can automate sensitive workflows, so treat it like production software, not a toy integration.
Use these rules:
- Never hardcode API keys inside prompts, Code nodes, browser/client-side code, or visible workflow fields. Store secrets in n8n credentials or an approved secrets manager.
- Store API keys in n8n credentials or an approved secrets manager, and rotate them if they may have been exposed.
- Use separate API keys for separate workflows or environments.
- Add retries for temporary failures.
- Add rate limiting or batching for high-volume workflows.
- Avoid sending sensitive user data, customer PII, credentials, internal documents, or regulated data unless the workflow, vendor terms, privacy review, and security controls explicitly allow it.
- Use structured JSON output for downstream systems.
- Validate model output before writing to a database or sending a message.
- Use human approval for customer-facing, financial, legal, or destructive actions.
- Monitor workflow executions and errors.
- Keep n8n, custom nodes, and self-hosted dependencies updated.
- For community nodes, check maintenance history before using them in production.
If you are using an AI Agent, limit its tools. A support triage agent does not need access to every internal API. A lead enrichment agent should not be able to send invoices. A research agent should not be able to delete records.
FAQ
Can I integrate DeepSeek into n8n without code?
Yes. The easiest no-code option is to use the native DeepSeek Chat Model node with a Basic LLM Chain or AI Agent. You still need a DeepSeek API key, but you do not need to write code.
What is the easiest way to run DeepSeek with n8n?
For most users, the easiest method is:
Trigger → Basic LLM Chain or AI Agent → DeepSeek Chat Model
Use Basic LLM Chain for simple prompt-response workflows. Use AI Agent when the model needs tools.
Can I use DeepSeek with n8n Cloud?
Yes, if the native DeepSeek Chat Model node is available in your n8n Cloud workspace, or by using the HTTP Request node to call the DeepSeek API directly. Community nodes are different: unverified community nodes are generally a self-hosted option, not an n8n Cloud option.
Can I use the HTTP Request node instead of the DeepSeek node?
Yes. The HTTP Request node is often the most reliable fallback because it calls the DeepSeek API directly. It is also the best option if you need full control over the endpoint, headers, model, thinking mode, JSON output, or request body.
What is the DeepSeek API base URL?
For OpenAI-compatible requests, the DeepSeek base URL is:
https://api.deepseek.com
For chat completions in an n8n HTTP Request node, use:
https://api.deepseek.com/chat/completions
DeepSeek’s docs also list an Anthropic-format base URL at https://api.deepseek.com/anthropic.
Which DeepSeek model should I use in n8n?
Use deepseek-v4-flash for most fast automations, extraction, classification, and routine chat tasks. Use deepseek-v4-pro for more complex reasoning, planning, analysis, and agentic workflows. Avoid starting new production workflows with deepseek-chat or deepseek-reasoner because DeepSeek lists them as deprecated compatibility names.
Can I run DeepSeek locally with n8n?
Yes. You can run a local DeepSeek model through Ollama and connect it to n8n with the Ollama Chat Model node. This is useful for local testing and private workflows, but performance depends on your hardware and Docker/network setup.
Why is my DeepSeek API key not working in n8n?
The most common reasons are an incorrect key, missing Bearer token format, expired or deleted key, wrong credential selected in the node, insufficient account balance, or a request going to the wrong URL. Start by recreating the API key, updating the n8n credential, and testing a simple HTTP Request.
Does DeepSeek support tool calling in n8n agents?
DeepSeek’s API supports tool calls, and n8n AI Agents use tools and APIs to perform actions. In practice, you should test the exact combination of n8n version, model, tool schema, and agent workflow you plan to use. If tool calling is inconsistent, simplify the tool schema or use HTTP Request for direct API debugging.
Is DeepSeek cheaper than other LLM APIs for n8n workflows?
Do not assume without checking your current usage pattern. Compare current DeepSeek pricing, input tokens, output tokens, reasoning settings, context length, retries, and workflow volume. A “cheaper” model can become expensive if your workflow sends long prompts, retries often, or generates large outputs. DeepSeek’s pricing page bills by input and output tokens.
Conclusion
Integrating DeepSeek into n8n is straightforward once you choose the right path.
For most users, the native DeepSeek Chat Model node is the best starting point. It keeps the workflow clean and works well with n8n’s AI nodes. For advanced users, the HTTP Request node gives the most control over the DeepSeek API, including model selection, thinking mode, JSON output, and troubleshooting. For local or private workflows, Ollama lets you run DeepSeek-style models on your own machine or server, as long as your hardware and Docker networking are configured correctly.
For production workflows, use secure credentials, current model names, strict output schemas, error handling, monitoring, and human approval for risky actions.
