{
  "name": "Send AI-personalized LinkedIn outreach from Google Sheets with Azure OpenAI and ConnectSafely",
  "nodes": [
    {
      "id": "bd6b0b21-61ad-4bf1-8ffb-8d2401b264a2",
      "name": "Main Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3472,
        736
      ],
      "parameters": {
        "width": 465,
        "height": 801,
        "content": "### How it works\n\nThis workflow automates personalized LinkedIn outreach for B2B lead generation. It runs daily at 5 PM, fetching prospect data from Google Sheets, generating AI-powered personalized m"
      }
    },
    {
      "id": "31244ebe-798b-4745-a74b-a735df669bcd",
      "name": "Section: Data Retrieval",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2976,
        864
      ],
      "parameters": {
        "width": 280,
        "height": 136,
        "content": "## Data Retrieval\n\nFetches prospect records from Google Sheets that need personalized LinkedIn messages generated."
      }
    },
    {
      "id": "20fd1a9a-3984-42d9-8edf-95285505275d",
      "name": "Section: AI Message Generation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2560,
        864
      ],
      "parameters": {
        "width": 400,
        "height": 136,
        "content": "## AI Message Generation\n\nGenerates personalized LinkedIn messages using AI based on prospect data. Loops through each prospect record and creates contextual outreach messages."
      }
    },
    {
      "id": "4c079ca8-6a7b-4998-acde-d0f2f551196b",
      "name": "Section: Message Validation & Sending",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1584,
        880
      ],
      "parameters": {
        "width": 520,
        "height": 152,
        "content": "## Message Validation & LinkedIn Sending\n\nValidates generated messages exist and are not empty, retrieves profile information via API, then sends personalized messages through ConnectSafely LinkedIn."
      }
    },
    {
      "id": "0e6acc33-aa5c-4001-bff2-8d196b13b05d",
      "name": "Warning: Azure OpenAI",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2320,
        1264
      ],
      "parameters": {
        "width": null,
        "height": 188,
        "content": "⚠️ **Azure OpenAI Credentials Required**\n\nYou must configure Azure OpenAI API credentials with access to the gpt-4o-mini model. Without valid credentials, the AI message generation will fail."
      }
    },
    {
      "id": "e9d3bd40-ba95-4154-94f2-d91fd254d2d4",
      "name": "Warning: ConnectSafely",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        1248
      ],
      "parameters": {
        "width": null,
        "height": 156,
        "content": "⚠️ **ConnectSafely API Required**\n\nThis node requires valid ConnectSafely LinkedIn API credentials. Ensure your API key is active and has permission to send messages."
      }
    },
    {
      "id": "c04c7ee0-0362-4d8d-9ff5-2831c89e725c",
      "name": "Check if Message Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        -2544,
        1024
      ]
    },
    {
      "id": "4a3f686c-f19c-4011-a1c6-903fedfedf3f",
      "name": "Save Generated Message to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1744,
        1024
      ]
    },
    {
      "id": "471ad27b-f257-4a38-86fa-42f909aa6e60",
      "name": "Generate Personalized Message with AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -2096,
        1024
      ]
    },
    {
      "id": "690a96d6-89b7-409b-9a7e-653b32c25aa5",
      "name": "Azure OpenAI GPT-4o-mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        -2032,
        1248
      ]
    },
    {
      "id": "85ec88a4-d964-45cf-ac34-9e4fdbb77783",
      "name": "Validate Message Not Empty",
      "type": "n8n-nodes-base.if",
      "position": [
        -1296,
        1024
      ]
    },
    {
      "id": "18590228-b490-4f8d-a264-cce70c9e2e1a",
      "name": "Fetch Updated Prospect Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1520,
        1024
      ]
    },
    {
      "id": "0bdece18-bbe2-4885-ada7-c773fbb9f91d",
      "name": "Get Prospects from Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2768,
        1024
      ]
    },
    {
      "id": "2723a670-3b73-4b8a-9c7c-3d21bc797aa0",
      "name": "Daily Schedule Trigger (5 PM)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2992,
        1024
      ]
    },
    {
      "id": "10868abb-2447-45c4-9b63-cf492b1ef7b5",
      "name": "Batch Process Prospects",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -2320,
        1024
      ]
    },
    {
      "id": "92ca240b-e5e6-4b76-982f-1fdd8512ed2c",
      "name": "Send LinkedIn Message via ConnectSafely",
      "type": "n8n-nodes-connectsafely-ai.connectSafelyLinkedIn",
      "position": [
        -624,
        1024
      ]
    },
    {
      "id": "0aab6792-d440-4ab6-88d6-82a97ca034c5",
      "name": "Get LinkedIn Profile Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1072,
        1024
      ]
    },
    {
      "id": "1c04d962-a954-41af-b880-e62a40b38479",
      "name": "Extract Profile URN and Identifiers",
      "type": "n8n-nodes-base.code",
      "position": [
        -848,
        1024
      ]
    },
    {
      "id": "6bbf16b7-56fd-4df9-a208-80b07747d537",
      "name": "Update Sheet with Send Status",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -400,
        1024
      ]
    }
  ],
  "connections": {
    "Batch Process Prospects": {
      "main": [
        [],
        [
          {
            "node": "Generate Personalized Message with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Message Exists": {
      "main": [
        [
          {
            "node": "Batch Process Prospects",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Azure OpenAI GPT-4o-mini": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Personalized Message with AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Prospects from Sheet": {
      "main": [
        [
          {
            "node": "Check if Message Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get LinkedIn Profile Data": {
      "main": [
        [
          {
            "node": "Extract Profile URN and Identifiers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Message Not Empty": {
      "main": [
        [
          {
            "node": "Get LinkedIn Profile Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Updated Prospect Data": {
      "main": [
        [
          {
            "node": "Validate Message Not Empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Schedule Trigger (5 PM)": {
      "main": [
        [
          {
            "node": "Get Prospects from Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Generated Message to Sheet": {
      "main": [
        [
          {
            "node": "Fetch Updated Prospect Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Profile URN and Identifiers": {
      "main": [
        [
          {
            "node": "Send LinkedIn Message via ConnectSafely",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Personalized Message with AI": {
      "main": [
        [
          {
            "node": "Save Generated Message to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send LinkedIn Message via ConnectSafely": {
      "main": [
        [
          {
            "node": "Update Sheet with Send Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}