{
  "id": "5RFmm8vrn1I8fFGE",
  "meta": {
    "instanceId": "d7661a849ead114a9aa6d9ceaf4160465aeb79532a35bde62160c840ffba9fc8"
  },
  "name": "1. LI Connection Request System: Trigger PhantomBuster Agent",
  "tags": [
    {
      "id": "l8MPK4ZirgwFWMno",
      "name": "N8N Course",
      "createdAt": "2025-01-23T18:12:52.273Z",
      "updatedAt": "2025-01-23T18:12:52.273Z"
    }
  ],
  "nodes": [
    {
      "id": "sticky-note-1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        -280
      ],
      "parameters": {
        "width": 350,
        "height": 180,
        "content": "## 🎯 STEP 1: Natural Language Lead Targeting\n\nThis form allows you to describe your ideal prospects in plain English. The AI will automatically convert your description into a properly formatted Apollo search URL.\n\n**Example Input:**\n\"Creative agencies in the US with 1-100 employees, targeting CEOs and founders\"\n\n**Result:** Generates precise Apollo search parameters for lead discovery"
      },
      "typeVersion": 1
    },
    {
      "id": "sticky-note-2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        -320
      ],
      "parameters": {
        "width": 380,
        "height": 180,
        "content": "## 🔍 STEP 2: Apollo Lead Extraction\n\nThis section processes your audience and extracts targeted leads:\n\n1. **Generate Search URL**: AI converts plain English to Apollo search parameters\n2. **Run Apify Actor**: Scrapes Apollo for up to 500 leads matching your criteria\n3. **Limit**: Controls batch size for testing (adjust for production)\n\n**Output:** LinkedIn profiles, emails, job titles, and employment history"
      },
      "typeVersion": 1
    },
    {
      "id": "sticky-note-3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        900,
        -320
      ],
      "parameters": {
        "width": 380,
        "height": 180,
        "content": "## 🧠 STEP 3: AI Personalization Engine\n\nCreates custom icebreakers for each prospect:\n\n**Personalize Outreach**: Analyzes LinkedIn profile data (job history, company, location) and generates human-like connection request messages using proven templates.\n\n**Template:** \"Hey {name}, loved seeing {specific_detail}. I'm also into {relevant_connection}, thought I'd connect.\"\n\n**Key:** Never uses exact LinkedIn data - always paraphrases for authenticity"
      },
      "typeVersion": 1
    },
    {
      "id": "sticky-note-4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1400,
        -320
      ],
      "parameters": {
        "width": 380,
        "height": 180,
        "content": "## 📋 STEP 4: Outreach Execution\n\nFinal automation steps:\n\n1. **Add to Google Sheet**: Stores all lead data and icebreakers for tracking\n2. **Aggregate**: Combines individual leads into batch for PhantomBuster\n3. **Trigger PhantomBuster**: Launches LinkedIn connection campaign with personalized messages\n\n**Important:** Start with 5-10 connections daily. LinkedIn limits to ~100/week to avoid restrictions."
      },
      "typeVersion": 1
    },
    {
      "id": "2419d138-c9f7-494b-b84f-7bd8158aef28",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        0,
        0
      ],
      "webhookId": "ecb5116a-1434-45b5-8f38-31393735a1b8",
      "parameters": {
        "options": {},
        "formTitle": "LinkedIn Lead Outreach Trigger",
        "formFields": {
          "values": [
            {
              "fieldType": "textarea",
              "fieldLabel": "Describe your audience in plain English.",
              "placeholder": "Company type, location, etc",
              "requiredField": true
            }
          ]
        },
        "authentication": "basicAuth",
        "formDescription": "Insert an audience for your LinkedIn Outreach Campaign here."
      },
      "credentials": {
        "httpBasicAuth": {
          "id": "credential-id",
          "name": "httpBasicAuth Credential"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "893e5e59-ddac-480e-9666-cfc4eacf993e",
      "name": "Run Apify Actor & Get Results",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        580,
        0
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/jljBwyyQakqrL1wae/run-sync-get-dataset-items",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"getPersonalEmails\": true,\n    \"getWorkEmails\": true,\n    \"totalRecords\": 500,\n    \"url\": \"{{ $json.message.content.searchUrl }}\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            },
            {
              "name": "Authorization",
              "value": "Bearer <your-apify-api-key-here>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2050e13d-55be-4669-b805-d2210fb364ba",
      "name": "Generate Search URL",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        220,
        0
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.5-preview",
          "cachedResultName": "GPT-4.5-PREVIEW"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You're a helpful, intelligent sales assistant."
            },
            {
              "content": "Your task is to take as input a natural language description of a prospect audience, and turn that into an Apollo Search URL.\n\nHere's an example of an Apollo Search URL:\n\nhttps://app.apollo.io/#/people?personLocations[]=United%20States&sortAscending=false&sortByField=%5Bnone%5D&personTitles[]=owner&personTitles[]=ceo&personTitles[]=founder&personTitles[]=partner&page=1&qKeywords=creative%20agency&organizationNumEmployeesRanges[]=1%2C200\n\nThis URL describes a search for people that are\n- Located in the United States.\n- Hold the titles: Owner, CEO, Founder, or Partner.\n- Have a keyword association with “creative agency”.\n\nThese are the fields you can change:\n\norganizationLocations[], Keywords, personTitles[], and organizationNumEmployeesRanges[]\n\nDo not add or change any other fields. Use the above template\n\nReturn your response in JSON using this format:\n\n{\"searchUrl\":\"search url goes here\"}"
            },
            {
              "content": "={{ $json['Describe your audience in plain English.'] }}"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "id": "credential-id",
          "name": "openAiApi Credential"
        }
      },
      "typeVersion": 1.6
    },
    {
      "id": "97bf46ab-1900-4dc3-be9e-bf4c1a40190a",
      "name": "Limit",
      "type": "n8n-nodes-base.limit",
      "position": [
        780,
        0
      ],
      "parameters": {
        "maxItems": 3
      },
      "typeVersion": 1
    },
    {
      "id": "1065dcfe-a305-43fe-97e5-7ad2c3bfb163",
      "name": "Trigger PhantomBuster Agent",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1780,
        0
      ],
      "parameters": {
        "url": "https://api.phantombuster.com/api/v2/agents/launch",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "id",
              "value": "4108795702201397"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Phantombuster-Key",
              "value": "<your-phantombuster-api-key-here>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c407a69a-a9b9-49dd-a5c5-8ca9b530b358",
      "name": "Add to Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1340,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "id": "={{ $('Limit').item.json.id }}",
            "name": "={{ $('Limit').item.json.name }}",
            "title": "={{ $('Limit').item.json.title }}",
            "last_name": "={{ $('Limit').item.json.last_name }}",
            "photo_url": "={{ $('Limit').item.json.photo_url }}",
            "first_name": "={{ $('Limit').item.json.first_name }}",
            "icebreaker": "={{ $json.message.content.icebreaker }}",
            "email_status": "={{ $('Limit').item.json.email_status }}",
            "linkedin_url": "={{ $('Limit').item.json.linkedin_url }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "first_name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "first_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "last_name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "last_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "linkedin_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "email_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "photo_url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "photo_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "icebreaker",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "icebreaker",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ]
        },
        "options": {
          "useAppend": true
        },
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/12VzSF9drN_kWYsGhNjir9hAGCE0k56N7HkfAV8EuI7Q/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "12VzSF9drN_kWYsGhNjir9hAGCE0k56N7HkfAV8EuI7Q",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/12VzSF9drN_kWYsGhNjir9hAGCE0k56N7HkfAV8EuI7Q/edit?usp=drivesdk",
          "cachedResultName": "Leads"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "credential-id",
          "name": "googleSheetsOAuth2Api Credential"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "04290792-010b-43da-b606-74e15185312d",
      "name": "Personalize Outreach",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        980,
        0
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "GPT-4O"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a helpful, intelligent writing assistant."
            },
            {
              "content": "Your task is to take as input a bunch of LinkedIn profile information of a user, and then generate a very short, very punchy icebreaker that I can use as a variable in my connection request.\n\nReturn your results in this format:\n\n{\"icebreaker\":\"Icebreaker goes here\"}\n\nIn order to ensure icebreakers are punchy and high-quality, make them follow this template:\n\nHey {{name}}, loved seeing {{thingAboutThem}}. I'm also into {{plausibleTieIn}}, thought I'd connect.\n\nFor {{thingAboutThem}} and {{plausibleTieIn}}, never use the exact information provided in a LinkedIn field. Instead, always paraphrase. This makes it seem human written, instead of just an automated message. Also, make it super short. Don't say stuff like \"passionate about turning vision into reality\" or anything like that—be extremely laconic and spartan."
            },
            {
              "content": "{\"linkedInFields\":\"Danielle Morgan, Fort Lauderdale, Founder & CEO at DM Creative Agency, previous experience: Regional Sales Director at Out East Eyewear, Account Director at Radancy\"}"
            },
            {
              "role": "assistant",
              "content": "{\n  \"icebreaker\": \"Hey Danielle, loved seeing your creative agency journey. I'm also building brands, thought I'd connect.\"\n}"
            },
            {
              "content": "={\"linkedInFields\":\"{{ $json.first_name }} {{ $json.last_name }}, {{ $json.city }}, {{ $json.title }} at {{ $json.employment_history[0].organization_name }}, previous experience: {{ $json.employment_history[1].title }} at {{ $json.employment_history[1].organization_name }}, {{ $json.employment_history[2].title }} at {{ $json.employment_history[2].organization_name }}\"} "
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "id": "credential-id",
          "name": "openAiApi Credential"
        }
      },
      "typeVersion": 1.6
    },
    {
      "id": "3e677add-7bee-4fbf-bff1-b7ea9ae51be6",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1560,
        0
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "801b4eef-45ec-4651-b4cd-b82178d93264",
  "connections": {
    "Limit": {
      "main": [
        [
          {
            "node": "Personalize Outreach",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Trigger PhantomBuster Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Generate Search URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to Google Sheet": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Search URL": {
      "main": [
        [
          {
            "node": "Run Apify Actor & Get Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Personalize Outreach": {
      "main": [
        [
          {
            "node": "Add to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Apify Actor & Get Results": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}