{
  "name": "Save New Sales Opportunities",
  "nodes": [
    {
      "id": "64b02b70-e7f2-4df0-852f-b6959af8d8c5",
      "name": "Received Emails with Sales Label",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        760,
        540
      ],
      "parameters": {
        "simple": false,
        "filters": {
          "labelIds": [
            "Label_8035866011660570111"
          ]
        },
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyHour"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "6dca3c61-98ba-4d18-bc5c-9c762e12f13b",
      "name": "Odoo - Create Opportunity",
      "type": "n8n-nodes-base.odoo",
      "position": [
        1500,
        540
      ],
      "parameters": {
        "resource": "opportunity",
        "opportunityName": "={{ $('Received Emails with Sales Label').item.json.headers.subject }}",
        "additionalFields": {
          "email_from": "={{ $('Received Emails with Sales Label').item.json.from.value[0].address }}",
          "description": "={{ $json.response.text }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a57e0e51-50d3-49de-8dc6-6fe592604765",
      "name": "OpenAI Model",
      "type": "@n8n/n8n-nodes-langchain.lmOpenAi",
      "position": [
        1040,
        720
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "REPLACE_WITH_RESOURCE"
        },
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "a6de25a3-3967-4957-bc98-4cb774a53dda",
      "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": "8705b4de-1334-4ff2-8d5d-60ec96cfb8cd",
      "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
    },
    {
      "id": "da7a60f5-b13a-5d5f-b04c-9d43f313ffdc",
      "name": "Publication · Overview and setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -800,
        0
      ],
      "parameters": {
        "content": "# Save New Sales Opportunities\n\n## Purpose and structure\nThis folder contains the **Save New Sales Opportunities** workflow. Its executable nodes use `chainSummarization`, `gmailTrigger`, `lmOpenAi`, `odoo`. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.\n\n## Setup\nImport inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.\n\n## Entry points\nReceived Emails with Sales Label\n\n## Verification\nSanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.\n\n## Attribution\nhttps://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Gmail/1565_Gmail_Stickynote_Create_Triggered.json\nMIT; preserve source notices.",
        "width": 700,
        "height": 800,
        "color": 1
      }
    }
  ],
  "active": false,
  "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
          }
        ]
      ]
    }
  }
}
