{
  "id": "hNLQWQnsasikgoM6",
  "meta": {
    "builderVariant": "mcp",
    "aiBuilderAssisted": true
  },
  "name": "LinkedIn Outreach Automation - Personalized Connect, Track & Follow-up (Airtable + Unipile + AI)",
  "tags": [],
  "nodes": [
    {
      "id": "dcb8c985-2e61-41fa-b173-02a4e314ee48",
      "name": "Every Weekday 09:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -80,
        400
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "f0c684db-af33-4a21-b569-1dabcda3dfa0",
      "name": "Set Config",
      "type": "n8n-nodes-base.set",
      "position": [
        144,
        400
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cfg1",
              "name": "accountId",
              "type": "string",
              "value": "REPLACE_WITH_UNIPILE_ACCOUNT_ID"
            },
            {
              "id": "cfg2",
              "name": "dsn",
              "type": "string",
              "value": "YOUR_DSN"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "11d5b7c6-5b8a-48c8-aa70-e10aacb226b8",
      "name": "Fetch New Leads",
      "type": "n8n-nodes-base.airtable",
      "maxTries": 3,
      "position": [
        368,
        400
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appN6QjcbVPERZgtx"
        },
        "limit": 15,
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblFuMN1Kx40tKIkY"
        },
        "options": {},
        "operation": "search",
        "returnAll": false,
        "filterByFormula": "{Connection Status}='New'"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "13b98ea0-72f0-47ff-8999-0acd1bf8194d",
      "name": "All Leads Processed",
      "type": "n8n-nodes-base.noOp",
      "position": [
        832,
        48
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "db6c49e7-1447-4aac-9f4d-a9386306ba34",
      "name": "Prepare Identifier",
      "type": "n8n-nodes-base.set",
      "position": [
        848,
        336
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "h1",
              "name": "handle",
              "type": "string",
              "value": "={{ (() => { const pid = ($json[\"Public Identifier\"] || \"\").trim(); if (pid) return pid; const url = ($json[\"LinkedIn URL\"] || \"\"); const seg = url.split(\"/in/\")[1]; return seg ? seg.split(/[/?#]/)[0] : \"\"; })() }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "fb0c1a96-1e52-4151-a196-d54d7d9ff1b0",
      "name": "Get LinkedIn Profile",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "maxTries": 3,
      "position": [
        1088,
        336
      ],
      "parameters": {
        "url": "=https://{{ $('Set Config').first().json.dsn }}/api/v1/users/{{ encodeURIComponent($json.handle) }}",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "queryParameters": {
          "parameters": [
            {
              "name": "account_id",
              "value": "={{ $('Set Config').first().json.accountId }}"
            },
            {
              "name": "linkedin_sections",
              "value": "*"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "unipileApi"
      },
      "credentials": {
        "unipileApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.4,
      "waitBetweenTries": 5000
    },
    {
      "id": "9fdddee9-f438-44d3-b114-ccc18a985fef",
      "name": "Write Connection Note",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1456,
        192
      ],
      "parameters": {
        "text": "=Prospect details:\nName: {{ $('Prepare Identifier').item.json.Name || $('Get LinkedIn Profile').item.json.first_name || 'there' }}\nHeadline: {{ $('Get LinkedIn Profile').item.json.headline || $('Prepare Identifier').item.json.Headline || '' }}\nAbout: {{ ($('Get LinkedIn Profile').item.json.summary || $('Get LinkedIn Profile').item.json.about || '').slice(0, 500) }}\nCompany: {{ $('Prepare Identifier').item.json.Company || '' }}\n\nWrite the connection note now (max 280 characters, output only the note).",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "You are an expert B2B LinkedIn outreach copywriter writing on behalf of a company that builds done-for-you AI outreach and lead-generation automations for founders, agencies and sales teams.\n\nWrite ONE personalized LinkedIn connection-request note to the prospect described by the user.\n\nHard rules:\n- MAXIMUM 280 characters. This is critical and non-negotiable.\n- Output ONLY the note text. No quotes, no preamble, no sign-off, no emojis.\n- Sound warm, human and peer-to-peer. Never salesy. Avoid buzzwords like synergy, game-changer, revolutionary.\n- Reference something specific from their headline, role or about section so it feels personal.\n- Add one light line hinting you help teams automate their outreach and lead-gen. No hard pitch, no links, no book-a-call ask.\n- If profile info is thin, stay genuine and brief. Never invent facts about them."
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.9
    },
    {
      "id": "979191bd-8d8e-441f-ab9d-abde15e828d7",
      "name": "Note Writer Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1392,
        384
      ],
      "parameters": {
        "model": "anthropic/claude-sonnet-4.6",
        "options": {
          "maxTokens": 400,
          "temperature": 0.6
        }
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a84a9b1e-3965-4a06-a421-9e03d4818360",
      "name": "Note Schema (max 300)",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1520,
        352
      ],
      "parameters": {
        "autoFix": true,
        "schemaType": "manual",
        "inputSchema": "{\"type\":\"object\",\"properties\":{\"note\":{\"type\":\"string\",\"minLength\":1,\"maxLength\":300}},\"required\":[\"note\"],\"additionalProperties\":false}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "42e886ce-63a4-4dbb-a75e-baba617732a8",
      "name": "Note Fixer Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1552,
        544
      ],
      "parameters": {
        "model": "anthropic/claude-sonnet-4.6",
        "options": {
          "maxTokens": 400,
          "temperature": 0.2
        }
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "96cd11b3-fd5a-423e-b68e-45863eaa11c2",
      "name": "Enforce Char Limit",
      "type": "n8n-nodes-base.set",
      "position": [
        1904,
        288
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "g1",
              "name": "note",
              "type": "string",
              "value": "={{ (() => { const n = ($json.output && $json.output.note) || $json.note || $json.text || ''; return n.length <= 300 ? n.trim() : n.slice(0, 300).replace(/\\s+\\S*$/, '').trim(); })() }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9369ae44-e001-47e2-9e79-77ece51badec",
      "name": "Send Connection Request",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "maxTries": 3,
      "position": [
        2160,
        288
      ],
      "parameters": {
        "url": "=https://{{ $('Set Config').first().json.dsn }}/api/v1/users/invite",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"account_id\": $('Set Config').first().json.accountId, \"provider_id\": $('Get LinkedIn Profile').item.json.provider_id, \"message\": $json.note } }}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "unipileApi"
      },
      "credentials": {
        "unipileApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.4,
      "waitBetweenTries": 5000
    },
    {
      "id": "d61684b6-5b98-453f-af17-cd742ca2c832",
      "name": "Log Request Sent",
      "type": "n8n-nodes-base.airtable",
      "maxTries": 3,
      "position": [
        2480,
        176
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appN6QjcbVPERZgtx"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblFuMN1Kx40tKIkY"
        },
        "columns": {
          "value": {
            "id": "={{ $('Prepare Identifier').item.json.id }}",
            "Headline": "={{ $('Get LinkedIn Profile').item.json.headline || '' }}",
            "Provider ID": "={{ $('Get LinkedIn Profile').item.json.provider_id || '' }}",
            "About Summary": "={{ $('Get LinkedIn Profile').item.json.summary || '' }}",
            "Invitation ID": "={{ $json.invitation_id || $json.id || '' }}",
            "Campaign Status": "Active",
            "Connection Note": "={{ $('Enforce Char Limit').item.json.note }}",
            "Request Sent At": "={{ $now.toISO() }}",
            "Connection Status": "Request Sent",
            "Public Identifier": "={{ $('Prepare Identifier').item.json.handle }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "LinkedIn URL",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "LinkedIn URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Public Identifier",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Public Identifier",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Provider ID",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Provider ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Headline",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Headline",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "About Summary",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "About Summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Company",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Job Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Connection Note",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Connection Note",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Connection Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "New",
                  "value": "New"
                },
                {
                  "name": "Request Sent",
                  "value": "Request Sent"
                },
                {
                  "name": "Accepted",
                  "value": "Accepted"
                },
                {
                  "name": "Declined/Expired",
                  "value": "Declined/Expired"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Connection Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reply Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "No Reply",
                  "value": "No Reply"
                },
                {
                  "name": "Replied",
                  "value": "Replied"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Reply Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Campaign Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Active",
                  "value": "Active"
                },
                {
                  "name": "Completed",
                  "value": "Completed"
                },
                {
                  "name": "Stopped (Replied)",
                  "value": "Stopped (Replied)"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Campaign Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Invitation ID",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Invitation ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Chat ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Chat ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Request Sent At",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Request Sent At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Accepted At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Accepted At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Replied At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Replied At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up 1 Sent At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up 1 Sent At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up 2 Sent At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up 2 Sent At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up Count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Message Received",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Last Message Received",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Error",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Last Error",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Notes",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Notes",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "typecast": true
        },
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "bd615ee7-7dc6-4dd8-8ce6-f1e8412f0a54",
      "name": "Human-like Delay",
      "type": "n8n-nodes-base.wait",
      "position": [
        2912,
        464
      ],
      "parameters": {
        "amount": "={{ Math.floor(Math.random() * 61) + 30 }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "30e439e7-73a8-4b3c-a2a5-a193722529e8",
      "name": "Log Profile Error",
      "type": "n8n-nodes-base.airtable",
      "maxTries": 3,
      "position": [
        2688,
        528
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appN6QjcbVPERZgtx"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblFuMN1Kx40tKIkY"
        },
        "columns": {
          "value": {
            "id": "={{ $('Prepare Identifier').item.json.id }}",
            "Last Error": "={{ $json.error && $json.error.message ? $json.error.message : 'Profile fetch failed' }}",
            "Campaign Status": "Error",
            "Connection Status": "Error"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "LinkedIn URL",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "LinkedIn URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Public Identifier",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Public Identifier",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Provider ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Provider ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Headline",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Headline",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "About Summary",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "About Summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Company",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Job Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Connection Note",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Connection Note",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Connection Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "New",
                  "value": "New"
                },
                {
                  "name": "Request Sent",
                  "value": "Request Sent"
                },
                {
                  "name": "Accepted",
                  "value": "Accepted"
                },
                {
                  "name": "Declined/Expired",
                  "value": "Declined/Expired"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Connection Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reply Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "No Reply",
                  "value": "No Reply"
                },
                {
                  "name": "Replied",
                  "value": "Replied"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Reply Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Campaign Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Active",
                  "value": "Active"
                },
                {
                  "name": "Completed",
                  "value": "Completed"
                },
                {
                  "name": "Stopped (Replied)",
                  "value": "Stopped (Replied)"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Campaign Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Invitation ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Invitation ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Chat ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Chat ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Request Sent At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Request Sent At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Accepted At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Accepted At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Replied At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Replied At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up 1 Sent At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up 1 Sent At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up 2 Sent At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up 2 Sent At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up Count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Message Received",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Last Message Received",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Error",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Last Error",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Notes",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Notes",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "typecast": true
        },
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "62a83c82-9911-43db-9cd9-6c665b2be839",
      "name": "Log Send Error",
      "type": "n8n-nodes-base.airtable",
      "maxTries": 3,
      "position": [
        2512,
        368
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appN6QjcbVPERZgtx"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblFuMN1Kx40tKIkY"
        },
        "columns": {
          "value": {
            "id": "={{ $('Prepare Identifier').item.json.id }}",
            "Last Error": "={{ $json.error && $json.error.message ? $json.error.message : 'Connection request failed' }}",
            "Campaign Status": "Error",
            "Connection Status": "Error"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "LinkedIn URL",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "LinkedIn URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Public Identifier",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Public Identifier",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Provider ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Provider ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Headline",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Headline",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "About Summary",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "About Summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Company",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Job Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Connection Note",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Connection Note",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Connection Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "New",
                  "value": "New"
                },
                {
                  "name": "Request Sent",
                  "value": "Request Sent"
                },
                {
                  "name": "Accepted",
                  "value": "Accepted"
                },
                {
                  "name": "Declined/Expired",
                  "value": "Declined/Expired"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Connection Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reply Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "No Reply",
                  "value": "No Reply"
                },
                {
                  "name": "Replied",
                  "value": "Replied"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Reply Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Campaign Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Active",
                  "value": "Active"
                },
                {
                  "name": "Completed",
                  "value": "Completed"
                },
                {
                  "name": "Stopped (Replied)",
                  "value": "Stopped (Replied)"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Campaign Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Invitation ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Invitation ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Chat ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Chat ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Request Sent At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Request Sent At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Accepted At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Accepted At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Replied At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Replied At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up 1 Sent At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up 1 Sent At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up 2 Sent At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up 2 Sent At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up Count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Message Received",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Last Message Received",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Error",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Last Error",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Notes",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Notes",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "typecast": true
        },
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "f7429bda-f1e2-42d9-b12c-ee4df6ce0f7e",
      "name": "Loop Over Leads",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        592,
        400
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "e515b2de-4665-4d24-ae4f-1d7a95a24cd9",
      "name": "New Relation Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -48,
        1216
      ],
      "parameters": {
        "path": "unipile-new-relation",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "39652197-fa63-4574-879e-cec0283ddfef",
      "name": "Extract Relation",
      "type": "n8n-nodes-base.set",
      "position": [
        176,
        1216
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "r1",
              "name": "providerId",
              "type": "string",
              "value": "={{ $json.body?.user_provider_id ?? $json.body?.provider_id ?? $json.body?.data?.user_provider_id ?? $json.body?.data?.provider_id ?? $json.body?.relation?.provider_id ?? $json.user_provider_id ?? $json.provider_id ?? '' }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "4ce57f59-8a6e-4290-936f-88064a6c1100",
      "name": "Find Pending Lead",
      "type": "n8n-nodes-base.airtable",
      "maxTries": 3,
      "position": [
        400,
        1216
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appN6QjcbVPERZgtx"
        },
        "limit": 1,
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblFuMN1Kx40tKIkY"
        },
        "options": {},
        "operation": "search",
        "returnAll": false,
        "filterByFormula": "={{ \"AND({Provider ID}='\" + $json.providerId + \"', {Connection Status}='Request Sent')\" }}"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "dc23ac70-3f7a-452e-936c-ecc0fc3e4889",
      "name": "Mark Accepted",
      "type": "n8n-nodes-base.airtable",
      "maxTries": 3,
      "position": [
        624,
        1216
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appN6QjcbVPERZgtx"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblFuMN1Kx40tKIkY"
        },
        "columns": {
          "value": {
            "id": "={{ $json.id }}",
            "Accepted At": "={{ $now.toISO() }}",
            "Connection Status": "Accepted"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "LinkedIn URL",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "LinkedIn URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Public Identifier",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Public Identifier",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Provider ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Provider ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Headline",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Headline",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "About Summary",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "About Summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Company",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Job Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Connection Note",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Connection Note",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Connection Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "New",
                  "value": "New"
                },
                {
                  "name": "Request Sent",
                  "value": "Request Sent"
                },
                {
                  "name": "Accepted",
                  "value": "Accepted"
                },
                {
                  "name": "Declined/Expired",
                  "value": "Declined/Expired"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Connection Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reply Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "No Reply",
                  "value": "No Reply"
                },
                {
                  "name": "Replied",
                  "value": "Replied"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Reply Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Campaign Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Active",
                  "value": "Active"
                },
                {
                  "name": "Completed",
                  "value": "Completed"
                },
                {
                  "name": "Stopped (Replied)",
                  "value": "Stopped (Replied)"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Campaign Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Invitation ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Invitation ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Chat ID",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Chat ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Request Sent At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Request Sent At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Accepted At",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Accepted At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Replied At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Replied At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up 1 Sent At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up 1 Sent At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up 2 Sent At",
              "type": "dateTime",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up 2 Sent At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follow-up Count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Follow-up Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Message Received",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Last Message Received",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Error",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Last Error",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Notes",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Notes",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "typecast": true
        },
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "04ac6a22-1dc8-4ec3-a705-caa85d38322f",
      "name": "Message Received Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -80,
        1664
      ],
      "parameters": {
        "path": "unipile-message-received",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "81c79017-bd5c-41c9-8d0b-bf69ff8faaa0",
      "name": "Extract Message",
      "type": "n8n-nodes-base.set",
      "position": [
        144,
        1664
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "m1",
              "name": "senderProviderId",
              "type": "string",
              "value": "={{ $json.body?.sender?.attendee_provider_id ?? $json.body?.sender?.provider_id ?? $json.sender?.attendee_provider_id ?? '' }}"
            },
            {
              "id": "m2",
              "name": "myUserId",
              "type": "string",
              "value": "={{ $json.body?.account_info?.user_id ?? $json.account_info?.user_id ?? '' }}"
            },
            {
              "id": "m3",
              "name": "messageText",
              "type": "string",
              "value": "={{ $json.body?.message ?? $json.message ?? '' }}"
            },
            {
              "id": "m4",
              "name": "chatId",
              "type": "string",
              "value": "={{ $json.body?.chat_id ?? $json.chat_id ?? '' }}"
            },
            {
              "id": "m5",
              "name": "eventType",
              "type": "string",
              "value": "={{ $json.body?.event ?? $json.event ?? '' }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "4b314955-778d-4cbd-931c-becc2ce0a69e",
      "name": "Keep Inbound Replies Only",
      "type": "n8n-nodes-base.filter",
      "position": [
        368,
        1664
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f1",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.senderProviderId }}",
              "rightValue": "={{ $json.myUserId }}"
            },
            {
              "id": "f2",
              "operator": {
                "type": "string",
                "operation": "notEmpty"
              },
              "leftValue": "={{ $json.senderProviderId }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "7285caa8-b1f0-47f9-943a-2d911f7f69c7",
      "name": "Find Lead By Sender",
      "type": "n8n-nodes-base.airtable",
      "maxTries": 3,
      "position": [
        624,
        1664
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appN6QjcbVPERZgtx"
        },
        "limit": 1,
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblFuMN1Kx40tKIkY"
        },
        "options": {},
        "operation": "search",
        "returnAll": false,
        "filterByFormula": "={{ \"{Provider ID}='\" + $json.senderProviderId + \"'\" }}"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "6cf1cdcd-3ac1-47be-88ef-436ef20a69f6",
      "name": "Mark Replied and Stop",
      "type": "n8n-nodes-base.airtable",
      "maxTries": 3,
      "position": [
        816,
        1664
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appN6QjcbVPERZgtx"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblFuMN1Kx40tKIkY"
        },
        "columns": {
          "value": {
            "id": "={{ $json.id }}",
            "Chat ID": "={{ $('Extract Message').item.json.chatId }}",
            "Replied At": "={{ $now.toISO() }}",
            "Reply Status": "Replied",
            "Campaign Status": "Stopped (Replied)",
            "Last Message Received": "={{ $('Extract Message').item.json.messageText }}"
          },
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ]
        },
        "options": {
          "typecast": true
        },
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "7703ab76-5418-4498-bb18-b487396aa5d6",
      "name": "Every Day 10:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -48,
        2432
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 10
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "725a02fb-5b3b-4490-aa18-2acf1cb13466",
      "name": "Set Config Follow-ups",
      "type": "n8n-nodes-base.set",
      "position": [
        176,
        2432
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cfg1",
              "name": "accountId",
              "type": "string",
              "value": "REPLACE_WITH_UNIPILE_ACCOUNT_ID"
            },
            {
              "id": "cfg2",
              "name": "dsn",
              "type": "string",
              "value": "YOUR_DSN"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "01991e6f-507d-41d4-a478-1a5af556ed9d",
      "name": "Fetch Due Follow-ups",
      "type": "n8n-nodes-base.airtable",
      "maxTries": 3,
      "position": [
        400,
        2432
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appN6QjcbVPERZgtx"
        },
        "limit": 15,
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblFuMN1Kx40tKIkY"
        },
        "options": {},
        "operation": "search",
        "returnAll": false,
        "filterByFormula": "AND({Connection Status}='Accepted',{Reply Status}='No Reply',{Campaign Status}='Active',OR(AND({Follow-up 1 Sent At}=BLANK(),IS_BEFORE({Accepted At},DATEADD(NOW(),-3,'days'))),AND(NOT({Follow-up 1 Sent At}=BLANK()),{Follow-up 2 Sent At}=BLANK(),IS_BEFORE({Follow-up 1 Sent At},DATEADD(NOW(),-4,'days')))))"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "d87572e1-f506-48be-8c9f-c74cc8224e47",
      "name": "Follow-ups Complete",
      "type": "n8n-nodes-base.noOp",
      "position": [
        896,
        2144
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b7997676-ebc1-4a5a-ac29-1a7b8fc590c7",
      "name": "Re-check Lead (fresh)",
      "type": "n8n-nodes-base.airtable",
      "maxTries": 3,
      "position": [
        832,
        2448
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appN6QjcbVPERZgtx"
        },
        "limit": 1,
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblFuMN1Kx40tKIkY"
        },
        "options": {},
        "operation": "search",
        "returnAll": false,
        "filterByFormula": "={{ \"RECORD_ID()='\" + $json.id + \"'\" }}"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "8725d909-e0e9-40de-8273-f47526e42466",
      "name": "Still Sendable?",
      "type": "n8n-nodes-base.if",
      "position": [
        1056,
        2448
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "s1",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json[\"Reply Status\"] }}",
              "rightValue": "No Reply"
            },
            {
              "id": "s2",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json[\"Campaign Status\"] }}",
              "rightValue": "Active"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "8a2760d4-b33d-4458-b4e3-99520da0160b",
      "name": "Determine Follow-up",
      "type": "n8n-nodes-base.set",
      "position": [
        1360,
        2352
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d1",
              "name": "followupNumber",
              "type": "number",
              "value": "={{ $json[\"Follow-up 1 Sent At\"] ? 2 : 1 }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "cd904728-93f3-45fc-97df-742497337a73",
      "name": "Write Follow-up",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1632,
        2240
      ],
      "parameters": {
        "text": "=This is follow-up #{{ $json.followupNumber }}.\nProspect name: {{ $json.Name || 'there' }}\nHeadline: {{ $json.Headline || '' }}\nCompany: {{ $json.Company || '' }}\nOriginal connection note we sent: {{ $json['Connection Note'] || '' }}\n\nWrite the follow-up message now.",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "You are writing a short LinkedIn direct message (a follow-up) on behalf of a company that builds done-for-you AI outreach and lead-generation automations for founders, agencies and sales teams. The prospect already accepted your connection request but has not replied yet.\n\nIf this is follow-up #1: a light, friendly bump. Thank them for connecting, reference their role or company, and offer one concrete piece of value or ask a genuinely curious question. No hard pitch.\n\nIf this is follow-up #2 (the final one): a brief, respectful last touch. Share one specific way you help teams like theirs automate outreach and lead-gen, and a soft low-pressure CTA (open to a quick chat, or happy to share a resource). Make it clear you will not keep messaging.\n\nRules: Output ONLY the message text. Keep it under 600 characters. Warm, human, concise. No emojis unless natural. Never invent facts about them."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "7005436e-04c5-4f87-96b6-917b0c1ece18",
      "name": "Follow-up Writer Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1632,
        2512
      ],
      "parameters": {
        "model": "anthropic/claude-sonnet-4.6",
        "options": {
          "maxTokens": 400,
          "temperature": 0.6
        }
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ef3e4638-cce5-41fb-89b8-4a3ceaf98a0f",
      "name": "Send Follow-up",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "maxTries": 3,
      "position": [
        2080,
        2288
      ],
      "parameters": {
        "url": "=https://{{ $('Set Config Follow-ups').first().json.dsn }}/api/v1/chats",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "account_id",
              "value": "={{ $('Set Config Follow-ups').first().json.accountId }}"
            },
            {
              "name": "attendees_ids",
              "value": "={{ $('Determine Follow-up').item.json['Provider ID'] }}"
            },
            {
              "name": "text",
              "value": "={{ ($json.text || $json.output || '').toString().trim() }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "unipileApi"
      },
      "credentials": {
        "unipileApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.4,
      "waitBetweenTries": 5000
    },
    {
      "id": "50da0508-2a7e-4df2-ad6c-7f31e9d1d0bc",
      "name": "Is Follow-up 1?",
      "type": "n8n-nodes-base.if",
      "position": [
        2352,
        2288
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "w1",
              "operator": {
                "type": "number",
                "operation": "equals"
              },
              "leftValue": "={{ $('Determine Follow-up').item.json.followupNumber }}",
              "rightValue": 1
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "357a9ac1-9c0a-4b79-92d8-252c35bce962",
      "name": "Log Follow-up 1",
      "type": "n8n-nodes-base.airtable",
      "maxTries": 3,
      "position": [
        2688,
        2240
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appN6QjcbVPERZgtx"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblFuMN1Kx40tKIkY"
        },
        "columns": {
          "value": {
            "id": "={{ $('Determine Follow-up').item.json.id }}",
            "Follow-up Count": 1,
            "Follow-up 1 Sent At": "={{ $now.toISO() }}"
          },
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ]
        },
        "options": {
          "typecast": true
        },
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "da4226d2-9f3b-42fb-a801-7d3c8e575f3f",
      "name": "Wait Between Follow-ups",
      "type": "n8n-nodes-base.wait",
      "position": [
        2912,
        2624
      ],
      "parameters": {
        "amount": "={{ Math.floor(Math.random() * 61) + 30 }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "f5f54c55-cfcd-4b2d-9ddf-10689a8c7a2c",
      "name": "Log Follow-up 2 + Complete",
      "type": "n8n-nodes-base.airtable",
      "maxTries": 3,
      "position": [
        2688,
        2432
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appN6QjcbVPERZgtx"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblFuMN1Kx40tKIkY"
        },
        "columns": {
          "value": {
            "id": "={{ $('Determine Follow-up').item.json.id }}",
            "Campaign Status": "Completed",
            "Follow-up Count": 2,
            "Follow-up 2 Sent At": "={{ $now.toISO() }}"
          },
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ]
        },
        "options": {
          "typecast": true
        },
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "89d349fb-1efe-4610-9dc4-a91b9cda4465",
      "name": "Log Follow-up Error",
      "type": "n8n-nodes-base.airtable",
      "maxTries": 3,
      "position": [
        2688,
        2624
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "appN6QjcbVPERZgtx"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "tblFuMN1Kx40tKIkY"
        },
        "columns": {
          "value": {
            "id": "={{ $('Determine Follow-up').item.json.id }}",
            "Last Error": "={{ $json.error && $json.error.message ? $json.error.message : 'Follow-up message failed' }}"
          },
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ]
        },
        "options": {
          "typecast": true
        },
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "49bc6d15-e89d-4ba1-be11-88fed11b0280",
      "name": "Loop Over Due",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        640,
        2432
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "bb7b88c1-c23e-4468-844c-1fbbcc639107",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        656
      ],
      "parameters": {
        "width": 480,
        "height": 1088,
        "content": "## LinkedIn Outreach Automation\n\nPersonalized connect + acceptance/reply tracking + a 2-step follow-up. Airtable is the CRM, Unipile drives LinkedIn, OpenRouter writes the copy. Three independent flows live in one workflow.\n\n### How it works\n\n1. **Flow 1 (weekdays 09:00)** pulls up to 15 Airtable leads marked New, fetches each LinkedIn profile via Unipile, writes a personalized note (<=300 chars) with AI, sends the connection request, logs it, and waits 30-90s between sends.\n2. **Flow 2 (webhooks)** - Unipile new_relation marks a lead Accepted; inbound message_received marks it Replied and stops the campaign.\n3. **Flow 3 (daily 10:00)** sends follow-up #1 three days after accept and #2 four days later, then marks the lead Completed.\n\n### Setup steps\n\n- [ ] Create the Airtable CRM table and connect an Airtable Personal Access Token credential.\n- [ ] Add your Unipile credential (X-API-KEY) and set accountId + dsn in BOTH Set Config nodes.\n- [ ] Add an OpenRouter credential for the AI note/follow-up writers.\n- [ ] In Unipile, register two webhooks (new_relation, message_received) pointing at this workflow.\n- [ ] Add leads to Airtable with Connection Status = New, then activate the workflow.\n\n### Requirements\n\nLinkedIn premium account (via Unipile), Airtable, OpenRouter."
      },
      "typeVersion": 1
    },
    {
      "id": "8eb5db57-db59-4c1d-a23a-a6ca83ff0a44",
      "name": "Step 01",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        224
      ],
      "parameters": {
        "color": 7,
        "width": 680,
        "height": 376,
        "content": "## Fetch new leads\nRuns every weekday 09:00 and pulls up to 15 Airtable leads marked New, one at a time."
      },
      "typeVersion": 1
    },
    {
      "id": "e1f54bf2-e076-4453-a595-23ad0d872cf6",
      "name": "Step 02",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        176
      ],
      "parameters": {
        "color": 7,
        "width": 200,
        "height": 424,
        "content": "## Loop over leads\nProcess each lead individually; when the batch finishes the run ends."
      },
      "typeVersion": 1
    },
    {
      "id": "f4f28bb3-888f-41da-a8eb-f43b69ec73e0",
      "name": "Step 03",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        208
      ],
      "parameters": {
        "color": 7,
        "width": 520,
        "height": 264,
        "content": "## Resolve LinkedIn profile\nDerive the public identifier and fetch the full profile from Unipile."
      },
      "typeVersion": 1
    },
    {
      "id": "fc3a8e76-c1e6-4f48-9305-61e7ecb054ff",
      "name": "Step 04",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1328,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 488,
        "height": 664,
        "content": "## Write note with AI\nOpenRouter drafts a personalized note; a JSON schema (max 300) plus auto-fix keep it within LinkedIn's limit."
      },
      "typeVersion": 1
    },
    {
      "id": "881023a0-0631-40a3-94f0-1eb0ed331b50",
      "name": "Step 05",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1856,
        112
      ],
      "parameters": {
        "color": 7,
        "width": 488,
        "height": 376,
        "content": "## Cap length & send request\nHard-truncate as a safety net, then send the connection request via Unipile."
      },
      "typeVersion": 1
    },
    {
      "id": "3f436216-991b-4d5a-b287-85d94a85f571",
      "name": "Step 06",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2368,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 696,
        "height": 664,
        "content": "## Log outcome & pace sends\nWrite the result (or error) back to Airtable, then wait 30-90s before the next lead."
      },
      "typeVersion": 1
    },
    {
      "id": "35388c74-a9ea-41b4-9b6f-3e9fd6927ef7",
      "name": "Step 07",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        1040
      ],
      "parameters": {
        "color": 7,
        "width": 456,
        "height": 376,
        "content": "##  Detect accepted\nUnipile new_relation webhook fires (up to ~8h after accept) with the new connection's provider id."
      },
      "typeVersion": 1
    },
    {
      "id": "ae32bc29-6f70-4f94-94b3-34d4ec4bcbe9",
      "name": "Step 08",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        1040
      ],
      "parameters": {
        "color": 7,
        "width": 456,
        "height": 376,
        "content": "## Mark lead accepted\nMatch the provider id to a lead still in Request Sent and flip it to Accepted."
      },
      "typeVersion": 1
    },
    {
      "id": "055a4e49-37ae-4753-a8e8-4b51ea7c5e64",
      "name": "Step 09",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        1440
      ],
      "parameters": {
        "color": 7,
        "width": 648,
        "height": 440,
        "content": "## Receive & filter replies\nUnipile message_received webhook; keep only genuine inbound replies and drop our own outbound."
      },
      "typeVersion": 1
    },
    {
      "id": "dc899e39-fa25-4503-b807-56e40d5f6c17",
      "name": "Step 10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        1440
      ],
      "parameters": {
        "color": 7,
        "width": 424,
        "height": 440,
        "content": "## Mark replied & stop\nFind the lead by sender, mark it Replied, and stop any further follow-ups."
      },
      "typeVersion": 1
    },
    {
      "id": "16456163-bf92-4298-b30d-2d1b877896ea",
      "name": "Step 11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        2304
      ],
      "parameters": {
        "color": 7,
        "width": 680,
        "height": 312,
        "content": "## Fetch due follow-ups\nRuns daily 10:00 and pulls Accepted, no-reply leads that are due."
      },
      "typeVersion": 1
    },
    {
      "id": "1c9c2eca-d925-4427-9bd0-825eafeb27a8",
      "name": "Step 12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        2272
      ],
      "parameters": {
        "color": 7,
        "width": 200,
        "height": 344,
        "content": "## Loop over due leads\nProcess each due lead one at a time."
      },
      "typeVersion": 1
    },
    {
      "id": "06a0fafb-7580-4118-a525-513d904b38a6",
      "name": "Step 13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        2272
      ],
      "parameters": {
        "color": 7,
        "width": 488,
        "height": 360,
        "content": "## Re-check still sendable\nRe-read the lead fresh and skip it if a reply arrived since the query (loop-safe)."
      },
      "typeVersion": 1
    },
    {
      "id": "a78c3c3f-3bc2-4968-82ac-503ae2ee31fc",
      "name": "Step 14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        2096
      ],
      "parameters": {
        "color": 7,
        "width": 636,
        "height": 584,
        "content": "## Write follow-up with AI\nDecide follow-up #1 or #2 and draft the message with OpenRouter."
      },
      "typeVersion": 1
    },
    {
      "id": "9c80274a-7f68-4fea-ba05-9d43fdde9941",
      "name": "Step 15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        2096
      ],
      "parameters": {
        "color": 7,
        "width": 616,
        "height": 360,
        "content": "## Send follow-up & branch\nSend the DM via Unipile, then branch on which follow-up this was."
      },
      "typeVersion": 1
    },
    {
      "id": "8fb75284-c692-42e0-996e-297bee8490ea",
      "name": "Step 16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2592,
        2064
      ],
      "parameters": {
        "color": 7,
        "width": 536,
        "height": 824,
        "content": "## Log & complete\nStamp the follow-up time; after #2 mark the campaign Completed. Errors are logged too."
      },
      "typeVersion": 1
    },
    {
      "id": "3db9fe93-783b-44c2-864b-23a80fcc8396",
      "name": "Section - Workflow 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        -112
      ],
      "parameters": {
        "color": 2,
        "width": 3288,
        "height": 948,
        "content": "## Workflow 1 \u2014 Daily Connection Sender"
      },
      "typeVersion": 1
    },
    {
      "id": "2e4ad35e-7e19-4f1c-a606-5bc8c1f571f8",
      "name": "Section - Workflow 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        880
      ],
      "parameters": {
        "color": 2,
        "width": 1208,
        "height": 1052,
        "content": "## Workflow 2 \u2014 Tracker (Accepted + Replied)"
      },
      "typeVersion": 1
    },
    {
      "id": "5e74d21c-2643-47f0-9975-59cec4cd5308",
      "name": "Section - Workflow 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        1984
      ],
      "parameters": {
        "color": 2,
        "width": 3432,
        "height": 964,
        "content": "## Workflow 3 \u2014 Follow-up Dispatcher"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": true,
    "executionOrder": "v1"
  },
  "versionId": "85ad2f6f-7078-459c-8e3b-0ced2f19ad19",
  "nodeGroups": [],
  "connections": {
    "Set Config": {
      "main": [
        [
          {
            "node": "Fetch New Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Due": {
      "main": [
        [
          {
            "node": "Follow-ups Complete",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Re-check Lead (fresh)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Send Error": {
      "main": [
        [
          {
            "node": "Human-like Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Follow-up": {
      "main": [
        [
          {
            "node": "Is Follow-up 1?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Follow-up Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every Day 10:00": {
      "main": [
        [
          {
            "node": "Set Config Follow-ups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Message": {
      "main": [
        [
          {
            "node": "Keep Inbound Replies Only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch New Leads": {
      "main": [
        [
          {
            "node": "Loop Over Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Follow-up 1?": {
      "main": [
        [
          {
            "node": "Log Follow-up 1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Follow-up 2 + Complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Follow-up 1": {
      "main": [
        [
          {
            "node": "Wait Between Follow-ups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Leads": {
      "main": [
        [
          {
            "node": "All Leads Processed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Identifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Still Sendable?": {
      "main": [
        [
          {
            "node": "Determine Follow-up",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Between Follow-ups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Follow-up": {
      "main": [
        [
          {
            "node": "Send Follow-up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Relation": {
      "main": [
        [
          {
            "node": "Find Pending Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Human-like Delay": {
      "main": [
        [
          {
            "node": "Loop Over Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Request Sent": {
      "main": [
        [
          {
            "node": "Human-like Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Note Fixer Model": {
      "ai_languageModel": [
        [
          {
            "node": "Note Schema (max 300)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Find Pending Lead": {
      "main": [
        [
          {
            "node": "Mark Accepted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Profile Error": {
      "main": [
        [
          {
            "node": "Human-like Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Note Writer Model": {
      "ai_languageModel": [
        [
          {
            "node": "Write Connection Note",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Enforce Char Limit": {
      "main": [
        [
          {
            "node": "Send Connection Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Identifier": {
      "main": [
        [
          {
            "node": "Get LinkedIn Profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Determine Follow-up": {
      "main": [
        [
          {
            "node": "Write Follow-up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every Weekday 09:00": {
      "main": [
        [
          {
            "node": "Set Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Lead By Sender": {
      "main": [
        [
          {
            "node": "Mark Replied and Stop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Follow-up Error": {
      "main": [
        [
          {
            "node": "Wait Between Follow-ups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Due Follow-ups": {
      "main": [
        [
          {
            "node": "Loop Over Due",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get LinkedIn Profile": {
      "main": [
        [
          {
            "node": "Write Connection Note",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Profile Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Relation Webhook": {
      "main": [
        [
          {
            "node": "Extract Relation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Note Schema (max 300)": {
      "ai_outputParser": [
        [
          {
            "node": "Write Connection Note",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Re-check Lead (fresh)": {
      "main": [
        [
          {
            "node": "Still Sendable?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Config Follow-ups": {
      "main": [
        [
          {
            "node": "Fetch Due Follow-ups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Connection Note": {
      "main": [
        [
          {
            "node": "Enforce Char Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Follow-up Writer Model": {
      "ai_languageModel": [
        [
          {
            "node": "Write Follow-up",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Send Connection Request": {
      "main": [
        [
          {
            "node": "Log Request Sent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Send Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Between Follow-ups": {
      "main": [
        [
          {
            "node": "Loop Over Due",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message Received Webhook": {
      "main": [
        [
          {
            "node": "Extract Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep Inbound Replies Only": {
      "main": [
        [
          {
            "node": "Find Lead By Sender",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Follow-up 2 + Complete": {
      "main": [
        [
          {
            "node": "Wait Between Follow-ups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}