DeepSeek V3 Chat and R1 Reasoner Integration Guide - n8n Workflow

Learn how to integrate DeepSeek V3 Chat and R1 Reasoner models using this advanced n8n workflow. Includes examples for Ollama, LangChain nodes, and raw HTTP requests for high-performance AI automation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

AI Developers & Prompt Engineers: Seeking comprehensive n8n templates for accessing advanced DeepSeek models (R1 and V3 Chat).
Automation Specialists: Who need flexible methods (LangChain, HTTP, Ollama) for deploying AI services within an n8n workflow.
Users of Local AI: Those running Ollama and needing a ready-made n8n node integration solution.
n8n Users: Looking for advanced examples of using the LangChain-compatible n8n node set.

Overview

This comprehensive n8n workflow serves as a quick-start guide and set of n8n templates for developers and automators interested in leveraging DeepSeek's powerful AI models (R1 Reasoner and V3 Chat). The value provided by this n8n workflow is the consolidation of multiple connection strategies—using the official API (via standard LangChain n8n node configurations compatible with OpenAI's format), raw HTTP requests for fine-grained control, and local deployment via the Ollama n8n node.

This specific n8n workflow structure allows users to examine and test different integration methodologies side-by-side, making it an invaluable resource for anyone building sophisticated AI-driven automation using n8n. By leveraging this n8n template, you can quickly move from setup to execution, choosing the specific DeepSeek integration method that best fits your infrastructure needs.

How it Works

The n8n workflow begins with the "When chat message received" n8n trigger, initiating the flow based on a conversational input, simulating a real-time request.

The n8n workflow then branches into multiple demonstration paths:


  1. Conversational Agent with Memory (DeepSeek API): The flow directs input into the AI Agent n8n node. This agent uses the DeepSeek n8n node (configured for deepseek-reasoner) and the Window Buffer Memory n8n node to maintain conversation history, demonstrating advanced stateful interaction within this n8n workflow.

  2. Basic LLM Chain (Ollama Local Model): Input is processed by a Basic LLM Chain using the Ollama DeepSeek n8n node. This is specifically configured for the local model deepseek-r1:14b, showcasing how to utilize locally hosted AI models seamlessly within an n8n workflow, leveraging the dedicated Ollama n8n node.

  3. Raw HTTP Request - DeepSeek Reasoner R1: An HTTP Request n8n node (DeepSeek Raw Body) is configured to send a raw JSON body directly to the DeepSeek API endpoint for the deepseek-reasoner model. This path offers the most granular control over the API call.

  4. Raw HTTP Request - DeepSeek Chat V3: A second HTTP Request n8n node (DeepSeek JSON Body) demonstrates a different structure, sending a JSON body that includes system messages, targeting the deepseek-chat (V3) model.

This robust n8n workflow provides four distinct, runnable n8n templates for DeepSeek connectivity.

Installation Guide


  1. Import the n8n template: Copy the provided JSON and import it into your n8n instance.

  2. API Key Setup (DeepSeek API): DeepSeek's API is compatible with the OpenAI format. For API access via LangChain or HTTP Request n8n node steps, you must set up the appropriate credentials.

For the LangChain DeepSeek n8n node, configure an OpenAI API credential and set the base URL to https://api.deepseek.com and use your DeepSeek API key.
For the HTTP Request n8n node steps, configure an HTTP Header Auth credential using your DeepSeek API key as the value for the Authorization header (usually formatted as Bearer YOURAPIKEY).

  1. Ollama Setup (Optional): If you plan to use the local path, ensure you have the Ollama service running locally with the deepseek-r1:14b model pulled. Configure the Ollama DeepSeek n8n node with the correct Ollama API credentials pointing to your local endpoint (e.g., http://127.0.0.1:11434).

  2. Test the n8n trigger: Use the 'When chat message received' n8n trigger test function (or connect it to a chat service) to execute the workflow and observe the different outputs.

Node Details

When chat message received (n8n trigger):
Function: Starts the n8n workflow upon receiving an incoming chat message, serving as the primary input n8n trigger.
Key Configuration: Standard LangChain trigger setup for immediate conversational response.
DeepSeek (LangChain lmChatOpenAi n8n node):
Function: Acts as the language model connection for the AI Agent path, configured to use the deepseek-reasoner model.
Key Configuration: Model set to =deepseek-reasoner; requires OpenAI compatible credentials.
AI Agent (LangChain agent n8n node):
Function: Orchestrates the conversational flow, using the DeepSeek model and memory to respond contextually.
Key Configuration: Agent type set to conversationalAgent; includes a system message: "You are a helpful assistant."
Ollama DeepSeek (LangChain lmChatOllama n8n node):
Function: Connects the n8n workflow directly to a local Ollama instance running the DeepSeek R1 model.
Key Configuration: Model set to deepseek-r1:14b; configured for temperature 0.6 and a large context window (numCtx: 16384). This demonstrates a powerful local n8n node integration.
DeepSeek Raw Body & DeepSeek JSON Body (HTTP Request n8n node):
Function: Provides direct, low-level HTTP integration with the DeepSeek API for both the Reasoner (R1) and Chat (V3) models.
* Key Configuration: Uses dynamic expressions ({{ $json.chatInput }}) to pass user input into the raw request body, ensuring the n8n node sends the correct prompt.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
Joseph LePage
Joseph LePage

As an AI Automation consultant based in Canada, I partner with forward-thinking organizations to implement AI solutions that streamline operations and drive growth.

Featured*