Recherche de prospects basée sur l'IA et génération d'emails personnalisés (Groq et Google Sheets)
Ceci est unLead Nurturing, Multimodal AIworkflow d'automatisation du domainecontenant 22 nœuds.Utilise principalement des nœuds comme If, Code, GoogleSheets, ManualTrigger, SplitInBatches. Recherche de prospects basée sur l'IA et génération d'emails personnalisés : Utilisation de Groq et Google Sheets
- •Informations d'identification Google Sheets API
Nœuds utilisés (22)
Catégorie
{
"meta": {
"instanceId": "819f3d1c972a238903b1d9ec815f3780343ba88480484fe5c47770edd77c8a8f"
},
"nodes": [
{
"id": "aef4dd12-816e-4017-a951-dc2c6a0b8a1e",
"name": "If1",
"type": "n8n-nodes-base.if",
"position": [
-880,
-100
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "f9f45046-3aac-41f1-939d-3269646e542f",
"operator": {
"type": "string",
"operation": "empty",
"singleValue": true
},
"leftValue": "={{ $json[\"Hasil Riset\"] }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "3205240f-3653-4e0d-a638-2044a4a0a253",
"name": "Recherche Internet1",
"type": "@tavily/n8n-nodes-tavily.tavilyTool",
"position": [
560,
0
],
"parameters": {
"query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Query', ``, 'string') }}",
"options": {},
"descriptionType": "manual",
"toolDescription": "Get latest news/description on topic that user want to reseaarch"
},
"credentials": {
"tavilyApi": {
"id": "dNQcQ1QJtmgxWqia",
"name": "Tavily account"
}
},
"typeVersion": 1
},
{
"id": "6e9e4bcc-a713-421c-bac6-2901ca810723",
"name": "Recherche d'entreprise1",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-360,
-40
],
"parameters": {
"text": "=You are an expert business analyst. Your task is to research the company: {{ $json.Perusahaan }}.\n\nYour output must be a comprehensive description that identifies the company's name, its core business, and potential opportunities for improving efficiency and effectiveness by implementing AI solutions.\n\nUse the 'Search Internet' tool to gather the latest information.\n\nStrictly base your analysis on the data found through the internet search. Do not hallucinate or invent information.\n\nYour final output must be only the text description. Do not include any introductory sentences or greetings.",
"options": {},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "3f1d292f-a909-4b22-bbbf-3843cdd0913a",
"name": "Modèle de chat Groq1",
"type": "@n8n/n8n-nodes-langchain.lmChatGroq",
"position": [
400,
60
],
"parameters": {
"options": {}
},
"credentials": {
"groqApi": {
"id": "1RUvuOYI4v2AlIzb",
"name": "Groq account"
}
},
"typeVersion": 1
},
{
"id": "c075d4d7-ac55-4a4b-884e-67138d50a0c4",
"name": "mettre à jourStatut",
"type": "n8n-nodes-base.googleSheets",
"position": [
180,
-40
],
"parameters": {
"columns": {
"value": {
"Status": "Leads",
"Perusahaan": "={{ $('If1').item.json.Perusahaan }}"
},
"schema": [
{
"id": "Nama",
"type": "string",
"display": true,
"required": false,
"displayName": "Nama",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Jabatan",
"type": "string",
"display": true,
"required": false,
"displayName": "Jabatan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Email",
"type": "string",
"display": true,
"required": false,
"displayName": "Email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Perusahaan",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Perusahaan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Hasil Riset",
"type": "string",
"display": true,
"required": false,
"displayName": "Hasil Riset",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Send Email Perkenalan",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Send Email Perkenalan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Kirim email",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Kirim email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Respon Email Perkenalan",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Respon Email Perkenalan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Send email Follow up 1",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Send email Follow up 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Respon Email Follow up 1",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Respon Email Follow up 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Send email Follow up 2",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Send email Follow up 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Respon Email Follow up 2",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Respon Email Follow up 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Perusahaan"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY/edit#gid=0",
"cachedResultName": "Leads"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY/edit?usp=drivesdk",
"cachedResultName": "Leads To Sales"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "n0XqDbq8ykwdeS4k",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "a22f8ce1-bf68-408a-ba00-7f1ac83a7211",
"name": "mettre à jourDescription",
"type": "n8n-nodes-base.googleSheets",
"position": [
-20,
-40
],
"parameters": {
"columns": {
"value": {
"Perusahaan": "={{ $('If1').item.json.Perusahaan }}",
"Hasil Riset": "={{ $json.output }}"
},
"schema": [
{
"id": "Nama",
"type": "string",
"display": true,
"required": false,
"displayName": "Nama",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Jabatan",
"type": "string",
"display": true,
"required": false,
"displayName": "Jabatan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Email",
"type": "string",
"display": true,
"required": false,
"displayName": "Email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Perusahaan",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Perusahaan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Hasil Riset",
"type": "string",
"display": true,
"required": false,
"displayName": "Hasil Riset",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Send Email Perkenalan",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Send Email Perkenalan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Kirim email",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Kirim email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Respon Email Perkenalan",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Respon Email Perkenalan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Send email Follow up 1",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Send email Follow up 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Respon Email Follow up 1",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Respon Email Follow up 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Send email Follow up 2",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Send email Follow up 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Respon Email Follow up 2",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Respon Email Follow up 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Perusahaan"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY/edit#gid=0",
"cachedResultName": "Leads"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY/edit?usp=drivesdk",
"cachedResultName": "Leads To Sales"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "n0XqDbq8ykwdeS4k",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "89dd2953-8fe2-4798-879f-d92d1eb77c4d",
"name": "obtenirModèle",
"type": "n8n-nodes-base.googleSheets",
"position": [
-520,
540
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $json.Status }}",
"lookupColumn": "Tahap"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 102550433,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY/edit#gid=102550433",
"cachedResultName": "Template"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY/edit?usp=drivesdk",
"cachedResultName": "Leads To Sales"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "n0XqDbq8ykwdeS4k",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "eb74fb86-f67d-474b-a021-1077e6f7fa99",
"name": "Analyseur de sortie structurée1",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
980,
580
],
"parameters": {
"jsonSchemaExample": "{\n \"emailSubject\":\"Subject email \",\n \"emailBody\": \"body email lengkap\"\n}"
},
"typeVersion": 1.3
},
{
"id": "2dde3089-fb2a-4c20-a19a-ee75f250aebd",
"name": "rédigerEmail",
"type": "n8n-nodes-base.googleSheets",
"position": [
120,
540
],
"parameters": {
"columns": {
"value": {
"Perusahaan": "={{ $('If1').item.json.Perusahaan }}",
"Send Email Perkenalan": "={{ $json.output }}"
},
"schema": [
{
"id": "Nama",
"type": "string",
"display": true,
"required": false,
"displayName": "Nama",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Jabatan",
"type": "string",
"display": true,
"required": false,
"displayName": "Jabatan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Email",
"type": "string",
"display": true,
"required": false,
"displayName": "Email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Perusahaan",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Perusahaan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Hasil Riset",
"type": "string",
"display": true,
"required": false,
"displayName": "Hasil Riset",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Send Email Perkenalan",
"type": "string",
"display": true,
"required": false,
"displayName": "Send Email Perkenalan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Kirim email",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Kirim email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Respon Email Perkenalan",
"type": "string",
"display": true,
"required": false,
"displayName": "Respon Email Perkenalan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Send email Follow up 1",
"type": "string",
"display": true,
"required": false,
"displayName": "Send email Follow up 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Respon Email Follow up 1",
"type": "string",
"display": true,
"required": false,
"displayName": "Respon Email Follow up 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Send email Follow up 2",
"type": "string",
"display": true,
"required": false,
"displayName": "Send email Follow up 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Respon Email Follow up 2",
"type": "string",
"display": true,
"required": false,
"displayName": "Respon Email Follow up 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Perusahaan"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "id",
"value": "=gid=0"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY/edit?usp=drivesdk",
"cachedResultName": "Leads To Sales"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "n0XqDbq8ykwdeS4k",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "b2e44f4b-50f3-4bb6-9d60-ac6787f8c1b0",
"name": "Lors du clic sur 'Exécuter le workflow'",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-1320,
-100
],
"parameters": {},
"typeVersion": 1
},
{
"id": "65a91454-d953-4a14-b115-012cc5af41bb",
"name": "Obtenir la/les ligne(s) dans la feuille",
"type": "n8n-nodes-base.googleSheets",
"position": [
-1100,
-100
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY/edit#gid=0",
"cachedResultName": "Leads"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY/edit?usp=drivesdk",
"cachedResultName": "Leads To Sales"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "n0XqDbq8ykwdeS4k",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "9ee78456-5839-48b5-a89d-1bc1855e6607",
"name": "lienEntrée",
"type": "n8n-nodes-base.googleSheets",
"position": [
480,
540
],
"parameters": {
"columns": {
"value": {
"Perusahaan": "={{ $('If1').item.json.Perusahaan }}",
"Kirim email": "=https://n8n-brccptxv.ap-southeast-1.clawcloudrun.com/webhook/18169b76-7b07-4fce-95c4-7e5bb6244ed1/send-email/{{ $json.perusahaan_url_encoded }}"
},
"schema": [
{
"id": "Nama",
"type": "string",
"display": true,
"required": false,
"displayName": "Nama",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Jabatan",
"type": "string",
"display": true,
"required": false,
"displayName": "Jabatan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Email",
"type": "string",
"display": true,
"required": false,
"displayName": "Email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Perusahaan",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Perusahaan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Hasil Riset",
"type": "string",
"display": true,
"required": false,
"displayName": "Hasil Riset",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Send Email Perkenalan",
"type": "string",
"display": true,
"required": false,
"displayName": "Send Email Perkenalan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Kirim email",
"type": "string",
"display": true,
"required": false,
"displayName": "Kirim email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Respon Email Perkenalan",
"type": "string",
"display": true,
"required": false,
"displayName": "Respon Email Perkenalan",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Send email Follow up 1",
"type": "string",
"display": true,
"required": false,
"displayName": "Send email Follow up 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Respon Email Follow up 1",
"type": "string",
"display": true,
"required": false,
"displayName": "Respon Email Follow up 1",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Send email Follow up 2",
"type": "string",
"display": true,
"required": false,
"displayName": "Send email Follow up 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Respon Email Follow up 2",
"type": "string",
"display": true,
"required": false,
"displayName": "Respon Email Follow up 2",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Perusahaan"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY/edit#gid=0",
"cachedResultName": "Leads"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY/edit?usp=drivesdk",
"cachedResultName": "Leads To Sales"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "n0XqDbq8ykwdeS4k",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "20ca4e42-14f9-4393-92d4-32c6da0ba6c9",
"name": "Code",
"type": "n8n-nodes-base.code",
"position": [
300,
540
],
"parameters": {
"jsCode": "// Array untuk menampung hasil yang akan dikirim ke node selanjutnya\nconst outputItems = [];\n\n// Loop melalui setiap item yang masuk dari node sebelumnya\nfor (const item of items) {\n try {\n // 1. Ambil nama perusahaan dari object JSON\n // Pastikan key 'Perusahaan' ada di dalam data Anda\n const namaPerusahaan = item.json.Perusahaan;\n\n // 2. Lakukan replace spasi dengan '%20'\n // Menggunakan encodeURIComponent() adalah cara yang paling tepat dan aman\n // untuk mempersiapkan string sebagai bagian dari URL.\n // Ini tidak hanya mengganti spasi, tapi juga karakter spesial lainnya.\n const namaPerusahaanEncoded = encodeURIComponent(namaPerusahaan);\n\n // Alternatif jika Anda HANYA ingin mengganti spasi:\n // const namaPerusahaanEncoded = namaPerusahaan.replace(/ /g, '%20');\n\n // 3. Buat object baru untuk output\n // Anda bisa menyertakan data asli jika perlu dengan '...item.json'\n const outputData = {\n ...item.json, // Menyalin semua data asli\n perusahaan_url_encoded: namaPerusahaanEncoded // Menambahkan field baru dengan hasil replace\n };\n\n // Tambahkan hasil ke dalam array output\n outputItems.push({ json: outputData });\n\n } catch (error) {\n // Jika terjadi error (misalnya key 'Perusahaan' tidak ditemukan),\n // teruskan item tersebut tanpa perubahan untuk menghindari workflow berhenti.\n outputItems.push(item);\n }\n}\n\n// Kembalikan semua item yang telah diproses untuk digunakan oleh node selanjutnya\nreturn outputItems;"
},
"typeVersion": 2
},
{
"id": "781e118b-7062-4f1c-aeb3-a025f9740844",
"name": "Recherche Internet2",
"type": "@tavily/n8n-nodes-tavily.tavilyTool",
"position": [
840,
640
],
"parameters": {
"query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Query', ``, 'string') }}",
"options": {},
"descriptionType": "manual",
"toolDescription": "Get latest news/description on topic that user want to reseaarch"
},
"credentials": {
"tavilyApi": {
"id": "dNQcQ1QJtmgxWqia",
"name": "Tavily account"
}
},
"typeVersion": 1
},
{
"id": "dfab319e-a76d-4c72-a0e9-6d8120efc0f5",
"name": "Boucler sur les éléments1",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-580,
-40
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "6db18626-365c-4071-a777-7e4c56455f74",
"name": "Modèle de chat Groq",
"type": "@n8n/n8n-nodes-langchain.lmChatGroq",
"position": [
700,
580
],
"parameters": {
"options": {}
},
"credentials": {
"groqApi": {
"id": "1RUvuOYI4v2AlIzb",
"name": "Groq account"
}
},
"typeVersion": 1
},
{
"id": "256aaaca-a8a1-4499-bdbc-650137550b8a",
"name": "obtenirService",
"type": "n8n-nodes-base.googleSheets",
"position": [
-360,
540
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1197995458,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY/edit#gid=1197995458",
"cachedResultName": "List Product"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nYii2KQDrKZNUPbLJ6r2ogNnGGZggJOJR6b6CGM3slY/edit?usp=drivesdk",
"cachedResultName": "Leads To Sales"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "n0XqDbq8ykwdeS4k",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "573beee9-2030-496f-bb63-0a3384d4d07a",
"name": "Note adhésive",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1380,
-340
],
"parameters": {
"color": 4,
"width": 720,
"height": 380,
"content": "## Get Leads Data\n* **Data Source:** The workflow starts by fetching lead data from a **Google Sheet**. This sheet is designed to act as a central hub, likely connected to a **Google Form** where new leads are automatically captured. This architecture is highly flexible; the Google Sheet can be easily replaced with other data sources like a **Supabase** database, **Airtable**, or even be pulled directly from your **CRM**.\n* **Smart Filter:** Before being processed further, the workflow performs a crucial check using an `If` node. It verifies if the \"Research_Result\" column for a lead is empty. This is a key efficiency measure to ensure the workflow **only processes new leads** that haven't been previously analyzed, preventing duplicate work."
},
"typeVersion": 1
},
{
"id": "20a1914f-6bf3-4093-9acb-98ae73cbb17a",
"name": "Note adhésive1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-620,
-340
],
"parameters": {
"color": 3,
"width": 1380,
"height": 540,
"content": "## Company Research\n* **Individual Processing:** Each qualified lead is then processed individually using the `Loop Over Items` node, ensuring that every research task and the generated email is focused and specific to a single company at a time.\n* **AI Business Analyst:** The core of this stage is an **AI Agent** (`Company Research1`) assigned the role of an expert business analyst. Its task goes beyond finding general information. Based on a specific *prompt*, the AI is assigned to:\n * Identify the target company's name and core business model.\n * Find the latest and most relevant information about the company.\n * **Analyze and identify opportunities** where your company's AI and automation services can improve efficiency and effectiveness.\n* **Accurate & Current Data:** To avoid hallucinations and ensure relevance, the AI Agent is equipped with a **real-time internet search** tool (using `Tavily`). This allows it to access the latest news, reports, and articles about the target company.\n* **Recording the Results:** The analytical description from the research is automatically inserted back into the Google Sheet under the `Research_Result` column for the corresponding lead. The lead's status is also updated to `Researched`, indicating that the research phase is complete and the lead is ready for email generation.\n"
},
"typeVersion": 1
},
{
"id": "3fe97a6c-794b-4912-8a2e-bee3c69fd8f5",
"name": "Note adhésive2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-560,
220
],
"parameters": {
"color": 5,
"width": 1720,
"height": 560,
"content": "## Generate & Send Lead Email\n* **Gathering Context:** A second **AI Sales Assistant** ,\" is activated. This agent gathers various pieces of information to craft the perfect email:\n * **Lead Data:** The contact's name, position, and company name.\n * **Research Results:** The in-depth analysis from the previous stage.\n * **Your Services:** A list of the products/services you offer, fetched from the \"List Product\" sheet.\n * **Template & Theme:** The appropriate email template from the \"Template\" sheet, based on the lead's status (e.g., an \"Introduction\" email).\n* **Additional Research for a \"Hook\":** To make the email stand out, the AI performs a **second, more targeted internet search**. The goal is to find a recent statistic or fact (e.g., *\"ESG reporting challenges for Indonesian banks in 2025\"*) that is highly relevant to the recipient's position, which will be used as a powerful opening line (the hook).\n* **Drafting the Email & CTA:** Using all this context, the AI drafts a complete email—including the *subject* and *body*—that is personalized, relevant, and leads to a clear *Call to Action* (CTA). The result is saved in a structured JSON format in the `Draft_Intro_Email` column.\n* **The Send Trigger:** The workflow cleverly creates a **unique URL** in the `Send_Email_Link` column. This URL functions as a manual trigger. When you click this link in Google Sheets, it calls a webhook that can be configured to send the email. This provides a layer of *'human-in-the-loop'* control, allowing the sales team to review the draft before it's sent."
},
"typeVersion": 1
},
{
"id": "74633aa8-d54a-4003-a06c-bd7f697b3950",
"name": "Note adhésive3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1380,
80
],
"parameters": {
"color": 7,
"width": 720,
"height": 940,
"content": "## Overall Description & Potential\n\n**<< What Does This Flow Do? >>**\n\nOverall, this workflow is an **intelligent sales outreach automation engine** that transforms raw leads from a form or a list into highly personalized, ready-to-send introductory email drafts. The process is: it starts by fetching data, enriches it with in-depth AI research to uncover \"pain points,\" and then uses those research findings to craft an email that is relevant to the solutions you offer.\n\nThis system solves a key problem in sales: the lack of time to conduct in-depth research on every single lead. By automating the research and drafting stages, the sales team can focus on higher-value activities, like engaging with \"warm\" prospects and handling negotiations. Using Google Sheets as the main dashboard allows the team to monitor the entire process—from lead entry, research status, and email drafts, all the way to the send link—all within a single, familiar interface.\n\n**<< Potential Future Enhancements >>**\n\nThis workflow has a very strong foundation and can be further developed into an even more sophisticated system:\n\n1. **Full Automation (Zero-Touch):** Instead of generating a manual-click link, the output from the AI Agent can be directly piped into a **Gmail** or **Microsoft 365 Email** node to send emails automatically. A `Wait` node could be added to create a delay of a few minutes or hours after the draft is created, preventing instant sending.\n\n2. **Automated Follow-up Sequences:** The workflow can be extended to manage follow-up emails. By using a webhook to track email opens or replies, you could build logic like: *\"If the intro email is not replied to within 3 days, trigger the AI Agent again to generate follow-up email #1 based on a different template, and then send it.\"*\n\n3. **AI-Powered Lead Scoring:** After the research stage, the AI could be given the additional task of **scoring leads** (e.g., 1-10 or High/Medium/Low Priority) based on how well the target company's profile matches your ideal customer profile (ICP). This helps the sales team prioritize the most promising leads.\n\n4. **Full CRM Integration:** Instead of Google Sheets, the workflow could connect directly to **HubSpot, Salesforce, or Pipedrive**. It would pull new leads from the CRM, perform the research, draft the email, and log all activities (research results, sent emails) back to the contact's timeline in the CRM automatically.\n\n5. **Multi-Channel Outreach:** Beyond email, the AI could be instructed to draft personalized **LinkedIn Connection Request** messages or **WhatsApp** messages. The workflow could then use the appropriate APIs to send these messages, expanding your outreach beyond just email."
},
"typeVersion": 1
},
{
"id": "0d809625-af14-4e3f-9a43-dcebb36d3100",
"name": "Assistant commercial IA",
"type": "@n8n/n8n-nodes-langchain.agent",
"onError": "continueRegularOutput",
"position": [
-180,
540
],
"parameters": {
"text": "=You are an expert AI Sales Assistant, tasked with drafting a personalized and relevant email based on the provided data and additional research.\n\n1. PRIMARY CONTEXT (Based on Provided Data):\nSender's Company: Ainabler.com (IT consulting firm specializing in AI & Automation).\nSender's Name: Hanif R (Technical Sales).\nTarget Company: {{ $('If1').item.json.Perusahaan }}\nTarget Recipient: {{ $('If1').item.json.Nama }}\nRecipient's Position: {{ $('If1').item.json.Jabatan }}\nSales Stage: {{ $('getTemplate').item.json.Tahap }}\nMain Email Theme: {{ $('getTemplate').item.json.Tema }}\nKey Information: {{ $('Company Research1').item.json.output }}\nSample Message (For inspiration, not a rigid template): {{ $('getTemplate').item.json['Contoh message'] }}\nToday's Date: {{ $now }}\n\n2. ADDITIONAL RESEARCH TASK (Use Search Internet2):\nBefore writing the email, use Search Internet2 to find one or two recent facts/statistics (from 2024-2025) relevant to the recipient's position and their industry. The goal is to add a strong, data-driven 'hook' to make the email opening compelling.\nExample Research Direction: Based on the position '{{ $('If1').item.json.Jabatan }}', formulate a smart search query.\n- If the position is related to ESG, search for: \"ESG reporting challenges Indonesian banking 2025\"\n- If the position is related to Digital/Operations, search for: \"AI adoption statistics in Southeast Asia financial sector\"\n\n3. FINAL TASK: DRAFT THE EMAIL\nUse ALL the information above (Primary Context + Additional Research) to create one email draft.\n- Personalization: Mention the recipient's company name and position to show this is not a mass email.\n- Relevance: Connect the industry challenges (discovered from your research) with the solutions offered by Ainabler.com.\n- Value Proposition: Craft a natural and seamless offer based on our services and the target's business line. Adapt from the sample message, but do not be rigid.\n- Call to Action: Propose a brief discussion to explore possibilities.\n\n4. OUTPUT FORMAT (MANDATORY):\nYour final response MUST be a single, valid JSON object. Do not include any text, introductions, or closings outside of this JSON object.\n\n{\n \"emailSubject\": \"A compelling and specific email subject\",\n \"emailBody\": \"The complete, personalized, and relevant email body.\"\n}",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"executeOnce": true,
"typeVersion": 2
}
],
"pinData": {},
"connections": {
"aef4dd12-816e-4017-a951-dc2c6a0b8a1e": {
"main": [
[
{
"node": "dfab319e-a76d-4c72-a0e9-6d8120efc0f5",
"type": "main",
"index": 0
}
]
]
},
"20ca4e42-14f9-4393-92d4-32c6da0ba6c9": {
"main": [
[
{
"node": "9ee78456-5839-48b5-a89d-1bc1855e6607",
"type": "main",
"index": 0
}
]
]
},
"9ee78456-5839-48b5-a89d-1bc1855e6607": {
"main": [
[
{
"node": "dfab319e-a76d-4c72-a0e9-6d8120efc0f5",
"type": "main",
"index": 0
}
]
]
},
"2dde3089-fb2a-4c20-a19a-ee75f250aebd": {
"main": [
[
{
"node": "20ca4e42-14f9-4393-92d4-32c6da0ba6c9",
"type": "main",
"index": 0
}
]
]
},
"256aaaca-a8a1-4499-bdbc-650137550b8a": {
"main": [
[
{
"node": "0d809625-af14-4e3f-9a43-dcebb36d3100",
"type": "main",
"index": 0
}
]
]
},
"89dd2953-8fe2-4798-879f-d92d1eb77c4d": {
"main": [
[
{
"node": "256aaaca-a8a1-4499-bdbc-650137550b8a",
"type": "main",
"index": 0
}
]
]
},
"c075d4d7-ac55-4a4b-884e-67138d50a0c4": {
"main": [
[
{
"node": "89dd2953-8fe2-4798-879f-d92d1eb77c4d",
"type": "main",
"index": 0
}
]
]
},
"6db18626-365c-4071-a777-7e4c56455f74": {
"ai_languageModel": [
[
{
"node": "0d809625-af14-4e3f-9a43-dcebb36d3100",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"3f1d292f-a909-4b22-bbbf-3843cdd0913a": {
"ai_languageModel": [
[
{
"node": "6e9e4bcc-a713-421c-bac6-2901ca810723",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"dfab319e-a76d-4c72-a0e9-6d8120efc0f5": {
"main": [
[],
[
{
"node": "6e9e4bcc-a713-421c-bac6-2901ca810723",
"type": "main",
"index": 0
}
]
]
},
"3205240f-3653-4e0d-a638-2044a4a0a253": {
"ai_tool": [
[
{
"node": "6e9e4bcc-a713-421c-bac6-2901ca810723",
"type": "ai_tool",
"index": 0
}
]
]
},
"781e118b-7062-4f1c-aeb3-a025f9740844": {
"ai_tool": [
[
{
"node": "0d809625-af14-4e3f-9a43-dcebb36d3100",
"type": "ai_tool",
"index": 0
}
]
]
},
"6e9e4bcc-a713-421c-bac6-2901ca810723": {
"main": [
[
{
"node": "a22f8ce1-bf68-408a-ba00-7f1ac83a7211",
"type": "main",
"index": 0
}
]
]
},
"a22f8ce1-bf68-408a-ba00-7f1ac83a7211": {
"main": [
[
{
"node": "c075d4d7-ac55-4a4b-884e-67138d50a0c4",
"type": "main",
"index": 0
}
]
]
},
"0d809625-af14-4e3f-9a43-dcebb36d3100": {
"main": [
[
{
"node": "2dde3089-fb2a-4c20-a19a-ee75f250aebd",
"type": "main",
"index": 0
}
]
]
},
"65a91454-d953-4a14-b115-012cc5af41bb": {
"main": [
[
{
"node": "aef4dd12-816e-4017-a951-dc2c6a0b8a1e",
"type": "main",
"index": 0
}
]
]
},
"eb74fb86-f67d-474b-a021-1077e6f7fa99": {
"ai_outputParser": [
[
{
"node": "0d809625-af14-4e3f-9a43-dcebb36d3100",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"b2e44f4b-50f3-4bb6-9d60-ac6787f8c1b0": {
"main": [
[
{
"node": "65a91454-d953-4a14-b115-012cc5af41bb",
"type": "main",
"index": 0
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Avancé - Nurturing de leads, IA Multimodale
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
ainabler
@ainablerPartager ce workflow