{ "name": "Create Odoo Opportunities from Sales Emails", "tags": [], "nodes": [ { "id": "create-odoo-opportunities-from-sales-emails-0", "name": "Received Emails with Sales Label", "type": "n8n-nodes-base.gmailTrigger", "position": [ 760, 540 ], "parameters": { "simple": false, "filters": { "labelIds": [ "YOUR_SALES_LABEL_ID" ] }, "options": {}, "pollTimes": { "item": [ { "mode": "everyHour" } ] }, "maxResults": 25 }, "typeVersion": 1.4 }, { "id": "create-odoo-opportunities-from-sales-emails-1", "name": "Odoo - Create Opportunity", "type": "n8n-nodes-base.odoo", "position": [ 1500, 540 ], "parameters": { "resource": "custom", "operation": "create", "customResource": "crm.lead", "fieldsToCreateOrUpdate": { "fields": [ { "fieldName": "type", "fieldValue": "opportunity" }, { "fieldName": "name", "fieldValue": "={{ $('Received Emails with Sales Label').all()[$itemIndex].json.headers.subject }}" }, { "fieldName": "email_from", "fieldValue": "={{ $('Received Emails with Sales Label').all()[$itemIndex].json.from.value[0].address }}" }, { "fieldName": "description", "fieldValue": "={{ $json.response.text }}" } ] } }, "typeVersion": 1 }, { "id": "create-odoo-opportunities-from-sales-emails-2", "name": "OpenAI Model", "type": "@n8n/n8n-nodes-langchain.lmOpenAi", "position": [ 1040, 720 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-3.5-turbo-instruct" }, "options": {} }, "typeVersion": 1 }, { "id": "create-odoo-opportunities-from-sales-emails-3", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 700, 220 ], "parameters": { "width": 446.44549763033154, "height": 261.8821936357484, "content": "## Summarize emails and save them as notes on sales opportunity in Odoo\n\nSet up steps:\n* Configure Google Cloud credentials with Gmail access\n* Configure OpenAI credentials\n* Configure Odoo credentials\n " }, "typeVersion": 1 }, { "id": "create-odoo-opportunities-from-sales-emails-4", "name": "Summarize Email Content", "type": "@n8n/n8n-nodes-langchain.chainSummarization", "position": [ 1060, 540 ], "parameters": { "options": { "summarizationMethodAndPrompts": { "values": { "prompt": "=Write a concise summary of the following sales inquiry:\n\" {{ $json.text }}\"\nInclude structured information such as project budget, timelines, industry and a general summary\n\nCONCISE SUMMARY: \n", "combineMapPrompt": "=Write a concise summary of the following sales inquiry:\n\"{{ $json.text }}\"\nExtract information such as project budget, timelines and a general summary.\n\nCONCISE SUMMARY: \n" } } } }, "typeVersion": 2 } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1" }, "connections": { "OpenAI Model": { "ai_languageModel": [ [ { "node": "Summarize Email Content", "type": "ai_languageModel", "index": 0 } ] ] }, "Summarize Email Content": { "main": [ [ { "node": "Odoo - Create Opportunity", "type": "main", "index": 0 } ] ] }, "Received Emails with Sales Label": { "main": [ [ { "node": "Summarize Email Content", "type": "main", "index": 0 } ] ] } } }