{
  "id": "SGeX0P1dV45h4WOd",
  "name": "Automated Lead Generation & Cold Email Workflow (AI + Telegram + Google Sheets Tracking)",
  "tags": [
    {
      "id": "HHejL0bhIyOtURIl",
      "name": "Custom",
      "createdAt": "2025-10-16T11:07:53.098Z",
      "updatedAt": "2025-10-16T11:07:53.098Z"
    }
  ],
  "nodes": [
    {
      "id": "76176e5d-13fa-41a9-89f6-fe3244818c76",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        384,
        288
      ],
      "parameters": {
        "text": "=\u2705 Cold Email sent!\n\n\ud83d\udd38Company Name \u27a1 {{ $('Loop Over Items').item.json['Company Name'] }}\n\n\ud83d\udd38Mail Address \u27a1 {{ $('Edit Fields').item.json['Email Address'] }}\n\n\ud83d\udd38Mail Subject \u27a1 {{ $('Information Extractor1').item.json.output['Mail Subject'] }}\n\n\ud83d\udd38Mail Body \u27a1 {{ $('Information Extractor1').item.json.output['Mail Body'] }}",
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "45dd2650-3dcf-43e3-a53d-4a96039e0c50",
      "name": "Append row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        608,
        -48
      ],
      "parameters": {
        "columns": {
          "value": {
            "Address": "={{ $('Filter').item.json.address }}",
            "Website": "={{ $('Filter').item.json.website }}",
            "Category": "={{ $('Filter').item.json.categoryName }}",
            "Company Name": "={{ $('Filter').item.json.title }}",
            "Email Address": "={{ $json.output['Email Address'] }}",
            "Phone Nummber": "={{ $('Filter').item.json.phoneUnformatted }}"
          },
          "schema": [
            {
              "id": "Company Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Company Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Category",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Website",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Nummber",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Phone Nummber",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email Address",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Cold Mail Status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Cold Mail Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "SEND Time",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "SEND Time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "="
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "e8a9f686-d626-4891-a6ab-661d8de6ed93",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        400,
        -208
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0bef85fd-156f-476a-b7b5-86c414e37a5e",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.output['Email Address'] }}",
              "rightValue": "@"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "18bf98e1-78a0-40ea-a021-caabfabf55c3",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        -352,
        -176
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "45bc2a48-a148-462a-a316-8f3dc020e567",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.website }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c649fd90-9e3e-4e00-9bb8-30a66375af1f",
      "name": "Append or update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        384,
        592
      ],
      "parameters": {
        "columns": {
          "value": {
            "SEND Time": "={{ $('Edit Fields').item.json['Send Time'] }}",
            "Email Address": "={{ $('Edit Fields').item.json['Email Address'] }}",
            "Cold Mail Status": "\u2705"
          },
          "schema": [
            {
              "id": "Company Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Company Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Category",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Nummber",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Phone Nummber",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email Address",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Cold Mail Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Cold Mail Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "SEND Time",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "SEND Time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Email Address"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1i2__OUxPtEQL0H7_9wByfVcXDZJliOVxT1yrj3yOfns/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": ""
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "b533939d-5237-45ee-ba58-98c08ff16ee8",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        160,
        304
      ],
      "parameters": {
        "sendTo": "={{ $json['Email Address'] }}",
        "message": "={{ $('Information Extractor1').item.json.output['Mail Body'] }}",
        "options": {},
        "subject": "={{ $('Information Extractor1').item.json.output['Mail Subject'] }}",
        "emailType": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "30cd146e-1275-48e7-87da-da2db976a7b4",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -16,
        304
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e8182ef2-8755-4ff8-9ecb-4185ae782cde",
              "name": "Send Time",
              "type": "string",
              "value": "={{$now.toFormat(\"dd-MM-yyyy (h:mm:s a)\")}}"
            },
            {
              "id": "4b3a6df0-eebd-46db-bc18-a26f85d7fef4",
              "name": "Email Address",
              "type": "string",
              "value": "={{ $('Wait').item.json['Email Address'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9d8d7555-7587-4f4b-8178-2faab50ce85f",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -304,
        464
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "42210a49-490c-4d6c-9171-2213e7ecb385",
      "name": "Information Extractor1",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        -304,
        304
      ],
      "parameters": {
        "text": "=You are a perfect cold mail generator for a Workflow Process Automation Specialist (Lead Generation) Agency named \"Your name\"\n\nHere's the Information about the Recipient:\n\nCompany Name: {{ $('Loop Over Items').item.json['Company Name'] }}\nBusiness Type: {{ $('Loop Over Items').item.json.Category }}\n\nEmail Style / Email Tune : {{ $('On form submission').item.json['Email Style'] }}\n\nThe Email style is given just to understand how the mail will be.\n\nInstructions:\n\n1. Always start with giving a greting to the Company like Hi Company Name,\n2. Always use We not I,\n3. Mail have to be professional, Clean and to the point,\n4. At last give a Signeture Like:\n\n   Your Name",
        "options": {},
        "attributes": {
          "attributes": [
            {
              "name": "Mail Subject",
              "required": true,
              "description": "Eye catchy mail Subject for the cold mail"
            },
            {
              "name": "Mail Body",
              "required": true,
              "description": "=body message of the mail, a perfect and clear cold mail."
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e32e288f-abb6-4cb2-ae8f-c227bb8380b7",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        -464,
        304
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "c1cadd00-ddff-4d37-9db2-fe4cb21b4cfe",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -672,
        288
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "ac4d2d4d-ac22-4ced-8bf4-f57003e0a2ee",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        0,
        -64
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": ""
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "f01fbab3-38fb-4825-b4c4-e9a04bd8b851",
      "name": "Information Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        0,
        -272
      ],
      "parameters": {
        "text": "=Website:  {{ $json.website }}",
        "options": {},
        "attributes": {
          "attributes": [
            {
              "name": "Email Address",
              "required": true,
              "description": "=Find out the best only one email address from the website after scraping the website. The mail address have to be in ideal format."
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8bb28604-810b-41db-afe5-b56322483f72",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -544,
        -176
      ],
      "parameters": {
        "url": "https://api.apify.com",
        "options": {},
        "jsonBody": "={\n    \"includeWebResults\": false,\n    \"language\": \"en\",\n    \"locationQuery\": \"{{ $json.Location }}\",\n    \"maxCrawledPlacesPerSearch\":{{ $json['Lead Number'] }} ,\n    \"maxImages\": 0,\n    \"maximumLeadsEnrichmentRecords\": 0,\n    \"scrapeContacts\": false,\n    \"scrapeDirectories\": false,\n    \"scrapeImageAuthors\": false,\n    \"scrapePlaceDetailPage\": false,\n    \"scrapeReviewsPersonalData\": true,\n    \"scrapeTableReservationProvider\": false,\n    \"searchStringsArray\": [\n        \"{{ $json['Business Type'] }}\"\n    ],\n    \"skipClosedPlaces\": false\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.2
    },
    {
      "id": "150960a4-6e70-4e40-9671-e9608d890664",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -864,
        -336
      ],
      "parameters": {
        "options": {
          "buttonLabel": "Submit GO \ud83d\ude80",
          "appendAttribution": false
        },
        "formTitle": "Lead Collect Tool",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Business Type",
              "placeholder": "e.g. Restaurant",
              "requiredField": true
            },
            {
              "fieldLabel": "Location",
              "placeholder": "e.g. Rome, Italy",
              "requiredField": true
            },
            {
              "fieldType": "number",
              "fieldLabel": "Lead Number",
              "placeholder": "e.g. 5",
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Email Style",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Friendly"
                  },
                  {
                    "option": "Professional"
                  },
                  {
                    "option": "Simple"
                  }
                ]
              }
            }
          ]
        },
        "formDescription": "Provide the info below..."
      },
      "typeVersion": 2.3
    },
    {
      "id": "a8a4c50d-6aa1-4223-b9c5-0118b371407b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -592,
        -320
      ],
      "parameters": {
        "width": 384,
        "height": 336,
        "content": "## Step 2\nIn this step, apify searches for businesses in the relevant city based on the type and number of businesses entered on the form page. Businesses with websites pass through the filter."
      },
      "typeVersion": 1
    },
    {
      "id": "d4a85604-bfcb-4d98-a346-89977ce61db5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -512
      ],
      "parameters": {
        "width": 320,
        "height": 320,
        "content": "## Step 1\nIn this step, we fill in the n8n form tool titled Lead Collect Tool with the requested information:\n1-business name\n2-number of businesses to be searched, etc."
      },
      "typeVersion": 1
    },
    {
      "id": "65445276-a992-4515-a9c1-84fe84e4f141",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -416
      ],
      "parameters": {
        "width": 400,
        "height": 480,
        "content": "## Step 3\nAt this stage, the email addresses of the businesses that pass through the filter are found by AI from their own web addresses."
      },
      "typeVersion": 1
    },
    {
      "id": "07f3e732-16f2-4133-87d9-e33a6a2006aa",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        -368
      ],
      "parameters": {
        "width": 432,
        "height": 480,
        "content": "## Step 4\nIn this step, businesses with email addresses found by Open AI are recorded in Google Sheets \nwith information such as company name, email address, etc.    "
      },
      "typeVersion": 1
    },
    {
      "id": "9a59a5e5-9a74-4fd0-bcb6-9660b4b06b97",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        160
      ],
      "parameters": {
        "width": 976,
        "height": 432,
        "content": "## Step 5\nThis step consists of a loop. In the previous steps, emails are sent to each business that has a website and email address. This email is generated by AI according to the type specified in the form at the beginning. Sometimes the email addresses found may not contain the @ sign, so the filter in the loop adjusts for this. And this loop repeats as many times as there are email addresses."
      },
      "typeVersion": 1
    },
    {
      "id": "c251a56e-1419-46f2-8561-ef2f13e07aa4",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        480
      ],
      "parameters": {
        "width": 416,
        "height": 272,
        "content": "## Step 6.2\nIn this step, the business information in the previously created Google Sheet file is updated, and the status of the cold email process is confirmed."
      },
      "typeVersion": 1
    },
    {
      "id": "f29a55af-00d0-42f8-b3ea-ecd0c958ce55",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        160
      ],
      "parameters": {
        "width": 400,
        "height": 304,
        "content": "## Step 6.1\nAt this step, the system enters a loop and sends emails assigned to each business to the designated Telegram account owner, allowing the automation owner to instantly view emails sent to businesses."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "71475201-f82e-48de-a606-8772aba1bc49",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Information Extractor1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Information Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Information Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Information Extractor1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Information Extractor": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Information Extractor1": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}