{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "3e22ea96-f717-4b7d-9a09-e6ea5fcf63ce",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        608
      ],
      "parameters": {
        "color": 5,
        "width": 1420,
        "height": 620,
        "content": "# Company Knowledge Base Section\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b7ceebe5-a95c-4da3-b1bf-9922b0befd82",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        608
      ],
      "parameters": {
        "color": 7,
        "width": 1232,
        "height": 312,
        "content": "# Data Scraping & Cleaning Section\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b3b1e4b1-7991-47d8-9bdc-d0072ee2cb23",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "disabled": true,
      "position": [
        0,
        1808
      ],
      "parameters": {
        "color": 4,
        "width": 1232,
        "height": 468,
        "content": "# Reply Handling Section"
      },
      "typeVersion": 1
    },
    {
      "id": "f7e4e683-aec0-496b-8b99-5819f81be60c",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "disabled": true,
      "position": [
        0,
        1264
      ],
      "parameters": {
        "color": 4,
        "width": 1232,
        "height": 468,
        "content": "# Outbound Messaging Section"
      },
      "typeVersion": 1
    },
    {
      "id": "ffb9d104-ef88-4902-948e-3bea9e948dd2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        1264
      ],
      "parameters": {
        "color": 5,
        "width": 1420,
        "height": 476,
        "content": "# Send Message"
      },
      "typeVersion": 1
    },
    {
      "id": "51d9511d-6c8b-4774-a147-158c2bbcd73a",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        944
      ],
      "parameters": {
        "color": 7,
        "width": 1232,
        "height": 296,
        "content": "# Data Enrichment Section"
      },
      "typeVersion": 1
    },
    {
      "id": "2238a081-e661-46de-9030-6640039a24c3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        1808
      ],
      "parameters": {
        "color": 5,
        "width": 1436,
        "height": 476,
        "content": "# Send Message"
      },
      "typeVersion": 1
    },
    {
      "id": "2f6091cb-7e88-4d01-9786-3cb7ece2c58b",
      "name": "Incoming message",
      "type": "@devlikeapro/n8n-nodes-waha.wahaTrigger",
      "position": [
        -240,
        1440
      ],
      "parameters": {},
      "typeVersion": 202502
    },
    {
      "id": "1be34db3-dba7-4a87-97b3-bb9e4a056749",
      "name": "Manual Trigger - Start Scraping",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        112,
        720
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "dc1a18aa-ad2d-49d0-b29d-cda2f5af1338",
      "name": "Daily Outbound Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        48,
        1072
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "months"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "78110e8e-267c-4bc7-8377-bb81c68eb74b",
      "name": "Schedule Outbound message",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        48,
        1440
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7c63402c-0f59-4d54-8408-f90a1151975b",
      "name": "Knowledge Base Updated Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        1328,
        736
      ],
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFile",
        "fileToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "13YClv41pt53diWxfd69pMo4lMlFL6-BlF2UHrGLv3SA",
          "cachedResultUrl": "https://docs.google.com/document/d/13YClv41pt53diWxfd69pMo4lMlFL6-BlF2UHrGLv3SA/edit?usp=drivesdk",
          "cachedResultName": "RC - Knowledge Docs"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "497b37ef-b0eb-411d-9de7-0b7743c8d8ea",
      "name": "Configure Scraping Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        720
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "07316f79-4f95-48ff-a238-cab510439809",
              "name": "Location Category",
              "type": "string",
              "value": "\"bar\", \"restaurant\", \"mall\""
            },
            {
              "id": "e80e3961-4f18-4e38-8642-4c35075f13a1",
              "name": "lokasi",
              "type": "string",
              "value": "Jakarta"
            },
            {
              "id": "a9996b6d-0bdb-4aa6-8b86-bd36acb6ad21",
              "name": "jumlah leads",
              "type": "number",
              "value": 150
            },
            {
              "id": "0b41b3c1-21f6-4f6b-9125-3cc19371e495",
              "name": "minimum Stars",
              "type": "string",
              "value": "four"
            },
            {
              "id": "e923310c-71f4-4bc8-89af-5331b286beee",
              "name": "Skip Closed Place",
              "type": "boolean",
              "value": true
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c6769765-1aba-4682-8eaf-bccff2223a4b",
      "name": "Extract WhatsApp Session Data",
      "type": "n8n-nodes-base.set",
      "position": [
        128,
        1904
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b79a668e-b625-491f-b008-40d63dfc01c6",
              "name": "session",
              "type": "string",
              "value": "={{ $json.payload.from.replace(\"@c.us\", \"\") }}"
            },
            {
              "id": "13dec802-3597-471e-9d7c-85693c8362df",
              "name": "message",
              "type": "string",
              "value": "={{ $json.payload.body }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "13f1ed51-d927-4e94-978e-5156109636ed",
      "name": "Prepare Outbound Session Data",
      "type": "n8n-nodes-base.set",
      "position": [
        784,
        1408
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b79a668e-b625-491f-b008-40d63dfc01c6",
              "name": "session",
              "type": "string",
              "value": "={{ $json['Phone Number'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5ec46caa-1ac0-4c87-a329-782606b7d564",
      "name": "Format Reply Message Data",
      "type": "n8n-nodes-base.set",
      "position": [
        1328,
        1920
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "275dd51e-077a-41ff-aa6f-adcb2b10c51f",
              "name": "number",
              "type": "string",
              "value": "={{ $('Extract WhatsApp Session Data').item.json.session }}"
            },
            {
              "id": "b41121cf-9f9e-4560-a033-7be5ba1556f4",
              "name": "message",
              "type": "string",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ae1f1a0d-22c5-4d01-ba87-895ab51eed5f",
      "name": "Format Outbound Message Data",
      "type": "n8n-nodes-base.set",
      "position": [
        1344,
        1408
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "275dd51e-077a-41ff-aa6f-adcb2b10c51f",
              "name": "number",
              "type": "string",
              "value": "={{ $('Prepare Outbound Session Data').item.json.session }}"
            },
            {
              "id": "b41121cf-9f9e-4560-a033-7be5ba1556f4",
              "name": "message",
              "type": "string",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bd902835-a438-4352-ad15-34ee9cf2e0dc",
      "name": "Execute Google Maps Scraper",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        528,
        720
      ],
      "parameters": {
        "actorId": {
          "__rl": true,
          "mode": "list",
          "value": "nwua9Gu5YrADL7ZDj",
          "cachedResultUrl": "https://console.apify.com/actors/nwua9Gu5YrADL7ZDj/input",
          "cachedResultName": "Google Maps Scraper (compass/crawler-google-places)"
        },
        "timeout": {},
        "customBody": "={\n    \"includeWebResults\": false,\n    \"language\": \"en\",\n    \"leadsEnrichmentDepartments\": [\n        \"marketing\"\n    ],\n    \"locationQuery\": \"{{ $json.lokasi }}\",\n    \"maxCrawledPlacesPerSearch\": {{ $json['jumlah leads'] }},\n    \"maxImages\": 0,\n    \"maximumLeadsEnrichmentRecords\": 0,\n    \"placeMinimumStars\": \"{{ $json['minimum Stars'] }}\",\n    \"scrapeContacts\": true,\n    \"scrapeDirectories\": false,\n    \"scrapeImageAuthors\": false,\n    \"scrapePlaceDetailPage\": false,\n    \"scrapeReviewsPersonalData\": true,\n    \"scrapeTableReservationProvider\": false,\n    \"searchStringsArray\": [\n        {{ $json['Location Category'] }}\n    ],\n    \"skipClosedPlaces\": {{ $json['Skip Closed Place'] }}\n}"
      },
      "credentials": {
        "apifyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "159bcdcb-6021-40e9-a1b9-f97c9c510fb1",
      "name": "Fetch Scraped Business Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        752,
        720
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/compass~crawler-google-places/runs/last/dataset/items",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "apifyApi"
      },
      "credentials": {
        "apifyApi": {
          "name": "<your credential>"
        },
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1876c723-a614-4bfb-84b7-3a2196c66191",
      "name": "Save Raw Business Leads",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        960,
        720
      ],
      "parameters": {
        "columns": {
          "value": {
            "City": "={{ $json.city || \"not found\" }}",
            "Email": "={{ $json.emails[0] || \"not found\" }}",
            "State": "={{ $json.state || \"not found\" }}",
            "Title": "={{ $json.title }}",
            "Address": "={{ $json.address }}",
            "Website": "={{ $json.domain || \"not found\"  }}",
            "Category": "={{ $json.categoryName }}",
            "Facebook": "={{ $json.facebooks[0] || \"not found\" }}",
            "Linkedin": "={{ $json.linkedIns[0] || \"not found\" }}",
            "Place Id": "={{ $json.placeId }}",
            "Instagram": "={{ $json.instagrams[0] || \"not found\" }}",
            "Company name": "=",
            "Phone Number": "={{ $json.phones[0] || $json.phonesUncertain[0] || \"not found\" }}",
            "Review Count": "={{ $json.reviewsCount }}",
            "Average Stars": "={{ $json.totalScore }}"
          },
          "schema": [
            {
              "id": "Place Id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Place Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Category",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "City",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "City",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "State",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "State",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Company name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Number",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Phone Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Instagram",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Instagram",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Facebook",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Facebook",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Linkedin",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Linkedin",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Review Count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Review Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Average Stars",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Average Stars",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Place Id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws/edit#gid=0",
          "cachedResultName": "Raw Data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws/edit?usp=drivesdk",
          "cachedResultName": "Recharge Database"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "933567e2-44d9-4378-be40-7e340f901f9d",
      "name": "Get Outbound Candidates",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        224,
        1440
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": true
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws/edit#gid=0",
          "cachedResultName": "Raw Data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws/edit?usp=drivesdk",
          "cachedResultName": "Recharge Database"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "5f7a6066-d195-4d74-9e6d-f9379c9df61d",
      "name": "Get Unenriched Records",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        208,
        1072
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": false
        },
        "filtersUI": {
          "values": [
            {
              "lookupValue": "no",
              "lookupColumn": "enriched"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws/edit#gid=0",
          "cachedResultName": "Raw Data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws/edit?usp=drivesdk",
          "cachedResultName": "Recharge Database"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "c0d49668-0674-4aee-9a98-281bf3b6aa53",
      "name": "Limit Outbound Batch Size",
      "type": "n8n-nodes-base.limit",
      "position": [
        400,
        1440
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "347be385-a3a8-42fc-b52e-577db5dc2808",
      "name": "Limit Enrichment Batch Size",
      "type": "n8n-nodes-base.limit",
      "position": [
        400,
        1072
      ],
      "parameters": {
        "maxItems": 20
      },
      "typeVersion": 1
    },
    {
      "id": "6ace837b-b562-437d-a922-b453d5859c5f",
      "name": "Validate Phone Number Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        592,
        1440
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "9b9cb4bc-8868-431d-a007-8a4650976d33",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json['Phone Number'] }}",
              "rightValue": ""
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "20e00445-9d82-46d2-85f1-48b9c35a000d",
      "name": "Reply Handler AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        352,
        1904
      ],
      "parameters": {
        "text": "={{ $json.message }}",
        "options": {
          "systemMessage": "=[Yourcompany] Sales Assistant - Siska (Reply Handler)\nYou are \"Siska\" from [Yourcompany], handling replies from potential partners after opening messages have been sent.\nConversation Flow Analysis\nAnalyze replies and follow the appropriate flow:\n1. Partner Directly Provides PIC Contact\nDetection: Reply contains name, position, phone number, or contact email\nResponse: \"Thank you for the information! Our sales team will directly contact [PIC name] to discuss further cooperation.\"\nAction: Save contact to database using append tool\n2. Partner Asks About Partnership Format\nDetection: Questions like \"what kind of partnership?\", \"how does the cooperation work?\", \"what's being offered?\"\nResponse: Explain casually using knowledge base:\n\"Oh, so here's how it works... we provide vending machines for powerbank rental at your location. So customers who need to charge their phones can directly rent powerbanks from our machine.\nBy the way, are you the one handling partnerships here? Or is there a specific PIC who usually manages partnerships like this?\"\n3. Partner Requests Proposal\nDetection: Requests like \"send proposal first\", \"can you email the proposal?\", \"do you have a company profile?\"\nResponse: \"Alright, we'll send the proposal shortly. Thank you for your interest in partnering with ReCharge!\"\nAction: Note proposal request\n4. Partner Agrees to Meeting/Call\nDetection: Positive responses like \"yes, that's fine\", \"it can be explained\", \"please call\"\nResponse: \"Great! We can meet in person to explain in more detail. When would be a good time for you?\"\nAction: Note willingness for offline meeting\n5. Identifying the Right PIC\n\nIf speaking with the right PIC: Offer offline meeting\nIf not the right PIC: \"I see, so who would be the PIC who usually handles partnerships or cooperation here? So I can coordinate directly with the person in charge.\"\n\n6. Partner Not Interested/Declining\nDetection: Rejections like \"not interested\", \"don't need it\", \"not currently needed\"\nResponse: \"Thank you for your time. If you ever need partnership opportunities in the future, don't hesitate to contact us!\"\nTools Usage:\n\nPinecone: Use to explain ReCharge cooperation details\nGoogle Sheets: Use ONLY when receiving PIC contact or partnership info. Data format:\n\nPlace: Company/location name (from previous conversation context)\nname: PIC name\ntitle: PIC position\nphone_number: PIC phone number\n\n\n\nData Context:\n\nALWAYS remember company/location name from previous messages in conversation history\nIf not available in history, ask \"Sorry, is this for partnership with which company/location?\"\n\nResponse Guidelines:\n\nAlways use polite and professional Indonesian language\nUse line breaks for better readability\nMatch the partner's energy level\nFocus on clear next steps\n\nImportant Notes:\n\nDon't over-explain if partner has already provided contact\nAlways confirm the next action to be taken\nMaintain friendly but professional tone"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "094266f6-0115-488d-8efc-84ca507d0241",
      "name": "Outbound Message Generator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        960,
        1408
      ],
      "parameters": {
        "text": "=company name: {{ $('Get Outbound Candidates').item.json.Title }}\n\nAddress: {{ $('Get Outbound Candidates').item.json.Address }}",
        "options": {
          "systemMessage": "=# ReCharge Outbound Message Initiator - Jessica\n\nYou are \"Jessica\", a sales representative from [Yourcompany]. Your task is to generate the initial outbound message for cold outreach to potential partners.\n\n## Your Role:\nGenerate a personalized greeting message in Indonesian for starting conversations with potential business partners.\n\n## Message Template:\nAlways use this exact format:\n\"Halo Selamat [waktu], \n\nPerkenalkan saya Siska dari [Yourcompany]. Salam kenal. \n\nSaya ingin bertanya kalau saya ingin bekerjasama dengan [nama lokasi/brand] saya bisa kontak kebagian apa?\"\n\n## Instructions:\n- Replace [waktu] with appropriate time greeting:\n  * Pagi (06:00-11:59)\n  * Siang (12:00-17:59) \n  * Sore (18:00-23:59)\n- Replace [nama lokasi/brand] with the business name from the input data\n- This is ONLY for the initial outbound message\n- Keep the message professional and friendly\n- Do not engage in conversation - just deliver the opening message\n\n## Important Notes:\n- This session will be stored using the phone number as session key\n- Reply handling will be managed by a separate workflow\n- Do not access knowledge base for this simple greeting\n- Focus only on generating the opening message"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "ae6b7c14-c225-40be-ab23-e07197c29e95",
      "name": "Reply Handler LLM",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        192,
        2112
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ebfb929e-c163-43ba-bc79-f81e592c1b0e",
      "name": "Outbound Message LLM",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        944,
        1552
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "648673dc-cb91-4072-8f9b-622cf8633ddf",
      "name": "Business Data Enrichment",
      "type": "n8n-nodes-base.perplexity",
      "position": [
        736,
        1072
      ],
      "parameters": {
        "model": "sonar-pro",
        "options": {},
        "messages": {
          "message": [
            {
              "role": "system",
              "content": "=You are a web-grounded data enricher for Indonesian business listings. Your job is to search the live web, cross-verify facts, and fill missing fields with high precision and source citations. Follow these rules strictly:\n\nScope & Matching\n\nTarget entity is a physical place (Google Maps Place). Match using: name, full address, city/state, category, and any official brand owner. Prefer sources that show the exact address or a clear \u201cofficial\u201d site/social of the venue.\n\nIf there\u2019s any doubt (similar mall names/brands), treat as ambiguous and return null with a note; do not guess.\n\nResearch Requirements\n\nUse multiple reputable sources (official site, official social profiles, Google Business/Maps, authoritative news or operator/brand pages).\n\nPrefer the official website of the venue/brand/operator over directories. If no website exists but an official Instagram or Facebook page exists, you may use that as website only if it\u2019s clearly the official presence of the venue.\n\nExtract public contact email and phone (published for customers). Don\u2019t invent generic addresses (e.g., info@...) unless it is explicitly listed.\n\nNormalization\n\nwebsite: canonical HTTPS URL, strip tracking params, no URL shorteners, no generic domains like just instagram.com\u2014use the page URL (e.g., https://www.instagram.com/livingworlddenpasar/).\n\nphone_number: E.164 with Indonesia code, e.g., +62361xxxxxxx or +628xx... for mobiles. Remove spaces/dashes.\n\nemail: lowercase, single address (prefer the most official/general contact).\n\ninstagram, facebook, linkedin: full canonical profile/page URLs (no querystrings).\n\nKeep all other provided fields as-is unless obviously misspelled (don\u2019t \u201cfix\u201d names).\n\nOutput Contract (strict)\nReturn only JSON, no prose. Use this exact shape:\n\n{\n  \"row_number\": <number>,\n  \"place_id\": \"<string>\",\n  \"title\": \"<string>\",\n  \"category\": \"<string>\",\n  \"city\": \"<string>\",\n  \"state\": \"<string>\",\n  \"address\": \"<string>\",\n  \"company_name\": \"<string|null>\",\n  \"website\": \"<string|null>\",\n  \"email\": \"<string|null>\",\n  \"phone_number\": \"<string|null>\",\n  \"instagram\": \"<string|null>\",\n  \"facebook\": \"<string|null>\",\n  \"linkedin\": \"<string|null>\",\n  \"review_count\": <number|null>,\n  \"average_stars\": <number|null>,\n  \"enriched\": \"yes\",\n  \"sources\": {\n    \"company_name\": [\"<url>\", \"...\"],\n    \"website\": [\"<url>\", \"...\"],\n    \"email\": [\"<url>\", \"...\"],\n    \"phone_number\": [\"<url>\", \"...\"],\n    \"instagram\": [\"<url>\", \"...\"],\n    \"facebook\": [\"<url>\", \"...\"],\n    \"linkedin\": [\"<url>\", \"...\"]\n  },\n  \"confidence\": {\n    \"company_name\": 0.0,\n    \"website\": 0.0,\n    \"email\": 0.0,\n    \"phone_number\": 0.0,\n    \"instagram\": 0.0,\n    \"facebook\": 0.0,\n    \"linkedin\": 0.0\n  },\n  \"notes\": \"<short explanation of any ambiguities or choices; empty string if none>\"\n}\n\n\nScoring & Nulls\n\nEach confidence is 0.0\u20131.0. Use \u22640.6 if inferred from indirect/secondary sources; \u22650.8 if confirmed on the official site or multiple agreeing sources.\n\nIf not found or ambiguous, set the field to null, provide a short reason in notes, and still include the most relevant sources you checked.\n\nFormatting\n\nOutput must be valid JSON and only that JSON. No markdown code fences in the final answer to the user."
            },
            {
              "content": "=Enrich the following venue record. Research the live web (both Indonesian and English sources), fill any missing fields, normalize as specified, cite sources, and return only the JSON object defined in the schema. If any field can\u2019t be verified confidently, return null and explain briefly in notes.\n\n{\n  \"row_number\": {{ $json.row_number }},\n  \"place_id\": {{ JSON.stringify($json['Place Id'] ?? null) }},\n  \"title\": {{ JSON.stringify($json.Title ?? null) }},\n  \"category\": {{ JSON.stringify($json.Category ?? null) }},\n  \"city\": {{ JSON.stringify($json.City ?? null) }},\n  \"state\": {{ JSON.stringify($json.State ?? null) }},\n  \"address\": {{ JSON.stringify($json.Address ?? null) }},\n  \"company_name\": null,\n  \"website\": {{ JSON.stringify($json.Website ?? null) }},\n  \"email\": {{ JSON.stringify($json.Email ?? null) }},\n  \"phone_number\": {{ JSON.stringify($json['Phone Number'] ?? null) }},\n  \"instagram\": {{ JSON.stringify($json.Instagram ?? null) }},\n  \"facebook\": {{ JSON.stringify($json.Facebook ?? null) }},\n  \"linkedin\": {{ JSON.stringify($json.Linkedin ?? null) }},\n  \"review_count\": {{ $json['Review Count'] }},\n  \"average_stars\": {{ $json['Average Stars'] }}\n}\n\nImportant:\nReplace placeholder/invalid values (like \"instagram.com\", \"not found\") with either a normalized value or null.\nKeep row_number, place_id, title, category, city, state, address, review_count, and average_stars unless you find a definitive correction on an official source\u2014if corrected, explain in notes.\nReturn only JSON, no markdown."
            }
          ]
        },
        "requestOptions": {}
      },
      "credentials": {
        "perplexityApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a3f4bee9-0ff4-4587-b3f7-3ac3db25fefd",
      "name": "Download Knowledge Document",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1520,
        736
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "list",
          "value": "13YClv41pt53diWxfd69pMo4lMlFL6-BlF2UHrGLv3SA",
          "cachedResultUrl": "https://docs.google.com/document/d/13YClv41pt53diWxfd69pMo4lMlFL6-BlF2UHrGLv3SA/edit?usp=drivesdk",
          "cachedResultName": "RC - Knowledge Docs"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "ef12e3bb-2179-454b-9a1b-19321d190a6e",
      "name": "Parse Document via LlamaIndex",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1344,
        960
      ],
      "parameters": {
        "url": "https://api.cloud.llamaindex.ai/api/v1/parsing/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "cc16d612-fb94-45b1-95c4-3cc819cc92f8",
      "name": "Monitor Document Processing",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1568,
        960
      ],
      "parameters": {
        "url": "=https://api.cloud.llamaindex.ai/api/v1/parsing/job/{{ $json.id }}",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "298ea1b3-98f6-4313-93c0-cc7a2ba570fe",
      "name": "Check Parsing Completion",
      "type": "n8n-nodes-base.if",
      "position": [
        1776,
        960
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "921ff875-817d-47fd-bd47-530ebdc21902",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "SUCCESS"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8b006db9-519f-4ae0-af21-14ec4bca65d8",
      "name": "Wait Before Status Recheck",
      "type": "n8n-nodes-base.wait",
      "position": [
        2000,
        976
      ],
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    },
    {
      "id": "8b4ab5ef-4d45-4ce0-88b5-d98d6af77366",
      "name": "Retrieve Parsed Content",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2016,
        784
      ],
      "parameters": {
        "url": "=https://api.cloud.llamaindex.ai/api/v1/parsing/job/{{ $json.id }}/result/markdown",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a9de398c-76fd-4b8d-af8b-6ca68c626c5a",
      "name": "Store Knowledge Embeddings",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        2240,
        784
      ],
      "parameters": {
        "mode": "insert",
        "options": {
          "pineconeNamespace": "RechargeKnowledge"
        },
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-recharge",
          "cachedResultName": "n8n-recharge"
        }
      },
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "0c0db18f-7204-4f0e-bd0c-9bd4376c1f80",
      "name": "Query Knowledge Base",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        656,
        2016
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 10,
        "options": {
          "pineconeNamespace": "recharge knowledge"
        },
        "useReranker": true,
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-recharge",
          "cachedResultName": "n8n-recharge"
        },
        "toolDescription": "you can get information about recharge from this vector store",
        "includeDocumentMetadata": false
      },
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "f87ee941-52ef-44e9-bb24-fac525921041",
      "name": "Reply Conversation Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        368,
        2112
      ],
      "parameters": {
        "tableName": "[Yourcompany]chathistories",
        "sessionKey": "={{ $('Extract WhatsApp Session Data').item.json.session }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "3d5289af-d373-4ce6-8727-d1ec5f1d5867",
      "name": "Outbound Conversation Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        1104,
        1552
      ],
      "parameters": {
        "tableName": "[Yourcompany]ChatHistories",
        "sessionKey": "={{ $('Prepare Outbound Session Data').item.json.session }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "8760cfdd-6c98-4ab3-80e8-e27b7e0afe11",
      "name": "Knowledge Embeddings Model",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        2224,
        1024
      ],
      "parameters": {
        "model": "text-embedding-3-large",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6f6cab58-9ba5-4fb0-a24c-644f15f854c6",
      "name": "Query Embeddings Model",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        752,
        2112
      ],
      "parameters": {
        "model": "text-embedding-3-large",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f284d3e6-b0bf-47fb-a535-5119e69f9e4d",
      "name": "Search Result Reranker",
      "type": "@n8n/n8n-nodes-langchain.rerankerCohere",
      "position": [
        928,
        2112
      ],
      "parameters": {
        "modelName": "rerank-multilingual-v3.0"
      },
      "credentials": {
        "cohereApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1f62db90-540c-4832-8953-ca7a19fde69c",
      "name": "Document Content Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        2368,
        896
      ],
      "parameters": {
        "options": {},
        "textSplittingMode": "custom"
      },
      "typeVersion": 1.1
    },
    {
      "id": "05e0775e-8fcf-489b-b3f1-3315bc9b3fac",
      "name": "Text Chunk Processor",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        2416,
        1024
      ],
      "parameters": {
        "options": {},
        "chunkOverlap": 200
      },
      "typeVersion": 1
    },
    {
      "id": "c248ae60-25a7-47bb-a540-097b8e6218a5",
      "name": "Split Records for Processing",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        560,
        1072
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "=Place Id, Title, Category, City, State, Address, Company name, Website, Email, Phone Number, Instagram, Facebook, Linkedin, Review Count, Average Stars, enriched"
      },
      "typeVersion": 1
    },
    {
      "id": "fc79b84c-0f7f-4a31-97ad-79bf05213428",
      "name": "Parse Enrichment Response",
      "type": "n8n-nodes-base.code",
      "position": [
        880,
        1072
      ],
      "parameters": {
        "jsCode": "/**\n * n8n Code node (JavaScript)\n * Input : items dari HTTP Request (Perplexity chat/completions)\n * Output: HANYA kolom spreadsheet (tanpa meta _sources/_confidence/_notes/_raw_enriched_json)\n */\n\nfunction pickBody(payload) {\n  // HTTP node kadang return \"Full Response\" (punya key 'body')\n  if (payload && typeof payload === 'object' && payload.body !== undefined) {\n    return payload.body;\n  }\n  return payload;\n}\n\nfunction firstOrSelf(v) {\n  return Array.isArray(v) ? (v[0] ?? null) : v;\n}\n\nfunction extractContent(perp) {\n  const c =\n    perp?.choices?.[0]?.message?.content ??\n    perp?.data?.choices?.[0]?.message?.content ??\n    null;\n\n  if (typeof c !== 'string') {\n    throw new Error('Perplexity response tidak berisi choices[0].message.content (string).');\n  }\n\n  // bersihin kemungkinan code fences ```json ... ```\n  const cleaned = c.trim()\n    .replace(/^```(?:json)?\\s*/i, '')\n    .replace(/```$/i, '')\n    .trim();\n\n  let obj;\n  try {\n    obj = JSON.parse(cleaned);\n  } catch (e) {\n    throw new Error('Gagal parse JSON dari Perplexity content: ' + e.message + ' | content=' + cleaned.slice(0, 300));\n  }\n  return obj;\n}\n\nfunction toSheetRow(enriched) {\n  // Balikin HANYA kolom yang ada di sheet\n  return {\n    \"row_number\": enriched?.row_number ?? null,\n    \"Place Id\": enriched?.place_id ?? null,\n    \"Title\": enriched?.title ?? null,\n    \"Category\": enriched?.category ?? null,\n    \"City\": enriched?.city ?? null,\n    \"State\": enriched?.state ?? null,\n    \"Address\": enriched?.address ?? null,\n    \"Company name\": (enriched?.company_name ?? null) || null,\n    \"Website\": enriched?.website ?? null,\n    \"Email\": enriched?.email ?? null,\n    \"Phone Number\": enriched?.phone_number ?? null,\n    \"Instagram\": enriched?.instagram ?? null,\n    \"Facebook\": enriched?.facebook ?? null,\n    \"Linkedin\": enriched?.linkedin ?? null,\n    \"Review Count\": enriched?.review_count ?? null,\n    \"Average Stars\": enriched?.average_stars ?? null,\n    \"enriched\": enriched?.enriched ?? \"yes\"\n  };\n}\n\nconst results = [];\n\nfor (const item of items) {\n  try {\n    // 1) Ambil payload utama\n    let payload = pickBody(item.json);\n\n    // 2) Kalau string, coba parse JSON dulu\n    if (typeof payload === 'string') {\n      try { payload = JSON.parse(payload); } catch (_) { /* biarin */ }\n    }\n\n    // 3) Ambil objek pertama kalau payload array\n    payload = firstOrSelf(payload);\n\n    if (!payload || typeof payload !== 'object') {\n      throw new Error('Payload kosong atau bukan object.');\n    }\n\n    // 4) Ekstrak JSON dari message.content\n    const enriched = extractContent(payload);\n\n    // 5) Map ke kolom sheet (tanpa meta)\n    const row = toSheetRow(enriched);\n\n    results.push({ json: row });\n  } catch (err) {\n    results.push({\n      json: {\n        _error: true,\n        _message: String(err?.message || err)\n      }\n    });\n  }\n}\n\nreturn results;"
      },
      "typeVersion": 2
    },
    {
      "id": "49b3c664-ac01-45c9-a045-362d0bd171e8",
      "name": "Save Enriched Business Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1056,
        1072
      ],
      "parameters": {
        "columns": {
          "value": {
            "City": "={{ $json.City || \"not found\" }}",
            "Email": "={{ $json.Email || \"not found\" }}",
            "State": "={{ $json.State || \"not found\" }}",
            "Title": "={{ $json.Title }}",
            "Address": "={{ $json.Address }}",
            "Website": "={{ $json.domain || \"not found\"  }}",
            "Category": "={{ $json.Category }}",
            "Facebook": "={{ $json.Facebook || \"not found\" }}",
            "Linkedin": "={{ $json.Linkedin || \"not found\" }}",
            "Place Id": "={{ $json[\"Place Id\"] }}",
            "enriched": "={{ $json.enriched }}",
            "Instagram": "={{ $json.Instagram || \"not found\" }}",
            "Company name": "={{ $json[\"Company name\"] || \"not found\" }}",
            "Phone Number": "={{ $json['Phone Number'] ||  \"not found\" }}"
          },
          "schema": [
            {
              "id": "Place Id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Place Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Category",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "City",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "City",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "State",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "State",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Company name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Number",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Phone Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Instagram",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Instagram",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Facebook",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Facebook",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Linkedin",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Linkedin",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Review Count",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Review Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Average Stars",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Average Stars",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "enriched",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "enriched",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Place Id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws/edit#gid=0",
          "cachedResultName": "Raw Data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws/edit?usp=drivesdk",
          "cachedResultName": "Recharge Database"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "46debf17-0bee-4cb4-adef-8c5071e0e49b",
      "name": "Show Typing Indicator - Reply",
      "type": "@aldinokemal2104/n8n-nodes-gowa.gowa",
      "position": [
        1856,
        1920
      ],
      "parameters": {
        "operation": "sendChatPresence",
        "phoneNumber": "={{ $('Format Reply Message Data').item.json.number }}"
      },
      "credentials": {
        "goWhatsappApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "d2135259-dba9-40ca-8892-e6189a8f9a2c",
      "name": "Show Typing Indicator - Outbound",
      "type": "@aldinokemal2104/n8n-nodes-gowa.gowa",
      "position": [
        1856,
        1344
      ],
      "parameters": {
        "operation": "sendChatPresence",
        "phoneNumber": "={{ $('Format Outbound Message Data').item.json.number }}"
      },
      "credentials": {
        "goWhatsappApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "949fbd50-3994-4aa1-b720-f99c7947716d",
      "name": "Wait Before Read Receipt - Reply",
      "type": "n8n-nodes-base.wait",
      "position": [
        1584,
        1920
      ],
      "parameters": {
        "amount": "={{ Math.random()*5 + 1 }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "974de0f2-7b95-4d6a-a0cf-c103b7fb9941",
      "name": "Wait Before Read Receipt - Outbound",
      "type": "n8n-nodes-base.wait",
      "position": [
        1584,
        1344
      ],
      "parameters": {
        "amount": "={{ Math.random()*5 + 1 }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "332c0ddf-04c4-4133-9511-a2487616e1cc",
      "name": "Simulate Typing Delay - Outbound",
      "type": "n8n-nodes-base.wait",
      "position": [
        1584,
        1552
      ],
      "parameters": {
        "amount": "={{ Math.random()*5+3 }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "295c78f4-0146-421b-b0ae-46045e0328cf",
      "name": "Simulate Typing Delay - Reply",
      "type": "n8n-nodes-base.wait",
      "position": [
        1584,
        2112
      ],
      "parameters": {
        "amount": "={{ Math.random()*5+3 }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "46330ff4-38ef-44b9-8630-113b0a6e82c8",
      "name": "Mark Message as Read - Reply",
      "type": "@aldinokemal2104/n8n-nodes-gowa.gowa",
      "position": [
        2160,
        1920
      ],
      "parameters": {
        "resource": "message",
        "messageId": "={{ $json.results.message_id }}",
        "operation": "readMessage",
        "phoneOrGroupId": "={{ $('Format Reply Message Data').item.json.number }}"
      },
      "credentials": {
        "goWhatsappApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f5a32fff-8e38-465e-853b-204d53001b0f",
      "name": "Mark Message as Read - Outbound",
      "type": "@aldinokemal2104/n8n-nodes-gowa.gowa",
      "position": [
        2144,
        1344
      ],
      "parameters": {
        "resource": "message",
        "messageId": "={{ $json.results.message_id }}",
        "operation": "readMessage",
        "phoneOrGroupId": "={{ $('Format Outbound Message Data').item.json.number }}"
      },
      "credentials": {
        "goWhatsappApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "10c5fcd5-f69c-4d3b-bd9e-3cc7d103596d",
      "name": "Stop Typing Indicator - Reply",
      "type": "@aldinokemal2104/n8n-nodes-gowa.gowa",
      "position": [
        1856,
        2112
      ],
      "parameters": {
        "operation": "sendChatPresence",
        "phoneNumber": "={{ $('Format Reply Message Data').item.json.number }}",
        "chatPresenceAction": "stop"
      },
      "credentials": {
        "goWhatsappApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "38280d58-1a6c-4f71-8444-d527b47e984f",
      "name": "Stop Typing Indicator - Outbound",
      "type": "@aldinokemal2104/n8n-nodes-gowa.gowa",
      "position": [
        1856,
        1552
      ],
      "parameters": {
        "operation": "sendChatPresence",
        "phoneNumber": "={{ $('Format Outbound Message Data').item.json.number }}",
        "chatPresenceAction": "stop"
      },
      "credentials": {
        "goWhatsappApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f77d68c8-4924-4a9a-9019-7888f616683d",
      "name": "Send WhatsApp Reply",
      "type": "@aldinokemal2104/n8n-nodes-gowa.gowa",
      "position": [
        2160,
        2112
      ],
      "parameters": {
        "message": "={{ $('Format Reply Message Data').item.json.message }}",
        "phoneNumber": "={{ $('Format Reply Message Data').item.json.number }}"
      },
      "credentials": {
        "goWhatsappApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0cb74981-770a-4cf7-bac5-add0f5564c75",
      "name": "Send Outbound WhatsApp Message",
      "type": "@aldinokemal2104/n8n-nodes-gowa.gowa",
      "position": [
        2144,
        1552
      ],
      "parameters": {
        "message": "={{ $('Format Outbound Message Data').item.json.message }}",
        "phoneNumber": "={{ $('Format Outbound Message Data').item.json.number }}"
      },
      "credentials": {
        "goWhatsappApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c003b1f5-ab16-459c-9d43-2b943d0ab121",
      "name": "Save Lead Contact Information",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        544,
        2112
      ],
      "parameters": {
        "columns": {
          "value": {
            "name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('name', ``, 'string') }}",
            "Place": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Place', ``, 'string') }}",
            "title": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('title', ``, 'string') }}",
            "phone number": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('phone_number', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "Place",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Place",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "data source",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "data source",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "phone number",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "phone number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "linkedin",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1542739970,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws/edit#gid=1542739970",
          "cachedResultName": "Leads Collected"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws/edit?usp=drivesdk",
          "cachedResultName": "Recharge Database"
        },
        "descriptionType": "manual",
        "toolDescription": "=IMPORTANT: Use this tool ONLY to store PIC contact given by partner or save proposal inquiry. \n\nField to save: \n- Place (location or brand)\n- Name (PIC Name)\n- Title (PIC Title)\n- Phone Number (PIC Phone Number or whatsapp)\n\nMakesure all fields are available. Don't put \"unknown\", \"empty\", or similar things, if not full fields available, ask for the informations"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "064b6908-e5ac-46f3-a94d-45dee80abfe0",
      "name": "Mark as Contacted",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2448,
        1456
      ],
      "parameters": {
        "columns": {
          "value": {
            "Outreach": "yes",
            "Place Id": "={{ $('Limit Outbound Batch Size').item.json['Place Id'] }}"
          },
          "schema": [
            {
              "id": "Place Id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Place Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Category",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "City",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "City",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "State",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "State",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Company name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Number",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Phone Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Instagram",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Instagram",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Facebook",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Facebook",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Linkedin",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Linkedin",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Review Count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Review Count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Average Stars",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Average Stars",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "enriched",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "enriched",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Outreach",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Outreach",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Respond",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Respond",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Place Id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws/edit#gid=0",
          "cachedResultName": "Raw Data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OFD8EwqoJutRMwXaSxmvwIDVrgbQxmpU0mRd_jgd5Ws/edit?usp=drivesdk",
          "cachedResultName": "Recharge Database"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "7e7d14f8-f8fe-40d5-ae90-f27e3cf5ea24",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2704,
        608
      ],
      "parameters": {
        "width": 496,
        "height": 768,
        "content": "# Required Credentials\n\n## \ud83d\udd11 API Keys & Services\n\n**Google Services**\n- Google Sheets OAuth2 - [Setup Guide](https://console.cloud.google.com/apis/credentials)\n- Google Drive OAuth2 - [Setup Guide](https://console.cloud.google.com/apis/credentials)\n\n**AI & ML Services**\n- OpenAI API - [Get API Key](https://platform.openai.com/api-keys)\n- Pinecone Vector DB - [Get API Key](https://app.pinecone.io/)\n- Cohere Reranker - [Get API Key](https://dashboard.cohere.ai/api-keys)\n- LlamaIndex Cloud - [Get API Key](https://cloud.llamaindex.ai/)\n- Perplexity API - [Get API Key](https://www.perplexity.ai/settings/api)\n\n**Communication**\n- GOWA - [GO Whatsap](https://github.com/aldinokemal/go-whatsapp-web-multidevice)\n- WAHA - [Whatasapp HTTP API](https://waha.devlike.pro/)\n\n**Data Collection**\n- Apify Scraping Service - [Get API Token](https://console.apify.com/account/integrations)\n\n**Database**\n- PostgreSQL/Neon - [Create Database](https://console.neon.tech/)\n\n## \ud83d\udccb Setup Checklist\n- [ ] All credentials configured in n8n\n- [ ] Google Sheets permissions granted\n- [ ] WhatsApp webhook configured\n- [ ] Pinecone index created: n8n-recharge\n- [ ] PostgreSQL tables: rechargechathistories, RechargeChatHistories"
      },
      "typeVersion": 1
    },
    {
      "id": "3b611e60-ea00-4509-bf98-6ac802244006",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2704,
        1408
      ],
      "parameters": {
        "width": 496,
        "height": 608,
        "content": "# Database Schema & Setup Requirements\n\n## **Google Sheets Structure**\n- **Raw Data Sheet**: Business listings with contact info, social media, ratings\n- **Leads Sheet**: Qualified prospects with PIC details\n\n## **PostgreSQL Tables**\n- **Chat History**: Conversation memory and session management\n- **User Sessions**: WhatsApp number mapping and state tracking\n\n## **Pinecone Configuration**\n- **Vector Index**: Company knowledge base storage\n- **Embeddings**: text-embedding-3-large (3072 dimensions)\n- **Namespaces**: Separate knowledge domains\n\n## **File Storage**\n- **Knowledge Base**: Google Drive document auto-sync\n- **Templates**: Message templates and scripts"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Incoming message": {
      "main": [
        [],
        [
          {
            "node": "Extract WhatsApp Session Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reply Handler LLM": {
      "ai_languageModel": [
        [
          {
            "node": "Reply Handler AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Outbound Message LLM": {
      "ai_languageModel": [
        [
          {
            "node": "Outbound Message Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Query Knowledge Base": {
      "ai_tool": [
        [
          {
            "node": "Reply Handler AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Text Chunk Processor": {
      "ai_textSplitter": [
        [
          {
            "node": "Document Content Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Get Unenriched Records": {
      "main": [
        [
          {
            "node": "Limit Enrichment Batch Size",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query Embeddings Model": {
      "ai_embedding": [
        [
          {
            "node": "Query Knowledge Base",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Reply Handler AI Agent": {
      "main": [
        [
          {
            "node": "Format Reply Message Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Result Reranker": {
      "ai_reranker": [
        [
          {
            "node": "Query Knowledge Base",
            "type": "ai_reranker",
            "index": 0
          }
        ]
      ]
    },
    "Daily Outbound Schedule": {
      "main": [
        [
          {
            "node": "Get Unenriched Records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Document Content Loader": {
      "ai_document": [
        [
          {
            "node": "Store Knowledge Embeddings",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Get Outbound Candidates": {
      "main": [
        [
          {
            "node": "Limit Outbound Batch Size",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Parsed Content": {
      "main": [
        [
          {
            "node": "Store Knowledge Embeddings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Raw Business Leads": {
      "main": [
        []
      ]
    },
    "Business Data Enrichment": {
      "main": [
        [
          {
            "node": "Parse Enrichment Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Parsing Completion": {
      "main": [
        [
          {
            "node": "Retrieve Parsed Content",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Before Status Recheck",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Reply Message Data": {
      "main": [
        [
          {
            "node": "Wait Before Read Receipt - Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit Outbound Batch Size": {
      "main": [
        [
          {
            "node": "Validate Phone Number Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Enrichment Response": {
      "main": [
        [
          {
            "node": "Save Enriched Business Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reply Conversation Memory": {
      "ai_memory": [
        [
          {
            "node": "Reply Handler AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Outbound message": {
      "main": [
        [
          {
            "node": "Get Outbound Candidates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Knowledge Embeddings Model": {
      "ai_embedding": [
        [
          {
            "node": "Store Knowledge Embeddings",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Outbound Message Generator": {
      "main": [
        [
          {
            "node": "Format Outbound Message Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Status Recheck": {
      "main": [
        [
          {
            "node": "Monitor Document Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Knowledge Document": {
      "main": [
        [
          {
            "node": "Parse Document via LlamaIndex",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Google Maps Scraper": {
      "main": [
        [
          {
            "node": "Fetch Scraped Business Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Scraped Business Data": {
      "main": [
        [
          {
            "node": "Save Raw Business Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit Enrichment Batch Size": {
      "main": [
        [
          {
            "node": "Split Records for Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monitor Document Processing": {
      "main": [
        [
          {
            "node": "Check Parsing Completion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Outbound Message Data": {
      "main": [
        [
          {
            "node": "Wait Before Read Receipt - Outbound",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark Message as Read - Reply": {
      "main": [
        [
          {
            "node": "Simulate Typing Delay - Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Outbound Conversation Memory": {
      "ai_memory": [
        [
          {
            "node": "Outbound Message Generator",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Split Records for Processing": {
      "main": [
        [
          {
            "node": "Business Data Enrichment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Phone Number Exists": {
      "main": [
        [
          {
            "node": "Prepare Outbound Session Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure Scraping Parameters": {
      "main": [
        [
          {
            "node": "Execute Google Maps Scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract WhatsApp Session Data": {
      "main": [
        [
          {
            "node": "Reply Handler AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Document via LlamaIndex": {
      "main": [
        [
          {
            "node": "Monitor Document Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Outbound Session Data": {
      "main": [
        [
          {
            "node": "Outbound Message Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Lead Contact Information": {
      "ai_tool": [
        [
          {
            "node": "Reply Handler AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Show Typing Indicator - Reply": {
      "main": [
        [
          {
            "node": "Mark Message as Read - Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simulate Typing Delay - Reply": {
      "main": [
        [
          {
            "node": "Stop Typing Indicator - Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stop Typing Indicator - Reply": {
      "main": [
        [
          {
            "node": "Send WhatsApp Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Knowledge Base Updated Trigger": {
      "main": [
        [
          {
            "node": "Download Knowledge Document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Outbound WhatsApp Message": {
      "main": [
        [
          {
            "node": "Mark as Contacted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger - Start Scraping": {
      "main": [
        [
          {
            "node": "Configure Scraping Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark Message as Read - Outbound": {
      "main": [
        [
          {
            "node": "Simulate Typing Delay - Outbound",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Show Typing Indicator - Outbound": {
      "main": [
        [
          {
            "node": "Mark Message as Read - Outbound",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simulate Typing Delay - Outbound": {
      "main": [
        [
          {
            "node": "Stop Typing Indicator - Outbound",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stop Typing Indicator - Outbound": {
      "main": [
        [
          {
            "node": "Send Outbound WhatsApp Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Read Receipt - Reply": {
      "main": [
        [
          {
            "node": "Show Typing Indicator - Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Read Receipt - Outbound": {
      "main": [
        [
          {
            "node": "Show Typing Indicator - Outbound",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}