{
  "id": "rkhgnsQGutrmwcFP",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Automated Lead Follow-Up System \u2013 Validate, Email & Message New Leads from Follow Up Boss",
  "tags": [
    {
      "id": "baIdEJyPHqa8m5k8",
      "name": "CRM",
      "createdAt": "2025-10-07T21:33:11.637Z",
      "updatedAt": "2025-10-07T21:33:11.637Z"
    }
  ],
  "nodes": [
    {
      "id": "4cf0c726-f652-4379-a76e-7e8ecc3834bc",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -368,
        848
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 3
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "4206086d-f8d5-47f3-9c8f-ec74d1898a91",
      "name": "Get Last time run",
      "type": "n8n-nodes-base.code",
      "position": [
        -144,
        848
      ],
      "parameters": {
        "jsCode": "const data = $getWorkflowStaticData('global');\n\nconst lastRun = data.lastRun || new Date(Date.now() - 15 * 60 * 1000).toISOString();\n\nreturn [{ lastRun }];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "029d7042-56f8-4bd3-a31d-6707137d51a2",
      "name": "Last Time Run",
      "type": "n8n-nodes-base.code",
      "position": [
        2160,
        864
      ],
      "parameters": {
        "jsCode": "const data = $getWorkflowStaticData('global');\ndata.lastRun = new Date().toISOString();\nreturn items;"
      },
      "typeVersion": 2
    },
    {
      "id": "8ec31f87-92f8-416c-b257-6faeda41f15f",
      "name": "Get Last Lead (FUB)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        80,
        848
      ],
      "parameters": {
        "url": "=https://api.followupboss.com/v1/people?createdAfter={{$json[\"lastRun\"]}}",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth",
        "queryParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "credentials": {
        "httpBasicAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a4d56163-3c53-4997-941a-3add6637a950",
      "name": "False Email or False Phone",
      "type": "n8n-nodes-base.if",
      "position": [
        944,
        864
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "4bd16be0-69ae-498f-85d9-b09c9f560b40",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.emails[0].status }}",
              "rightValue": "Valid"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "7b9d5935-0b43-4f94-8a41-17ad4c611ca3",
      "name": "Invalid Number and Email",
      "type": "n8n-nodes-base.filter",
      "position": [
        576,
        848
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "ce4a677d-0089-4b09-84f2-1bcc3fb33fbf",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.emails[0].status }}",
              "rightValue": "Valid"
            },
            {
              "id": "85d35324-19a3-4c35-9db7-a55fe002d078",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.phones[0].status }}",
              "rightValue": "Valid"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "99bfaa21-fdba-4baa-ac98-901d996e8f2c",
      "name": "DIvide Each Lead",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        416,
        848
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "people"
      },
      "typeVersion": 1
    },
    {
      "id": "0f42153e-0b2b-4b0b-b66c-a28d1ee7d1ce",
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1632,
        576
      ],
      "parameters": {
        "sendTo": "={{ $json.Email }}",
        "message": "( Type your ideal Email )",
        "options": {},
        "subject": "Following Up!"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "db4f5850-751c-4d23-a5db-66077d4d26e4",
      "name": "Send SMS/Whatsapp",
      "type": "n8n-nodes-base.twilio",
      "position": [
        1872,
        576
      ],
      "parameters": {
        "to": "={{ $('Full data \u2192 Send both Email + SMS/WhatsApp').item.json.phones[0].value }}",
        "from": "8887944798",
        "message": "( Type your ideal Message )",
        "options": {}
      },
      "credentials": {
        "twilioApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "61b7f8d7-19ed-42d2-ba4c-00c177809008",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        240,
        848
      ],
      "parameters": {
        "amount": 6
      },
      "typeVersion": 1.1
    },
    {
      "id": "1b7eb467-11ea-4358-9514-ef16aed8c728",
      "name": "Send SMS/Whatsapp1",
      "type": "n8n-nodes-base.twilio",
      "position": [
        1600,
        1120
      ],
      "parameters": {
        "to": "=+1{{ $('Full data \u2192 Send both Email + SMS/WhatsApp').item.json.phones[0].value }}",
        "from": "+1234567890",
        "message": "( Type your ideal Message )",
        "options": {},
        "toWhatsapp": true
      },
      "credentials": {
        "twilioApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d0f970bd-c357-48e2-a5e1-bf645863273e",
      "name": "Full data \u2192 Send both Email + SMS/WhatsApp",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1184,
        560
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "18c15563-c9ba-4849-8b60-18bcad929e3f",
      "name": "Missing/Invalid phone \u2192 Email only",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1168,
        848
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "712c390e-6afd-4f8f-aad0-e62bf7fdb453",
      "name": "Missing/Invalid email \u2192 SMS/WhatsApp only",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1168,
        1104
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "12bf1e10-5204-411f-827c-9360dfb7ddd0",
      "name": "Extract Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1408,
        576
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1d8722a0-7b66-44ce-b46b-2e38fea49dc5",
              "name": "firstName",
              "type": "string",
              "value": "={{ $json.firstName }}"
            },
            {
              "id": "b8dd1bff-106c-482f-a678-6b383a018ebf",
              "name": "lastName",
              "type": "string",
              "value": "={{ $json.lastName }}"
            },
            {
              "id": "16f5fb9d-849c-47b7-b9b0-f02c2d15cb1f",
              "name": "CurrentStage",
              "type": "string",
              "value": "={{ $json.stage }}"
            },
            {
              "id": "f6efa820-9185-4986-ab33-7e81d55935fe",
              "name": "Source",
              "type": "string",
              "value": "={{ $if($json.source === \"<unspecified>\", \"Manually/Other\", $json.people[0].source) }}"
            },
            {
              "id": "a26edb95-4683-46ff-a2dc-6a8b468498b8",
              "name": "Email",
              "type": "string",
              "value": "={{ $json.emails[0].value }}"
            },
            {
              "id": "d019e1c2-87d0-46f0-ac65-d8dddff65eca",
              "name": "Phone Number",
              "type": "string",
              "value": "={{ $json.phones[0].value }}"
            },
            {
              "id": "0284bc6f-d249-42df-8564-f0cfe393e115",
              "name": "Email Verification",
              "type": "string",
              "value": "={{ $json.emails[0].status }}"
            },
            {
              "id": "44457cf3-b416-47d9-9855-b52bacf2a555",
              "name": "Phone Verification",
              "type": "string",
              "value": "={{ $json.phones[0].status }}"
            },
            {
              "id": "c0622a7e-feca-4546-a31f-032bfcbd4390",
              "name": "Task ID",
              "type": "string",
              "value": "={{ $json.id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e3c332f1-152e-473c-a050-6877907ef06d",
      "name": "Extract Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        1408,
        864
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1d8722a0-7b66-44ce-b46b-2e38fea49dc5",
              "name": "firstName",
              "type": "string",
              "value": "={{ $json.firstName }}"
            },
            {
              "id": "b8dd1bff-106c-482f-a678-6b383a018ebf",
              "name": "lastName",
              "type": "string",
              "value": "={{ $json.lastName }}"
            },
            {
              "id": "16f5fb9d-849c-47b7-b9b0-f02c2d15cb1f",
              "name": "CurrentStage",
              "type": "string",
              "value": "={{ $json.stage }}"
            },
            {
              "id": "f6efa820-9185-4986-ab33-7e81d55935fe",
              "name": "Source",
              "type": "string",
              "value": "={{ $if($json.source === \"<unspecified>\", \"Manually/Other\", $json.people[0].source) }}"
            },
            {
              "id": "a26edb95-4683-46ff-a2dc-6a8b468498b8",
              "name": "Email",
              "type": "string",
              "value": "={{ $json.emails[0].value }}"
            },
            {
              "id": "d019e1c2-87d0-46f0-ac65-d8dddff65eca",
              "name": "Phone Number",
              "type": "string",
              "value": "={{ $json.phones[0].value }}"
            },
            {
              "id": "0284bc6f-d249-42df-8564-f0cfe393e115",
              "name": "Email Verification",
              "type": "string",
              "value": "={{ $json.emails[0].status }}"
            },
            {
              "id": "44457cf3-b416-47d9-9855-b52bacf2a555",
              "name": "Phone Verification",
              "type": "string",
              "value": "={{ $json.phones[0].status }}"
            },
            {
              "id": "c0622a7e-feca-4546-a31f-032bfcbd4390",
              "name": "Task ID",
              "type": "string",
              "value": "={{ $json.id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e7971f7e-94ca-487a-a3de-950ef73c8e0d",
      "name": "Extract Fields2",
      "type": "n8n-nodes-base.set",
      "position": [
        1408,
        1120
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1d8722a0-7b66-44ce-b46b-2e38fea49dc5",
              "name": "firstName",
              "type": "string",
              "value": "={{ $json.firstName }}"
            },
            {
              "id": "b8dd1bff-106c-482f-a678-6b383a018ebf",
              "name": "lastName",
              "type": "string",
              "value": "={{ $json.lastName }}"
            },
            {
              "id": "16f5fb9d-849c-47b7-b9b0-f02c2d15cb1f",
              "name": "CurrentStage",
              "type": "string",
              "value": "={{ $json.stage }}"
            },
            {
              "id": "f6efa820-9185-4986-ab33-7e81d55935fe",
              "name": "Source",
              "type": "string",
              "value": "={{ $if($json.source === \"<unspecified>\", \"Manually/Other\", $json.people[0].source) }}"
            },
            {
              "id": "a26edb95-4683-46ff-a2dc-6a8b468498b8",
              "name": "Email",
              "type": "string",
              "value": "={{ $json.emails[0].value }}"
            },
            {
              "id": "d019e1c2-87d0-46f0-ac65-d8dddff65eca",
              "name": "Phone Number",
              "type": "string",
              "value": "={{ $json.phones[0].value }}"
            },
            {
              "id": "0284bc6f-d249-42df-8564-f0cfe393e115",
              "name": "Email Verification",
              "type": "string",
              "value": "={{ $json.emails[0].status }}"
            },
            {
              "id": "44457cf3-b416-47d9-9855-b52bacf2a555",
              "name": "Phone Verification",
              "type": "string",
              "value": "={{ $json.phones[0].status }}"
            },
            {
              "id": "c0622a7e-feca-4546-a31f-032bfcbd4390",
              "name": "Task ID",
              "type": "string",
              "value": "={{ $json.id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "8e95855e-fb87-44fc-9d3d-70f98cb21bf8",
      "name": "Send Email1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1584,
        864
      ],
      "parameters": {
        "sendTo": "={{ $json.Email }}",
        "message": "( Type your ideal Email )",
        "options": {},
        "subject": "Following Up!"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "00356ece-b0ec-4f9b-b6bb-da84dfa26ddf",
      "name": "All Good?",
      "type": "n8n-nodes-base.if",
      "position": [
        768,
        848
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e7db+1234567890-beac-d11cd13a7af5",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.emails[0].status }}",
              "rightValue": "Valid"
            },
            {
              "id": "6adb6a66-29c8-41e4-bb3b-eece6ece7e88",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.phones[0].status }}",
              "rightValue": "Valid"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "82aea6ee-e9c6-4479-8fb5-83002214e1c8",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        0
      ],
      "parameters": {
        "width": 304,
        "height": 1312,
        "content": "# \ud83d\udfe8 STEP 3: Smart Follow-Up Logic\n\n# n8n branches into three paths:\n\n## Full data \u2192 Send both Email + SMS/WhatsApp\n\n## Missing phone \u2192 Email only\n\n## Missing email \u2192 SMS/WhatsApp only"
      },
      "typeVersion": 1
    },
    {
      "id": "557ea5c2-0dbe-4292-946c-c9261958e098",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1392,
        304
      ],
      "parameters": {
        "color": 3,
        "width": 960,
        "height": 1008,
        "content": "# \ud83d\udfe7 STEP 4: Personalized Messages & Logging\n\n## Personalized emails and texts are sent automatically, and the workflow records the latest run timestamp to keep the system synced for next time."
      },
      "typeVersion": 1
    },
    {
      "id": "37b94b74-c294-4129-8296-89b29816327a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        576
      ],
      "parameters": {
        "color": 4,
        "width": 528,
        "height": 736,
        "content": "# \ud83d\udfe6 STEP 2: Validation & Filtering\n\n## Each lead is checked for valid email and phone. Invalid or duplicate entries are filtered out to avoid wasted messages or bounces."
      },
      "typeVersion": 1
    },
    {
      "id": "fb3a98b3-3963-4573-91d9-e2986d100ecb",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        576
      ],
      "parameters": {
        "width": 928,
        "height": 736,
        "content": "# \ud83d\udfe9 STEP 1: Scheduled Trigger & Lead Fetch\n\n## The flow runs automatically on a schedule, retrieves the latest leads from FollowUpBoss, and loads only new entries since the last run."
      },
      "typeVersion": 1
    },
    {
      "id": "4c7fbbb6-1167-44c1-80a6-eabe4d620520",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        0
      ],
      "parameters": {
        "color": 5,
        "width": 1472,
        "height": 560,
        "content": "# This workflow automates your entire lead follow-up process across email, SMS, and WhatsApp.\n\n## It starts on a schedule and pulls your latest leads from FollowUpBoss (FUB), checking when the workflow last ran. Each new contact is automatically validated \u2014 phone numbers and emails are cleaned, filtered, and checked for duplicates before sending any message.\n\nOnce validated, the system intelligently decides how to reach each lead:\n\n\ud83d\udcac Email + SMS if all data looks good\n\n\ud83d\udce7 Email only if phone is invalid\n\n\ud83d\udcf1 SMS/WhatsApp only if email is missing\n\nEach message is personalized using data from the lead record, and everything is tracked back in your database for future reporting.\n\nThis template helps agents, marketing teams, and CRM users run consistent follow-ups without missing a single contact. Whether you manage 10 or 10 000 leads, this flow scales effortlessly.\n\nTools used: FollowUpBoss, Gmail, Twilio/WhatsApp, n8n\n\n(Tip: Replace your API keys and Gmail credentials before running.)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5fae024f-992b-4c6f-afa5-5f737fcbe553",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "DIvide Each Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "All Good?": {
      "main": [
        [
          {
            "node": "Full data \u2192 Send both Email + SMS/WhatsApp",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "False Email or False Phone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email": {
      "main": [
        [
          {
            "node": "Send SMS/Whatsapp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email1": {
      "main": [
        [
          {
            "node": "Missing/Invalid phone \u2192 Email only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Fields": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Fields1": {
      "main": [
        [
          {
            "node": "Send Email1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Fields2": {
      "main": [
        [
          {
            "node": "Send SMS/Whatsapp1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DIvide Each Lead": {
      "main": [
        [
          {
            "node": "Invalid Number and Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Last time run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Last time run": {
      "main": [
        [
          {
            "node": "Get Last Lead (FUB)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send SMS/Whatsapp": {
      "main": [
        [
          {
            "node": "Full data \u2192 Send both Email + SMS/WhatsApp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send SMS/Whatsapp1": {
      "main": [
        [
          {
            "node": "Missing/Invalid email \u2192 SMS/WhatsApp only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Last Lead (FUB)": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Invalid Number and Email": {
      "main": [
        [
          {
            "node": "All Good?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "False Email or False Phone": {
      "main": [
        [
          {
            "node": "Missing/Invalid phone \u2192 Email only",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Missing/Invalid email \u2192 SMS/WhatsApp only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Missing/Invalid phone \u2192 Email only": {
      "main": [
        [
          {
            "node": "Last Time Run",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Missing/Invalid email \u2192 SMS/WhatsApp only": {
      "main": [
        [
          {
            "node": "Last Time Run",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract Fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Full data \u2192 Send both Email + SMS/WhatsApp": {
      "main": [
        [
          {
            "node": "Last Time Run",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}