{
  "name": "Generate personalized promotion emails with GPT-5 and Gmail context analysis",
  "nodes": [
    {
      "id": "c04097b9-35c6-4f01-b682-32980a0c5cb9",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1312,
        -48
      ]
    },
    {
      "id": "7a5432e1-664a-4e5e-9c2d-2aaa6a5385a8",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -848,
        0
      ]
    },
    {
      "id": "e6651a73-b581-4931-93a8-a593ddcb3112",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -112,
        -48
      ]
    },
    {
      "id": "da89fd67-8610-4417-ab06-8fd0a0a3c39d",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        -352,
        -48
      ]
    },
    {
      "id": "b2eae486-85dd-42c7-a128-6d62a0a67540",
      "name": "ConvertToText",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        -16
      ]
    },
    {
      "id": "077eff45-b5fd-4b5c-8834-6b9523f16646",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        912,
        48
      ]
    },
    {
      "id": "814cee2e-26df-446a-9e28-b706898e9112",
      "name": "SystemPrompt",
      "type": "n8n-nodes-base.code",
      "position": [
        704,
        48
      ]
    },
    {
      "id": "f2d8a1be-dd1c-4db8-8dd1-16a54d29a26f",
      "name": "Create a draft",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1488,
        208
      ]
    },
    {
      "id": "d5dfff03-723f-4146-bfdd-7f65c6a49804",
      "name": "PreviousMessagesByContact",
      "type": "n8n-nodes-base.gmail",
      "position": [
        128,
        48
      ]
    },
    {
      "id": "deec3535-343a-436d-9b09-f164f48fc5c7",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        864,
        224
      ]
    },
    {
      "id": "c36e34af-c835-43d2-97a8-9fc0df87df32",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        976,
        256
      ]
    },
    {
      "id": "21335279-7761-42d5-bb74-0289258ab0ee",
      "name": "AutomatizationHelper",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -848,
        -176
      ]
    },
    {
      "id": "0084e9e7-f87b-4b14-8c04-efd91c61ddcf",
      "name": "Contacts",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -1056,
        0
      ]
    },
    {
      "id": "9ce4bf96-a601-4149-8df0-3abbfef16d50",
      "name": "MatchingByLanguage",
      "type": "n8n-nodes-base.merge",
      "position": [
        -560,
        -48
      ]
    },
    {
      "id": "75cec581-56aa-4139-9b15-b6f281df0e72",
      "name": "ProcessingOutput",
      "type": "n8n-nodes-base.code",
      "position": [
        1248,
        48
      ]
    },
    {
      "id": "d35579fe-5ea8-4360-a061-592619851fdf",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        192,
        -336
      ]
    },
    {
      "id": "5bbb0a3b-d48a-4b91-9d68-5e302e83270c",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        320,
        48
      ]
    },
    {
      "id": "051869cd-54da-4cba-b933-94c993c264ce",
      "name": "Default",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        144
      ]
    },
    {
      "id": "da2a6b0d-52dd-4eea-8c35-3ebd0128a7eb",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        976,
        448
      ]
    },
    {
      "id": "ef9bce2d-4c1e-41ba-9bc0-0bbcd1ecae0f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        160
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "03133ca0-0739-4eb7-b516-9a3b74f324f8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        -400
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "b81e9233-b24c-4ab1-993b-f6c8f6ef1e69",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        -160
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "ddfb6067-d714-4b09-b2c1-f9ab17bacb3f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -208
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "a7c74c78-c4c7-4128-9ea9-068ec4a524a9",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        928,
        -208
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "702a3118-95da-4bdc-8471-ff1a110718e2",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1456,
        -32
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "7e4a3245-490d-4690-8cc8-e2900a6e6aa2",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1424,
        -560
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "c665efbf-e074-4838-bfc4-c5e4c021bbed",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -432
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "ConvertToText",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Default",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default": {
      "main": [
        [
          {
            "node": "SystemPrompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Contacts": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SystemPrompt": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ConvertToText": {
      "main": [
        [
          {
            "node": "SystemPrompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a draft": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "ProcessingOutput",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "PreviousMessagesByContact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ProcessingOutput": {
      "main": [
        [
          {
            "node": "Create a draft",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "MatchingByLanguage",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "MatchingByLanguage": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AutomatizationHelper": {
      "main": [
        [
          {
            "node": "MatchingByLanguage",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "PreviousMessagesByContact": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Contacts",
            "type": "main",
            "index": 0
          },
          {
            "node": "AutomatizationHelper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}