{
  "name": "Automate email tracking & generate pixel for lead nurturing with Google Sheet",
  "nodes": [
    {
      "id": "2cde4e1b-498d-473c-8275-d5fbdaa87cea",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -256,
        -544
      ]
    },
    {
      "id": "b94e5896-b9a0-48b0-b7c4-d63b057eb51e",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -272,
        32
      ]
    },
    {
      "id": "daaea3b2-7206-4db6-b55b-5d5b9ab2e750",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        496,
        -128
      ]
    },
    {
      "id": "6ae5b2fa-378a-4f23-ac73-24b07eaa6e93",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        704,
        -352
      ]
    },
    {
      "id": "2fee2a5d-f761-4abe-acf6-c8e12fe6abba",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        208,
        -544
      ]
    },
    {
      "id": "813526d1-3e10-4c06-adfd-3d332b4bda4a",
      "name": "Get CRM",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        0,
        -544
      ]
    },
    {
      "id": "de323153-3e9d-4937-98f1-1ce9bbbff51a",
      "name": "Generate Pixel",
      "type": "n8n-nodes-base.set",
      "position": [
        480,
        -528
      ]
    },
    {
      "id": "79f1dc9b-7694-4fe2-a008-3714361ac97f",
      "name": "Email Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        720,
        -528
      ]
    },
    {
      "id": "abe94c92-a340-4bf8-a964-8902d738c1c8",
      "name": "Send email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1072,
        -528
      ]
    },
    {
      "id": "a1063c9e-ea92-46c0-b97e-da0933d37fc4",
      "name": "Update CRM",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1296,
        -528
      ]
    },
    {
      "id": "afc85c64-f00c-4424-8344-aa8696fcdf96",
      "name": "Create data pixel in base64",
      "type": "n8n-nodes-base.set",
      "position": [
        -32,
        32
      ]
    },
    {
      "id": "e0331f99-3f3b-4726-a116-38ab1a460baf",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -1264
      ],
      "parameters": {
        "width": 944,
        "height": 528,
        "content": "## Automate Email Tracking & Generate Pixel for Lead Nurturing\n\nThis workflow automates the process of sending personalized lead-nurturing emails and tracking when each recipient opens the message thr"
      }
    },
    {
      "id": "0985436f-d56b-43a1-83b1-d74152b03c83",
      "name": "Create pixel image",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        256,
        32
      ]
    },
    {
      "id": "f4a9d59d-25ec-428a-bfd3-bea81fe5a181",
      "name": "Get vars",
      "type": "n8n-nodes-base.set",
      "position": [
        480,
        160
      ]
    },
    {
      "id": "575935b6-4709-4146-93ee-c6bd47215cad",
      "name": "Update Open email 1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        720,
        160
      ]
    },
    {
      "id": "674a755d-2c6f-480b-88bb-54efd4d9d193",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -704
      ],
      "parameters": {
        "width": 480,
        "height": 432,
        "content": "## STEP 2 - Set webook url\n\nSet webook url from the node trigger sottostante. Fai attenzione che se inserisci l'ulr del webhook di produzione devi attivare il WF per fare in modo che triggeri"
      }
    },
    {
      "id": "0a088b0d-417c-472e-9e72-8975678df607",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -704
      ],
      "parameters": {
        "width": 448,
        "height": 432,
        "content": "## STEP 1 - Clone CRM in Google Sheet\n\n[Clone this sheet](https://docs.google.com/spreadsheets/d/1zgmgqTW3IVfI9BqCGyXHvDj1F80Yn8ibuwAjT-cxSmM/edit?usp=sharing) e compila i campi \"Data\", \"First Name\", "
      }
    },
    {
      "id": "a106a081-0da8-484b-a667-b3cb35300454",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        -704
      ],
      "parameters": {
        "width": 768,
        "height": 432,
        "content": "## STEP 3 - Generate and send Email 1\n\nSet webook url from the node trigger sottostante. Fai attenzione che se inserisci l'ulr del webhook di produzione devi attivare il WF per fare in modo che trigge"
      }
    },
    {
      "id": "7ef059a0-164a-4a41-96cc-6da417f1b480",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -128
      ],
      "parameters": {
        "width": 704,
        "height": 448,
        "content": "## STEP 4\nWhen the image is loaded by the recipient's email client, the webhook is triggered, capturing the pixel_id and the email to identify who opened the email"
      }
    },
    {
      "id": "6c3296ec-d145-4ab7-8cb4-0e251d8e149b",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        48
      ],
      "parameters": {
        "width": 496,
        "height": 272,
        "content": "## STEP 5 - Update CRM\nUpdate the lead who opened the email"
      }
    }
  ],
  "connections": {
    "Get CRM": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Create data pixel in base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get vars": {
      "main": [
        [
          {
            "node": "Update Open email 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send email": {
      "main": [
        [
          {
            "node": "Update CRM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update CRM": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Agent": {
      "main": [
        [
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Pixel": {
      "main": [
        [
          {
            "node": "Email Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Generate Pixel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Email Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create pixel image": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get vars",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create data pixel in base64": {
      "main": [
        [
          {
            "node": "Create pixel image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get CRM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}