mirror of
https://github.com/khoaliber/n8nworkflows.xyz.git
synced 2026-04-28 00:29:22 +00:00
creation
This commit is contained in:
+242
@@ -0,0 +1,242 @@
|
||||
Manage Odoo CRM with Natural Language using OpenAI and MCP Server
|
||||
|
||||
https://n8nworkflows.xyz/workflows/manage-odoo-crm-with-natural-language-using-openai-and-mcp-server-9187
|
||||
|
||||
|
||||
# Manage Odoo CRM with Natural Language using OpenAI and MCP Server
|
||||
|
||||
### 1. Workflow Overview
|
||||
|
||||
This workflow, titled **"Manage Odoo CRM with Natural Language using OpenAI and MCP Server"**, enables natural language interaction with an Odoo CRM system via AI-driven commands. It translates user requests into CRM operations such as creating, updating, retrieving, or deleting contacts, opportunities, and notes within Odoo. The workflow integrates an MCP Server Trigger (Langchain MCP) to receive AI tool commands and an AI Agent powered by OpenAI’s chat model, enhanced with memory and MCP client tools, to process natural language inputs and execute corresponding Odoo actions.
|
||||
|
||||
**Target Use Cases:**
|
||||
- CRM users who want to manage Odoo CRM entities using conversational natural language commands.
|
||||
- Automation scenarios where AI interprets and performs CRM updates based on user intent or chatbot interactions.
|
||||
|
||||
**Logical Blocks:**
|
||||
- **1.1 Input Reception:** Triggers and external message reception for user requests.
|
||||
- **1.2 AI Processing and Memory:** AI Agent setup with language model, memory buffer, and MCP client interaction.
|
||||
- **1.3 Odoo CRM Actions:** Nodes that perform CRUD operations on Odoo contacts, opportunities, and notes, triggered by AI instructions.
|
||||
|
||||
---
|
||||
|
||||
### 2. Block-by-Block Analysis
|
||||
|
||||
#### 1.1 Input Reception
|
||||
|
||||
**Overview:**
|
||||
This block handles incoming triggers from external sources, either through MCP Server (Langchain MCP Trigger) or chat messages, to start the workflow by capturing user input.
|
||||
|
||||
**Nodes Involved:**
|
||||
- MCP Server Trigger
|
||||
- When chat message received
|
||||
|
||||
**Node Details:**
|
||||
|
||||
- **MCP Server Trigger**
|
||||
- *Type & Role:* Langchain MCP Trigger node; receives AI tool invocation requests.
|
||||
- *Configuration:* Uses a webhook ID to listen for MCP server messages; no additional parameters configured.
|
||||
- *Input/Output:* No input; outputs AI tool requests to Odoo CRM action nodes.
|
||||
- *Edge Cases:* Possible webhook connectivity issues, malformed requests, or missing authentication.
|
||||
- *Version:* Type version 2.
|
||||
- *Sub-Workflow:* None.
|
||||
|
||||
- **When chat message received**
|
||||
- *Type & Role:* Langchain chatTrigger node; receives chat messages from integrated chat platforms.
|
||||
- *Configuration:* Uses a webhook ID; listens for new chat messages to trigger AI processing.
|
||||
- *Input/Output:* No input; outputs main data to AI Agent node.
|
||||
- *Edge Cases:* Webhook failures, unsupported chat formats, or message parsing errors.
|
||||
- *Version:* 1.3.
|
||||
- *Sub-Workflow:* None.
|
||||
|
||||
---
|
||||
|
||||
#### 1.2 AI Processing and Memory
|
||||
|
||||
**Overview:**
|
||||
This block processes natural language inputs with AI assistance. It includes the AI Agent node configured with an OpenAI chat language model, a memory buffer to keep context, and the MCP client tool for advanced AI functionality.
|
||||
|
||||
**Nodes Involved:**
|
||||
- AI Agent
|
||||
- OpenAI Chat Model
|
||||
- Simple Memory
|
||||
- MCP Client
|
||||
|
||||
**Node Details:**
|
||||
|
||||
- **AI Agent**
|
||||
- *Type & Role:* Langchain agent node; orchestrates AI tool usage and memory to interpret user commands.
|
||||
- *Configuration:* Connected to the OpenAI Chat Model (language model), Simple Memory (context storage), and MCP Client (external AI tools).
|
||||
- *Expressions:* Uses AI memory and AI tool inputs to decide next actions.
|
||||
- *Input/Output:* Receives main input from chat trigger; outputs AI tool commands to Odoo nodes.
|
||||
- *Edge Cases:* API rate limits, model timeouts, context overflow in memory buffer.
|
||||
- *Version:* 2.2.
|
||||
- *Sub-Workflow:* None.
|
||||
|
||||
- **OpenAI Chat Model**
|
||||
- *Type & Role:* Language model node; provides conversational AI capabilities using OpenAI’s chat endpoint.
|
||||
- *Configuration:* Uses OpenAI credentials; configured for chat completions.
|
||||
- *Edge Cases:* Authentication errors, API quota exceeded, improper prompt formatting.
|
||||
- *Version:* 1.2.
|
||||
|
||||
- **Simple Memory**
|
||||
- *Type & Role:* Memory buffer node; stores recent conversation context within a fixed window.
|
||||
- *Configuration:* Default window size to maintain conversation history.
|
||||
- *Edge Cases:* Memory overflow or stale context if window size is too small.
|
||||
- *Version:* 1.3.
|
||||
|
||||
- **MCP Client**
|
||||
- *Type & Role:* MCP client tool node; interfaces with MCP server for invoking AI tools.
|
||||
- *Configuration:* Uses MCP credentials and server endpoint to communicate.
|
||||
- *Edge Cases:* Network errors, MCP server unavailability.
|
||||
- *Version:* 1.1.
|
||||
|
||||
---
|
||||
|
||||
#### 1.3 Odoo CRM Actions
|
||||
|
||||
**Overview:**
|
||||
This block contains all nodes responsible for performing CRUD operations on Odoo CRM entities: contacts, opportunities, and notes. These nodes receive AI tool commands and execute them via Odoo’s API.
|
||||
|
||||
**Nodes Involved:**
|
||||
- Create a contact in Odoo
|
||||
- Delete a contact in Odoo
|
||||
- Update a contact in Odoo
|
||||
- Get a contact in Odoo
|
||||
- Get All contacts in Odoo
|
||||
- Create an opportunity in Odoo
|
||||
- Delete an opportunity in Odoo
|
||||
- Update an opportunity in Odoo
|
||||
- Get an opportunity in Odoo
|
||||
- Get many opportunities in Odoo
|
||||
- Create a note in Odoo
|
||||
- Delete a note in Odoo
|
||||
- Update a note in Odoo
|
||||
- Get a note in Odoo
|
||||
- Get many notes in Odoo
|
||||
|
||||
**Node Details:**
|
||||
|
||||
Each node is an **Odoo Tool** node configured to perform a specific operation on Odoo entities:
|
||||
|
||||
- *Type & Role:* n8n Odoo Tool nodes; interface with Odoo API for CRM data management.
|
||||
- *Configuration:* Each node is tailored to a specific entity and operation (Create, Read, Update, Delete, or List) with parameters set according to the operation (not shown in JSON but implied).
|
||||
- *Input/Output:* Input from MCP Server Trigger AI tool commands; outputs depend on operation success or data retrieval.
|
||||
- *Edge Cases:* Authentication failures with Odoo, API timeouts, invalid data, missing required fields, or entity not found.
|
||||
- *Version:* 1.
|
||||
|
||||
Each node is connected as an AI tool from MCP Server Trigger, meaning the AI Agent triggers these nodes dynamically based on user intent.
|
||||
|
||||
---
|
||||
|
||||
### 3. Summary Table
|
||||
|
||||
| Node Name | Node Type | Functional Role | Input Node(s) | Output Node(s) | Sticky Note |
|
||||
|--------------------------------|--------------------------------------|-----------------------------------------------|---------------------------|--------------------------------|-------------|
|
||||
| MCP Server Trigger | Langchain MCP Trigger | Receives AI tool commands from MCP Server | - | Odoo Tool nodes (multiple) | |
|
||||
| When chat message received | Langchain chatTrigger | Receives chat messages to trigger AI Agent | - | AI Agent | |
|
||||
| AI Agent | Langchain agent | Processes AI commands, memory, and tools | When chat message received | MCP Client, Odoo Tool nodes | |
|
||||
| OpenAI Chat Model | Langchain lmChatOpenAi | Provides conversational AI language model | - | AI Agent | |
|
||||
| Simple Memory | Langchain memoryBufferWindow | Maintains conversation context | - | AI Agent | |
|
||||
| MCP Client | Langchain mcpClientTool | Communicates with MCP Server | AI Agent | AI Agent | |
|
||||
| Create a contact in Odoo | n8n-nodes-base.odooTool | Creates a contact in Odoo CRM | MCP Server Trigger | - | |
|
||||
| Delete a contact in Odoo | n8n-nodes-base.odooTool | Deletes a contact in Odoo CRM | MCP Server Trigger | - | |
|
||||
| Update a contact in Odoo | n8n-nodes-base.odooTool | Updates a contact in Odoo CRM | MCP Server Trigger | - | |
|
||||
| Get a contact in Odoo | n8n-nodes-base.odooTool | Retrieves a specific contact from Odoo CRM | MCP Server Trigger | - | |
|
||||
| Get All contacts in Odoo | n8n-nodes-base.odooTool | Retrieves all contacts from Odoo CRM | MCP Server Trigger | - | |
|
||||
| Create an opportunity in Odoo | n8n-nodes-base.odooTool | Creates an opportunity in Odoo CRM | MCP Server Trigger | - | |
|
||||
| Delete an opportunity in Odoo | n8n-nodes-base.odooTool | Deletes an opportunity in Odoo CRM | MCP Server Trigger | - | |
|
||||
| Update an opportunity in Odoo | n8n-nodes-base.odooTool | Updates an opportunity in Odoo CRM | MCP Server Trigger | - | |
|
||||
| Get an opportunity in Odoo | n8n-nodes-base.odooTool | Retrieves a specific opportunity from Odoo CRM| MCP Server Trigger | - | |
|
||||
| Get many opportunities in Odoo | n8n-nodes-base.odooTool | Retrieves multiple opportunities from Odoo CRM| MCP Server Trigger | - | |
|
||||
| Create a note in Odoo | n8n-nodes-base.odooTool | Creates a note attached to Odoo CRM entities | MCP Server Trigger | - | |
|
||||
| Delete a note in Odoo | n8n-nodes-base.odooTool | Deletes a note in Odoo CRM | MCP Server Trigger | - | |
|
||||
| Update a note in Odoo | n8n-nodes-base.odooTool | Updates a note in Odoo CRM | MCP Server Trigger | - | |
|
||||
| Get a note in Odoo | n8n-nodes-base.odooTool | Retrieves a specific note from Odoo CRM | MCP Server Trigger | - | |
|
||||
| Get many notes in Odoo | n8n-nodes-base.odooTool | Retrieves multiple notes from Odoo CRM | MCP Server Trigger | - | |
|
||||
| Sticky Note | n8n-nodes-base.stickyNote | Visual comment | - | - | |
|
||||
| Sticky Note1 | n8n-nodes-base.stickyNote | Visual comment | - | - | |
|
||||
| Sticky Note2 | n8n-nodes-base.stickyNote | Visual comment | - | - | |
|
||||
| Sticky Note3 | n8n-nodes-base.stickyNote | Visual comment | - | - | |
|
||||
|
||||
---
|
||||
|
||||
### 4. Reproducing the Workflow from Scratch
|
||||
|
||||
1. **Create the MCP Server Trigger node:**
|
||||
- Type: `@n8n/n8n-nodes-langchain.mcpTrigger` (version 2)
|
||||
- Configure webhook ID (auto-generated) to receive MCP server commands.
|
||||
- No additional parameters needed.
|
||||
|
||||
2. **Create the Chat Trigger node:**
|
||||
- Type: `@n8n/n8n-nodes-langchain.chatTrigger` (version 1.3)
|
||||
- Configure webhook ID for chat message reception.
|
||||
- No additional parameters needed.
|
||||
|
||||
3. **Create the AI Agent node:**
|
||||
- Type: `@n8n/n8n-nodes-langchain.agent` (version 2.2)
|
||||
- Connect input from “When chat message received” node’s main output.
|
||||
- Set up AI agent to use the following tools:
|
||||
- AI Language Model: Connect to the “OpenAI Chat Model” node.
|
||||
- AI Memory: Connect to the “Simple Memory” node.
|
||||
- AI Tool: Connect to the “MCP Client” node.
|
||||
|
||||
4. **Create the OpenAI Chat Model node:**
|
||||
- Type: `@n8n/n8n-nodes-langchain.lmChatOpenAi` (version 1.2)
|
||||
- Set up OpenAI credentials (API key).
|
||||
- Ensure model parameters are suitable for conversational AI (usually GPT-4 or GPT-3.5).
|
||||
- No additional parameters unless custom prompt or temperature is required.
|
||||
|
||||
5. **Create the Simple Memory node:**
|
||||
- Type: `@n8n/n8n-nodes-langchain.memoryBufferWindow` (version 1.3)
|
||||
- Configure window size for stored conversation context (default or adjust for use case).
|
||||
|
||||
6. **Create the MCP Client node:**
|
||||
- Type: `@n8n/n8n-nodes-langchain.mcpClientTool` (version 1.1)
|
||||
- Configure MCP server credentials and endpoint URL.
|
||||
|
||||
7. **Create Odoo Tool nodes for Contacts:**
|
||||
For each operation on Contacts (Create, Delete, Update, Get one, Get all):
|
||||
- Type: `n8n-nodes-base.odooTool` (version 1)
|
||||
- Configure the node for the specific operation and entity 'Contact' in Odoo.
|
||||
- Set up Odoo credentials (API user, password, URL).
|
||||
- No parameters shown in JSON; fill as per operation (e.g., fields to create or filter).
|
||||
- Connect input from MCP Server Trigger node’s `ai_tool` output.
|
||||
|
||||
8. **Create Odoo Tool nodes for Opportunities:**
|
||||
Repeat the same steps as for Contacts but for Opportunities entity:
|
||||
- Operations: Create, Delete, Update, Get one, Get many.
|
||||
- Configure node parameters accordingly.
|
||||
|
||||
9. **Create Odoo Tool nodes for Notes:**
|
||||
Repeat steps for Notes entity:
|
||||
- Operations: Create, Delete, Update, Get one, Get many.
|
||||
- Configure node parameters accordingly.
|
||||
|
||||
10. **Connect MCP Server Trigger node outputs to all Odoo Tool nodes:**
|
||||
- Use ai_tool connections to link MCP Server Trigger node to all Odoo nodes, enabling dynamic dispatch of AI commands.
|
||||
|
||||
11. **Connect AI Agent node outputs:**
|
||||
- Connect AI Agent outputs to MCP Client node, Simple Memory, and OpenAI Chat Model nodes as per roles.
|
||||
- Connect AI Agent outputs back to MCP Server Trigger for tool invocation.
|
||||
|
||||
12. **Test the workflow:**
|
||||
- Trigger via chat or MCP server messages.
|
||||
- Validate that natural language commands correctly invoke Odoo CRM actions.
|
||||
|
||||
---
|
||||
|
||||
### 5. General Notes & Resources
|
||||
|
||||
| Note Content | Context or Link |
|
||||
|-------------------------------------------------------------------------------------------------|----------------------------------------|
|
||||
| This workflow uses Langchain MCP integration in n8n for AI tool orchestration with Odoo CRM. | n8n Langchain MCP documentation |
|
||||
| OpenAI credentials must be properly set to enable the AI chat model functionality. | https://platform.openai.com/docs/api-reference/chat |
|
||||
| Odoo API credentials and URL must have appropriate permissions for CRM operations. | Odoo External API documentation |
|
||||
| Langchain memory buffer helps maintain conversational context for better AI responses. | Langchain Memory Concepts |
|
||||
| MCP Server Trigger enables external AI tool calls; ensure secure webhook exposure. | MCP Server Integration Guide |
|
||||
|
||||
---
|
||||
|
||||
**Disclaimer:**
|
||||
The provided text originates exclusively from an automated workflow created with n8n, a tool for integration and automation. This processing strictly respects applicable content policies and contains no illegal, offensive, or protected elements. All data handled is legal and public.
|
||||
Reference in New Issue
Block a user