Setting up a DeepSeek R1 planning agent in n8n involves several steps that allow you to leverage DeepSeek's AI capabilities for planning and automation tasks. Here's a detailed guide on how to integrate and use DeepSeek R1 as a planning agent in n8n:
Step 1: Install n8n and the DeepSeek Node
1. Install n8n: First, ensure you have n8n installed. Follow the official n8n documentation for installation instructions.
2. Install the DeepSeek Node: In the n8n interface, navigate to Settings > Community Nodes > Install a community node. In the npm Package Name field, type `"n8n-nodes-deepseek"`, select the checkbox "I understand the risks of installing unverified code from a public source," and click the "Install" button[4].
Step 2: Create Credentials for DeepSeek
1. Generate API Key: Go to the DeepSeek platform and generate an API key. You can find this option on the DeepSeek API keys page.
2. Configure Credentials in n8n: In n8n, create a new credential by clicking on the "+" button in the credentials section. Paste your DeepSeek API key and save it.
Step 3: Set Up the Workflow
1. Create a New Workflow: Click on "New Workflow" in the Overview tab of n8n.
2. Add a Trigger: Click on "Add first step" in the center of the workflow and add a trigger to start the flow. This could be a manual trigger or a trigger based on an event, such as receiving a chat message.
3. Add the DeepSeek Node: Click the "+" to add a service to the flow, type "deepseek" in the search, and select the DeepSeek node you installed.
4. Configure the DeepSeek Node:
- In the "Select Credential" input, choose the credential you created.
- Select the model as "DeepSeek Reasoner" to use DeepSeek R1.
- Set up the prompt or input for the DeepSeek R1 model. Since it's used as a planning agent, you might want to provide a human request or task description.
Step 4: Use DeepSeek R1 as a Planning Agent
1. Plan Generation: The DeepSeek R1 model will process the input and generate a step-by-step plan. This plan will be used to feed into a tools agent.
2. Tools Agent Setup: Create another node in your workflow that acts as a tools agent. This agent will execute the steps outlined by the DeepSeek R1 planning agent. You can use other AI models like GPT 4o or Claude 3.5 Sonnet for this purpose.
3. Connect the Planning Agent to the Tools Agent: Ensure that the output from the DeepSeek R1 node is connected to the input of the tools agent node. This way, the plan generated by DeepSeek R1 is automatically passed to the tools agent for execution.
Step 5: Test the Workflow
1. Trigger the Workflow: Start the workflow by triggering the initial node. This could be a manual trigger or an automated trigger based on your setup.
2. Monitor Execution: Observe how the DeepSeek R1 planning agent generates a plan and how the tools agent executes it. You can inspect the output at each step to ensure everything is working as expected.
By following these steps, you can effectively set up a DeepSeek R1 planning agent in n8n to automate tasks and leverage AI for planning and execution[1][4][7].
Citations:
[1] https://www.youtube.com/watch?v=tjaD65OCoE8
[2] https://www.youtube.com/watch?v=g_LLiqUptsE
[3] https://www.youtube.com/watch?v=4Zk-bp9atPQ
[4] https://dev.to/dwtoledo/integrating-deepseek-into-n8n-low-cost-ai-automations-11ge
[5] https://www.reddit.com/r/n8n/comments/1idhd95/how_to_use_deepseek_r1_via_groq_a_stepbystep_guide/
[6] https://www.reddit.com/r/n8n/comments/1iocyh6/n8n_with_self_hosted_llm/
[7] https://blog.elest.io/how-to-use-deepseek-r1-in-n8n/
[8] https://n8n.io/workflows/2813-automate-content-generator-for-wordpress-with-deepseek-r1/
[9] https://www.youtube.com/watch?v=GUWIAEdvwAY
[10] https://www.skool.com/ai-automation-society/new-video-how-to-actually-build-agents-with-deepseek-r1-in-n8n-without-openrouter