{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "2381ff34-99b7-4fc3-9ac9-7b19c56f5c68",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        112,
        -16
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-nodes",
          "cachedResultName": "n8n-nodes"
        }
      },
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1.2
    },
    {
      "id": "18cb99c0-6307-458a-bbbc-3b392c48e874",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        208,
        208
      ],
      "parameters": {
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "file_id",
                "value": "={{ $('Loop Over Items').item.json.id }}"
              },
              {
                "name": "file_name",
                "value": "={{ $('Loop Over Items').item.json.name }}"
              }
            ]
          },
          "splitPages": true
        },
        "dataType": "binary"
      },
      "typeVersion": 1
    },
    {
      "id": "f2610eea-c81c-476b-bab4-1fa8a32ad5dd",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        288,
        416
      ],
      "parameters": {
        "options": {},
        "chunkOverlap": 10
      },
      "typeVersion": 1
    },
    {
      "id": "144acbc6-3972-4024-9851-622728a7fcbb",
      "name": "Search files and folders",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1936,
        464
      ],
      "parameters": {
        "filter": {
          "folderId": {
            "__rl": true,
            "mode": "list",
            "value": "1j2IxC5O8FjwMjbyN3DKGKR_c48qXC_1F",
            "cachedResultUrl": "https://drive.google.com/drive/folders/1j2IxC5O8FjwMjbyN3DKGKR_c48qXC_1F",
            "cachedResultName": "research"
          }
        },
        "options": {
          "fields": [
            "mimeType",
            "id",
            "name"
          ]
        },
        "resource": "fileFolder",
        "returnAll": true
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "93313128-a34c-44f2-9395-bdfff88d24b9",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1264,
        320
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3,
      "alwaysOutputData": false
    },
    {
      "id": "b9a51cff-4cc7-4830-ab6e-39746bd988c6",
      "name": "createHash",
      "type": "n8n-nodes-base.crypto",
      "position": [
        -1040,
        320
      ],
      "parameters": {
        "type": "SHA256",
        "binaryData": true,
        "dataPropertyName": "hash"
      },
      "typeVersion": 1
    },
    {
      "id": "b0ea5b4b-818a-418d-a1ac-1022834917e5",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -592,
        384
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "New Document",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "ff4d1294-192a-4f71-9983-53f0036c7d1c",
                    "operator": {
                      "type": "object",
                      "operation": "empty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $('searchRecordManger').item.json }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Already processed",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "314d1d08-928b-42e3-839d-7948004d4229",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('searchRecordManger').item.json.hashId }}",
                    "rightValue": "={{ $('createHash').item.json.hash }}"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Updated Document",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "68f55445-fe7e-4fa6-94af-081f2cae339e",
                    "operator": {
                      "type": "string",
                      "operation": "notEquals"
                    },
                    "leftValue": "={{ $('searchRecordManger').item.json.hashId }}",
                    "rightValue": "={{ $('createHash').item.json.hash }}"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "33b7547b-ccb3-4874-89a1-42e5735136b3",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1712,
        464
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "2e8239b9-5f5a-496b-b95d-7ca06608e566",
      "name": "Add to Record Manger",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -368,
        192
      ],
      "parameters": {
        "columns": {
          "value": {
            "Id": "={{ $('createHash').item.json.id }}",
            "name": "={{ $('createHash').item.json.name }}",
            "hashId": "={{ $('createHash').item.json.hash }}"
          },
          "schema": [
            {
              "id": "Id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "hashId",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "hashId",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 543225934,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BdZxm9Z2ZjzyNlSDz4Bss6-3XtdooUM-Gf5CGaVAXQo/edit#gid=543225934",
          "cachedResultName": "Documents"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1BdZxm9Z2ZjzyNlSDz4Bss6-3XtdooUM-Gf5CGaVAXQo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BdZxm9Z2ZjzyNlSDz4Bss6-3XtdooUM-Gf5CGaVAXQo/edit?usp=drivesdk",
          "cachedResultName": "Regula Outbound Sales - Emerging Market FinTech Leads"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "eb8f9057-d719-4846-a5fe-94ae7daf3989",
      "name": "Pinecone Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        160,
        592
      ],
      "parameters": {
        "mode": "insert",
        "options": {
          "clearNamespace": true
        },
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-nodes",
          "cachedResultName": "n8n-nodes"
        }
      },
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1.2
    },
    {
      "id": "f6414f19-fdc4-4cb9-8297-1cbca3faf0d2",
      "name": "Update the RecordManger",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -368,
        592
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "Id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "hashId",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "hashId",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 543225934,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BdZxm9Z2ZjzyNlSDz4Bss6-3XtdooUM-Gf5CGaVAXQo/edit#gid=543225934",
          "cachedResultName": "Documents"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1BdZxm9Z2ZjzyNlSDz4Bss6-3XtdooUM-Gf5CGaVAXQo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BdZxm9Z2ZjzyNlSDz4Bss6-3XtdooUM-Gf5CGaVAXQo/edit?usp=drivesdk",
          "cachedResultName": "Regula Outbound Sales - Emerging Market FinTech Leads"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "c1e85427-148c-42de-a849-2a2e29c96d36",
      "name": "Download file1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -144,
        192
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Loop Over Items').item.json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "1c9ac630-f8d7-4229-bfdc-86f4319459ce",
      "name": "Download file2",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -144,
        592
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Loop Over Items').item.json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "07107bf2-65df-481d-a24e-3d4a5e439795",
      "name": "nonDownloadableFile",
      "type": "n8n-nodes-base.if",
      "position": [
        -1488,
        320
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "49a912d3-7bc7-434a-93d0-52e66c9e1024",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.mimeType }}",
              "rightValue": "application/vnd.google-apps.folder"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ccc2950e-d808-44e6-9fc1-825862ebe682",
      "name": "Embeddings Google Gemini",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        80,
        208
      ],
      "parameters": {
        "modelName": "models/gemini-embedding-001"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a9c05cd2-85a1-40a2-b28e-aabb3da81ff3",
      "name": "searchRecordManger",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -816,
        320
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json.id }}",
              "lookupColumn": "Id"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 543225934,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BdZxm9Z2ZjzyNlSDz4Bss6-3XtdooUM-Gf5CGaVAXQo/edit#gid=543225934",
          "cachedResultName": "Documents"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1BdZxm9Z2ZjzyNlSDz4Bss6-3XtdooUM-Gf5CGaVAXQo",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BdZxm9Z2ZjzyNlSDz4Bss6-3XtdooUM-Gf5CGaVAXQo/edit?usp=drivesdk",
          "cachedResultName": "Regula Outbound Sales - Emerging Market FinTech Leads"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7,
      "alwaysOutputData": true
    },
    {
      "id": "b246ecb3-d8e9-4be8-a59c-a83f396e5475",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -2160,
        464
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e20ab29e-5c36-43e9-b302-fdc0a803661f",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2160,
        1488
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "d7372437-4dc0-4e4f-97d3-e75f8caa4039",
      "name": "Parser ",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1520,
        1712
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"industries\": [\n    \"FinTech\",\n    \"Regulated SaaS companies\",\n    \"HealthTech\",\n    \"Energy\",\n    \"Logistics & Supply Chain\",\n    \"Telco\",\n    \"Wallets\",\n    \"Financial Services\",\n    \"Banking\",\n    \"Insurance\"\n  ],\n  \"keywords\": [\n    \"regulatory compliance\",\n    \"compliance monitoring\",\n    \"regulatory intelligence\",\n    \"compliance automation\",\n    \"regulatory updates\",\n    \"AML\",\n    \"KYC\",\n    \"licensing\",\n    \"regulatory risk management\",\n    \"audit trail\"\n  ],\n  \"companySize\": {\n    \"minEmployees\": 10,\n    \"maxEmployees\": 500\n  },\n  \"searchQueries\": [\n    \"FinTech regulatory compliance software\",\n    \"AML KYC compliance platform\",\n    \"regulatory intelligence SaaS\",\n    \"automated compliance monitoring tools\",\n    \"financial services compliance automation\",\n    \"banking regulatory risk management solution\",\n    \"insurance compliance software\",\n    \"healthtech regulatory compliance platform\",\n    \"energy sector compliance monitoring\",\n    \"licensed wallet compliance solution\"\n  ]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "3161f63e-725b-487a-b0f9-84540153888b",
      "name": "Lead Criteria Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1792,
        1488
      ],
      "parameters": {
        "text": "=Based on the Regula knowledge base, analyze the product and generate search criteria for finding potential leads. Focus on companies that would benefit from regulatory compliance solutions. Return the search criteria as JSON.",
        "options": {
          "systemMessage": "=You are a sales strategy AI that analyzes product information to identify ideal customer profiles and search criteria.\n\nBased on the knowledge base about Regula, generate search criteria including:\n1. Target industries (e.g., fintech, healthcare, financial services)\n2. Company characteristics (size, stage, location)\n3. Search keywords related to compliance, regulatory needs\n4. Ideal customer profile attributes\n\nIMPORTANT: For searchQueries, create queries that will find COMPANY WEBSITES, not blog posts or articles. Each query should:\n- Include industry + compliance/regulatory keywords\n- Use terms like 'company', 'platform', 'software', 'solution', 'provider'\n- Target companies that offer or need compliance solutions\n- Example: 'fintech compliance software companies' NOT 'fintech compliance guide'\n- Example: 'AML KYC platform providers' NOT 'what is AML KYC'\n\nReturn your analysis as a JSON object with:\n- industries: array of target industries\n- keywords: array of search keywords\n- companySize: object with min/max employees\n- locations: array of target locations (optional)\n- searchQueries: array of 5-10 specific search query strings that target company websites"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "3294078b-b5ed-4084-a915-bf50b0a4f012",
      "name": "Gemini",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1936,
        1712
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f62fed90-dd5f-434b-971a-41124545594c",
      "name": "KB - Lead Criteria",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        -1808,
        1712
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {},
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-nodes",
          "cachedResultName": "n8n-nodes"
        },
        "toolDescription": "Use this knowledge base to answer questions about Regula product, features, and ideal customers"
      },
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "cda47b1d-af8d-48a6-aeb1-f4f6e3d72ed7",
      "name": "Embeddings",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        -1728,
        1920
      ],
      "parameters": {
        "modelName": "models/gemini-embedding-001"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3c9aa4a5-395c-42b7-a64d-41d8fbf5f7ac",
      "name": "Extract Queries",
      "type": "n8n-nodes-base.code",
      "position": [
        -1312,
        1488
      ],
      "parameters": {
        "jsCode": "const queries = $input.first().json.output.searchQueries.map((s) => ({\n  query: s,\n}));\n\nreturn queries;"
      },
      "typeVersion": 2
    },
    {
      "id": "b4260baf-c847-4dbd-a96d-668fe34a8b95",
      "name": "Web Search - Serper",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -864,
        1408
      ],
      "parameters": {
        "url": "https://google.serper.dev/search",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"q\": \"{{ $json.query }} -site:medium.com -site:wordpress.com -site:blogspot.com -site:reddit.com -site:quora.com -site:linkedin.com/posts -\\\"article\\\" -\\\"blog\\\" -\\\"top 10\\\" -\\\"list\\\" -\\\"guide\\\"\",\n  \"num\": 20,\n  \"gl\": \"us\",\n  \"hl\": \"en\",\n  \"type\": \"search\"\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "0a68387e-151f-40a8-923c-c7a2d3b44f77",
      "name": "Parse Companies",
      "type": "n8n-nodes-base.code",
      "position": [
        -640,
        1408
      ],
      "parameters": {
        "jsCode": "const searchResults = $input.first().json.organic || [];\nconst excludePatterns = [\n  /\\/blog\\//i,\n  /\\/article\\//i,\n  /\\/post\\//i,\n  /\\/news\\//i,\n  /\\/articles\\//i,\n  /\\/posts\\//i,\n  /\\/magazine\\//i,\n  /medium\\.com/i,\n  /wordpress\\.com/i,\n  /blogspot\\.com/i,\n  /tumblr\\.com/i,\n  /reddit\\.com/i,\n  /quora\\.com/i,\n  /stackoverflow\\.com/i,\n  /github\\.com/i,\n  /wikipedia\\.org/i,\n  /\\/forum\\//i,\n  /\\/discussion\\//i,\n  /\\/guide\\//i,\n  /\\/how-to\\//i,\n  /\\/tutorial\\//i,\n  /\\.pdf$/i,\n  /linkedin\\.com\\/posts/i,\n  /twitter\\.com/i,\n  /facebook\\.com/i,\n  /fintechmagazine\\.com/i,\n  /eternitech\\.com/i,\n  /v-comply\\.com\\/blog/i\n];\nconst articleIndicators = [\n  /^top\\s+\\d+/i,\n  /\\stop\\s+\\d+/i,\n  /^\\d+\\s+(best|top)/i,\n  /list\\s+of/i,\n  /^the\\s+\\d+/i,\n  /\\s+in\\s+\\d{4}$/i,\n  /\\s+companies\\s+in\\s+the/i,\n  /\\s+software\\s+for\\s+/i,\n  /\\s+solutions\\s+for\\s+/i,\n  /\\s+help\\s+firms/i,\n  /\\s+software\\s+helps/i,\n  /\\s+software\\s+is\\s+key/i\n];\nconst companyIndicators = [\n  /^https?:\\/\\/[^\\/]+\\/?$/i,\n  /\\/about/i,\n  /\\/company/i,\n  /\\/contact/i,\n  /\\/products/i,\n  /\\/solutions/i,\n  /\\/services/i,\n  /\\/platform/i,\n  /\\/software/i,\n  /\\/industries/i,\n  /\\/en-us/i,\n  /\\/en\\//i\n];\n\nconst companies = searchResults\n  .map(result => {\n    const url = result.link || '';\n    const title = result.title || '';\n    const snippet = result.snippet || '';\n    \n    if (excludePatterns.some(pattern => pattern.test(url))) {\n      return null;\n    }\n    \n    if (articleIndicators.some(pattern => pattern.test(title) || pattern.test(snippet))) {\n      return null;\n    }\n    \n    if (/this software|this platform|helps firms|software is key|software helps|firms can|companies can/i.test(snippet)) {\n      return null;\n    }\n\n    let companyName = \"\";\n    let splitter = url.split(\"/\")[2].split(\".\");\n\n    if (splitter.includes(\"www\")) {\n      companyName = splitter[1];\n    } else {\n      companyName = splitter[0];\n    }\n    \n    let score = 0;\n    \n    if (/^https?:\\/\\/[^\\/]+\\/?$/i.test(url)) {\n      score += 10;\n    }\n    \n    companyIndicators.forEach(pattern => {\n      if (pattern.test(url)) score += 2;\n    });\n    \n    if (!articleIndicators.some(p => p.test(title)) && title.length < 60) {\n      score += 3;\n    }\n    \n    if (/platform|software|solution|service|product/i.test(snippet) && \n        !/this software|this platform|helps firms/i.test(snippet)) {\n      score += 2;\n    }\n    \n    return {\n      name: companyName || url,\n      website: url,\n      snippet: snippet,\n      position: result.position,\n      score: score\n    };\n  })\n  .filter(company => company !== null && company.website && company.website.match(/^https?:\\/\\//))\n  .sort((a, b) => {\n    if (b.score !== a.score) return b.score - a.score;\n    return a.position - b.position;\n  })\n  .slice(0, 30);\n\nconst uniqueCompanies = [];\nconst seenDomains = new Set();\n\nfor (const company of companies) {\n  const domain = company.website.replace(/^https?:\\/\\//, '').replace(/^www\\./, '').replace(/\\/.*$/, '');\n  if (!seenDomains.has(domain)) {\n    seenDomains.add(domain);\n    uniqueCompanies.push({\n      ...company,\n      domain: domain\n    });\n  }\n}\n\nreturn uniqueCompanies.slice(0, 20);"
      },
      "typeVersion": 2
    },
    {
      "id": "3fccd4c8-0788-4b60-a47e-976ff8ce6867",
      "name": "Get Existing Leads",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -416,
        1408
      ],
      "parameters": {
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "leads",
          "cachedResultName": "leads"
        },
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "options": {},
        "operation": "select",
        "returnAll": true
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 2.6,
      "alwaysOutputData": true
    },
    {
      "id": "ce10a251-d90b-47e4-a883-79add252e5cb",
      "name": "If Leads",
      "type": "n8n-nodes-base.if",
      "position": [
        -192,
        1408
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "d73945aa-d09a-4d17-af51-7849b09ab540",
              "operator": {
                "type": "number",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.id }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "5b2f2d40-d4c6-4c16-9ce5-30679e5391f8",
      "name": "Loop Over Queries",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1088,
        1488
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "b1879a9f-c13c-450f-b8cc-475fa11f2d38",
      "name": "Get Parsed Companies",
      "type": "n8n-nodes-base.code",
      "position": [
        256,
        1504
      ],
      "parameters": {
        "jsCode": "const companies = $(\"Parse Companies\").all();\nreturn companies;"
      },
      "typeVersion": 2
    },
    {
      "id": "ac8a4c7e-8ffa-403a-83df-c09eacc04182",
      "name": "Insert Companies",
      "type": "n8n-nodes-base.postgres",
      "onError": "continueErrorOutput",
      "position": [
        480,
        1504
      ],
      "parameters": {
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "search",
          "cachedResultName": "search"
        },
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "columns": {
          "value": {
            "name": "={{ $json.name }}",
            "score": "={{ $json.score }}",
            "domain": "={{ $json.domain }}",
            "snippet": "={{ $json.snippet }}",
            "website": "={{ $json.website }}",
            "position": "={{ $json.position }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "number",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "snippet",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "snippet",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "position",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "position",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "score",
              "type": "number",
              "display": true,
              "required": false,
              "displayName": "score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "domain",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "domain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.6
    },
    {
      "id": "524d4872-b052-4017-b60c-52ab5fd6d867",
      "name": "Extract Lead Names",
      "type": "n8n-nodes-base.code",
      "position": [
        32,
        1312
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst companyNamesSet = new Set();\n\nfor (const item of items) {\n  const companyName = item.json[\"Company Name\"];\n  if (companyName) {\n    companyNamesSet.add(companyName);\n  }\n}\n\nconst companyNamesArray = Array.from(companyNamesSet);\nreturn {\n  companies: companyNamesArray,\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "af6cbc73-d281-45df-a40f-6bd579408531",
      "name": "Filter Existing Leads",
      "type": "n8n-nodes-base.code",
      "position": [
        256,
        1312
      ],
      "parameters": {
        "jsCode": "const array1 = $(\"Parse Companies\").all(0).map(item => item.json);\nconst array2 = $input.all(1)[0].json.companies;\n\nconst blacklist = new Set(\n  array2.map(name => name.toLowerCase().trim())\n);\n\nconst filtered = array1.filter(item =>\n  !blacklist.has(item.name.toLowerCase().trim())\n);\n\nreturn filtered.map(item => ({ json: item }));"
      },
      "typeVersion": 2
    },
    {
      "id": "7e44a9b9-311c-4b90-a548-4aedb4c01df1",
      "name": "Parse Decision Makers",
      "type": "n8n-nodes-base.code",
      "position": [
        -48,
        2688
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst structureCompanyInfo = $('Loop Over Companies').all()[0] || {};\n\nreturn items.map((i) => ({\n  email: i.json.value,\n  title: i.json.position,\n  linkedin: i.json.linkedin,\n  companyDomain: structureCompanyInfo.json.domain,\n  name: `${i.json.first_name} ${i.json.last_name}`,\n  companyName: structureCompanyInfo.json.companyName,\n})).filter((i) => i.name !== \"null null\");"
      },
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "d88130b1-cb89-4192-b0c9-92f8b3f7a88e",
      "name": "Hunter",
      "type": "n8n-nodes-base.hunter",
      "position": [
        -272,
        2688
      ],
      "parameters": {
        "limit": 10,
        "domain": "={{ $('Loop Over Companies').item.json.domain }}",
        "filters": {}
      },
      "credentials": {
        "hunterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9bb656e9-7a3b-4722-b207-f01a3d522bb0",
      "name": "Company Research Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1136,
        2432
      ],
      "parameters": {
        "text": "=Research this company in detail:\nCompany: {{ $('Loop Over Companies').item.json.name }}\nWebsite: {{ $('Loop Over Companies').item.json.website }}\n\nFind information about their compliance needs, regulatory challenges, and how Regula could help them. Use web search to find recent news and information.",
        "options": {
          "systemMessage": "=You are a research analyst specializing in company analysis for sales outreach.\n\nResearch the company and provide:\n1. Recent challenges and pain points\n2. Compliance and regulatory needs\n3. Industry-specific requirements\n4. Potential use cases for Regula\n5. Recent news or announcements\n6. Competitor analysis\n\nReturn a comprehensive research summary as JSON with fields: challenges, complianceNeeds, useCases, recentNews, competitors."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "a7da4b8d-550a-499a-993a-50b2254b0d55",
      "name": "Wait Before Email Finder",
      "type": "n8n-nodes-base.wait",
      "position": [
        -496,
        2688
      ],
      "parameters": {
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "6283cea4-56de-4032-ae4d-2b40efcb2dea",
      "name": "Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -832,
        2656
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"challenges\": [\n    \"Adapting compliance frameworks to rapidly evolving areas like digital asset-related financial crime.\",\n    \"Navigating a continuously reshaping regulatory landscape, as highlighted by Themis's own 'Regulatory Watch' insights on FDIC testimony.\",\n    \"The need to reduce regulatory risk and operational burden, specifically cutting down on manual work for banks and fintechs.\",\n    \"Effectively detecting and preventing sophisticated financial crimes and fraud, as evidenced by their focus on AI Investigator and 2025 Fraud Trends.\",\n    \"Strengthening compliance and due diligence processes for accelerating partnerships with vendors, banks, and fintechs.\",\n    \"Addressing industry-specific compliance needs, such as marketing compliance through partnerships.\"\n  ],\n  \"complianceNeeds\": [\n    \"Robust Governance, Risk, and Compliance (GRC) software to manage and accelerate partnerships.\",\n    \"Solutions for digital asset-related financial crime compliance.\",\n    \"Advanced tools for financial crime prevention, including anti-money laundering (AML) and fraud detection.\",\n    \"Comprehensive due diligence capabilities for vendor and partner onboarding.\",\n    \"Regulatory compliance solutions tailored for the banking, credit union, and fintech sectors.\",\n    \"Specific compliance support for marketing activities.\"\n  ],\n  \"useCases\": \"Information regarding 'Regula's' product features and capabilities could not be found, therefore potential use cases for Regula in conjunction with Themis cannot be determined.\",\n  \"recentNews\": [\n    \"Partnership with Sei to enhance marketing compliance with AI solutions.\",\n    \"Hosted an event discussing digital asset-related financial crime, offering insights for compliance, risk, legal, and regulatory professionals (December 8, 2025).\",\n    \"Launched 'AI Investigator' to transform compliance and aid in detecting and preventing financial crime (September 18, 2025).\",\n    \"Expanded operations into Saudi Arabia (January 29, 2024).\",\n    \"Acquired the agentic fraud platform Pasabi to augment its digital financial crime platform with new Agentic AI capabilities (October 3, 2025).\",\n    \"Published a '2025 Fraud Trends' report, highlighting anticipated fraud risks and strategic priorities.\",\n    \"Provided insights through 'Themis Signal \u2013 Regulatory Watch' regarding FDIC Chair Travis Hill\u2019s testimony on the reshaping regulatory landscape (December 2, 2025).\"\n  ],\n  \"competitors\": \"Direct competitor analysis for Themis could not be found through web search.\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "53079650-8a33-47d6-aa7b-5f9dfa7d1353",
      "name": "Insert Lead",
      "type": "n8n-nodes-base.postgres",
      "position": [
        400,
        2624
      ],
      "parameters": {
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "leads",
          "cachedResultName": "leads"
        },
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public",
          "cachedResultName": "public"
        },
        "columns": {
          "value": {
            "name": "={{ $json.name }}",
            "email": "={{ $json.email }}",
            "title": "={{ $json.title }}",
            "website": "={{ $json.companyDomain }}",
            "linkedin": "={{ $json.linkedin }}",
            "company_id": "={{ $('Loop Over Companies').first().json.id }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "number",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "company_id",
              "type": "number",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "company_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "email",
              "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": "company_research",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "company_research",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "linkedin",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "company_name",
              "type": "string",
              "display": true,
              "removed": 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": "sent_date",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "sent_date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_content",
              "type": "object",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "email_content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.6
    },
    {
      "id": "2322801d-6c30-4732-92d6-63bc663379ff",
      "name": "KB - Research",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        -1088,
        2656
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {},
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-nodes",
          "cachedResultName": "n8n-nodes"
        },
        "toolDescription": "Use this knowledge base to understand Regula product features and capabilities"
      },
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "21107611-d8db-4b66-8d8e-2f6b8261986e",
      "name": "Get Companies",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -1920,
        2864
      ],
      "parameters": {
        "limit": 5,
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "search",
          "cachedResultName": "search"
        },
        "where": {
          "values": [
            {
              "value": "=FALSE",
              "column": "status"
            }
          ]
        },
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "options": {},
        "operation": "select"
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.6
    },
    {
      "id": "5717c7ea-fd11-4559-9a89-4be5a78d3806",
      "name": "Loop Over Companies",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1696,
        2864
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "14326b40-cef9-4ad2-b806-3cd11aa57b17",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        -1376,
        2432
      ],
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    },
    {
      "id": "ced56daa-6a3f-48c3-bcfc-44a8d61bc933",
      "name": "Update Company Status",
      "type": "n8n-nodes-base.postgres",
      "position": [
        624,
        2816
      ],
      "parameters": {
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "search",
          "cachedResultName": "search"
        },
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "columns": {
          "value": {
            "id": "={{ $('Loop Over Companies').first().json.id }}",
            "status": true
          },
          "schema": [
            {
              "id": "id",
              "type": "number",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "snippet",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "snippet",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "position",
              "type": "number",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "position",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "score",
              "type": "number",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "domain",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "domain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "boolean",
              "display": true,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.6
    },
    {
      "id": "f635da3b-d38a-4b2c-8844-b985201982fe",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        176,
        2688
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "51f29309-d7cd-4069-a9ca-5a39cc9cc358",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.email }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "f4aac69c-d560-4f55-8390-e987e1afb7c7",
      "name": "Gemini1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1344,
        2656
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7616791f-f273-4833-bdeb-fd20aa451d67",
      "name": "Embeddings1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        -1008,
        2864
      ],
      "parameters": {
        "modelName": "models/gemini-embedding-001"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ce2a2302-ae4f-4793-8265-7265c06f5fe1",
      "name": "Web Search - Serper1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -1216,
        2656
      ],
      "parameters": {
        "url": "https://google.serper.dev/search",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"q\": \"{{ $json.companyName }} recent news compliance regulatory\",\n  \"num\": 10,\n  \"gl\": \"us\",\n  \"hl\": \"en\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "toolDescription": "Google Serper API",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "c7053859-2852-4e5b-9e42-7a0166089b9f",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2144,
        2864
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 1
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "2a5c71f3-10c5-4ebe-9183-f31c79f1a442",
      "name": "Email Personalization Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1344,
        3808
      ],
      "parameters": {
        "text": "=Create a personalized outreach email:\n\nDecision Maker: {{ $json.name }}\nTitle: {{ $json.title }}\nCompany: {{ $json.website }}\n\nCompany Research: {{ $json.company_research }}\n\nUse the Regula knowledge base to understand our product and create a compelling email that addresses their specific needs and challenges.",
        "options": {
          "systemMessage": "=You are an expert sales email writer specializing in personalized B2B outreach.\n\nCreate a compelling, personalized outreach email that:\n1. Addresses the decision maker by name and role\n2. References specific company challenges or opportunities\n3. Explains how Regula can help solve their problems\n4. Includes a clear call-to-action\n5. Is concise (150-200 words)\n6. Is professional but friendly\n\nReturn a JSON object with:\n- subject: email subject line (compelling and personalized)\n- body: email body (HTML format, professional)\n- cta: call-to-action text\n\nThe Email Footer must be:\n\nBest Regards,\nMushood Hanif\nCEO @Regula"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "notesInFlow": false,
      "typeVersion": 2.2,
      "alwaysOutputData": false
    },
    {
      "id": "994702b4-295b-470b-9481-e7370d4322b4",
      "name": "Loop Over Leads",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1696,
        4176
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "9947b4a2-8022-4b35-95dc-50671676445f",
      "name": "Get Leads",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -1920,
        4176
      ],
      "parameters": {
        "limit": 5,
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "leads",
          "cachedResultName": "leads"
        },
        "where": {
          "values": [
            {
              "column": "sent_date",
              "condition": "IS NULL"
            }
          ]
        },
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "options": {},
        "operation": "select"
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.6
    },
    {
      "id": "86babda2-58d3-40e0-ad65-3ca1d4ff0b23",
      "name": "KB - Email",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        -1312,
        4032
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {},
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-nodes",
          "cachedResultName": "n8n-nodes"
        },
        "toolDescription": "Use this knowledge base to understand Regula product features, benefits, and use cases"
      },
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "efa9485d-f94d-4ecd-9c7c-f51110aa79d8",
      "name": "Update Lead",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -624,
        4240
      ],
      "parameters": {
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "leads",
          "cachedResultName": "leads"
        },
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "columns": {
          "value": {
            "id": "={{ $('Loop Over Leads').item.json.id }}",
            "sent_date": "={{ $now }}",
            "email_content": "={{ JSON.stringify({\n  subject: $('Email Personalization Agent').item.json.output.subject,\n  body: $('Email Personalization Agent').item.json.output.body,\n  cta: 'Schedule a 15-minute call'\n}) }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "number",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "company_id",
              "type": "number",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "company_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "company_research",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "company_research",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "linkedin",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "company_name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "company_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "sent_date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "sent_date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_content",
              "type": "object",
              "display": true,
              "required": false,
              "displayName": "email_content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.6
    },
    {
      "id": "e9390365-1665-4822-afb2-78f314b326e2",
      "name": "Send Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -1040,
        3808
      ],
      "parameters": {
        "sendTo": "={{ $('Loop Over Leads').item.json.email }}",
        "message": "={{ $json.output.body }}\n\n{{ $json.output.cta }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $json.output.subject }}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "a586607e-264f-46d6-b4b4-5f5ae8659d29",
      "name": "Schedule Trigger2",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2144,
        4176
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 2
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "307d72b8-eb23-4110-99a5-0103fe9d09b1",
      "name": "Gemini2",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1408,
        4032
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "559af287-a7a6-4a10-9146-51f38864ee93",
      "name": "Embeddings2",
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "position": [
        -1264,
        4240
      ],
      "parameters": {
        "modelName": "models/gemini-embedding-001"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a9509ee6-b370-4fd2-849b-432463b8d3f3",
      "name": "Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1056,
        4032
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"subject\": \"Enhancing Digital Trust and Efficiency for {{ $json.companyName }} - A Solution for {{ $json.title }}\",\n  \"body\": \"<html><body><p>Dear {{ $json.name }},</p><p>As the {{ $json.title }} at {{ $json.companyName }}, you're likely navigating the complexities of securing digital transactions and ensuring seamless customer experiences within the {{ $json.companyIndustry }} sector. I understand from our research that a key challenge for {{ $json.companyName }} involves [<b><i>Insert Specific Challenge from Company Research here, e.g., streamlining identity verification processes during customer onboarding / mitigating increasing risks of online fraud</i></b>].</p><p>Regula specializes in advanced identity verification and document authentication solutions designed to address exactly these kinds of challenges. Our technology helps organizations like yours to accurately verify identities, detect fraudulent documents, and comply with regulatory requirements, all while significantly improving the speed and efficiency of your digital operations.</p><p>Imagine a future where {{ $json.companyName }} can onboard new customers faster, with complete confidence in their identities, and drastically reduce the incidence of fraud \u2013 that's the impact Regula can deliver.</p><p>Would you be open to a brief 15-minute call next week to discuss how Regula can specifically support {{ $json.companyName }}'s goals and help overcome these hurdles?</p><p>Best regards,</p><p>[Your Name]</p><p>[Your Title]</p><p>[Your Company - Regula]</p></body></html>\",\n  \"cta\": \"Schedule a 15-minute call\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "215e70b0-7aa2-4502-8e15-c072754aa32a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3168,
        -80
      ],
      "parameters": {
        "width": 816,
        "height": 992,
        "content": "# Workflow 1 - Context Creation for AI Agent\n\n## Workflow Overview\n\nThis n8n workflow is designed to automate a **RAG (Retrieval-Augmented Generation) pipeline** that synchronizes documents from a Google Drive folder into a Pinecone vector store while using Google Sheets as a \"Record Manager\" to prevent redundant processing.\n\n### 1. File Discovery & Filtering\n\n* **Trigger:** Manually started or scheduled.\n* **Google Drive Integration:** Scans a specific Google Drive folder for files.\n* **Validation:** An **IF Node** checks if the item is a folder or a file. Folders are ignored, and files are passed for processing.\n\n### 2. Change Detection (State Management)\n\nTo save costs and processing time, the workflow manages \"state\":\n\n* **Hashing:** Creates a **SHA256 hash** of the file content.\n* **Record Lookup:** Queries a **Google Sheet** to see if the file ID already exists and if the hash has changed.\n* **Switch Logic:**\n* **New Document:** If not in the sheet, it's uploaded to Pinecone and added to the sheet.\n* **Updated Document:** If the hash differs, it re-processes the file and updates the sheet.\n* **Already Processed:** If the hash matches, the workflow skips that file.\n\n\n\n### 3. Data Ingestion & Vectorization\n\n* **Data Loading:** Downloads the file and uses the **Default Data Loader** to extract text.\n* **Text Splitting:** Uses a **Recursive Character Text Splitter** to break text into smaller, manageable chunks (chunks of 1000 characters with 10-character overlap).\n* **Embedding:** Converts text chunks into high-dimensional vectors using the **Google Gemini Embedding Model**.\n\n### 4. Vector Storage\n\n* **Pinecone:** The generated embeddings and metadata (file name, ID) are upserted into the **Pinecone Vector Database**.\n* **Namespacing:** One Pinecone node is configured to \"Clear Namespace,\" ensuring that updated documents replace old data accurately."
      },
      "typeVersion": 1
    },
    {
      "id": "42571a26-4dc3-4acc-b6cc-ecc18904e103",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3168,
        992
      ],
      "parameters": {
        "width": 816,
        "height": 1136,
        "content": "# Workflow 2 - Lead Generation\n\n## Workflow Overview\nThis n8n workflow is an **AI-driven Lead Generation engine**. It uses an autonomous agent to analyze product knowledge, search the live web for potential customers, and save unique business leads into a database while filtering out duplicates and junk results.\n\n### 1. Strategy Generation (The \"Brain\")\n\n* **Trigger:** Operates on a **Schedule Trigger** (e.g., daily or weekly).\n* **Lead Criteria Agent:** A LangChain-powered agent that uses **Gemini** to analyze the \"Regula\" product knowledge base stored in **Pinecone**.\n* **Output:** It generates a structured JSON profile of the \"Ideal Customer,\" including target industries (FinTech, HealthTech), company size, and specific **search queries** designed to find corporate websites rather than blog articles.\n\n### 2. Automated Web Research\n\n* **Extract & Loop:** The workflow takes the generated search queries and iterates through them one by one.\n* **Web Search (Serper):** Uses the Serper.dev API (Google Search) to find live results. It includes advanced \"negative search\" operators (e.g., `-site:medium.com`) to exclude social media and blog posts.\n\n### 3. Data Parsing & Scoring\n\n* **Parse Companies (Code Node):** A sophisticated JavaScript snippet that filters the search results. It:\n* Removes \"listicles\" (e.g., \"Top 10 compliance firms\").\n* Identifies actual company homepages.\n* Assigns a **Score** based on how likely the URL is a legitimate business (e.g., presence of `/solutions` or `/products` pages).\n* Extracts the domain and cleans the company name.\n\n---\n\n### 4. Database Integration & De-duplication\n\n* **Postgres Check:** Queries an existing **Postgres database** to pull current leads.\n* **Filtering:** A **Filter Existing Leads** node compares the new search results against the database. If a company already exists in your records, it is discarded to prevent spamming the same lead.\n* **Insert:** Only brand-new, high-scoring leads are inserted into the `search` table in Postgres.\n\n---\n\n## Why this is effective\n\nUnlike simple web scrapers, this workflow uses **AI to decide *what* to search for** based on your product's specific strengths. The built-in scoring logic ensures you don't waste database space on LinkedIn posts, Wikipedia entries, or PDF guides, focusing strictly on actionable company websites."
      },
      "typeVersion": 1
    },
    {
      "id": "47c60dc4-9570-4670-88c8-60b9fa7e420c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3168,
        2208
      ],
      "parameters": {
        "width": 816,
        "height": 1216,
        "content": "# Workflow 3 - Contact Generation\n\n## Workflow Overview\nThis n8n workflow is a **Deep Research & Lead Enrichment pipeline**. It picks up where the previous \"Lead Generation\" workflow left off by taking raw company names and performing an automated \"deep dive\" to find actual decision-makers and their contact details.\n\n### 1. Lead Retrieval & Throttling\n\n* **Trigger:** Runs on a daily **Schedule Trigger**.\n* **Database Lookup:** Fetches up to 5 companies from your **Postgres** \"search\" table where the status is marked as `FALSE` (not yet processed).\n* **Loop & Wait:** It iterates through each company, using **Wait nodes** to throttle requests. This prevents hitting API rate limits for search and enrichment tools.\n\n### 2. Deep Company Research (AI Analyst)\n\n* **Company Research Agent:** Uses **Gemini** to act as a sales analyst.\n* **Tools:** The agent has access to:\n* **Web Search (Serper):** To find recent news, regulatory challenges, and competitors.\n* **Pinecone (KB):** To cross-reference company needs with specific Regula product features.\n\n* **Output:** Generates a structured JSON summary including industry-specific pain points and custom \"use cases\" for why the company needs your solution.\n\n### 3. Contact Enrichment (Finding the \"Who\")\n\n* **Hunter.io Integration:** Once the company is researched, the workflow uses the **Hunter node** to search for professional email addresses and LinkedIn profiles associated with that company's domain.\n* **Decision Maker Filtering:** A **Code Node** parses these results to extract names, job titles, and verified emails, filtering out any \"null\" or generic results.\n\n### 4. Final Data Storage\n\n* **Validation:** An **IF Node** checks if any valid emails were actually found.\n* **Insert Lead:** Validated decision-makers\u2014complete with their title, LinkedIn, and the AI-generated research\u2014are inserted into the final `leads` table in Postgres.\n* **Status Update:** Finally, the workflow marks the company as `status = TRUE` in the original search table so it isn't processed again.\n\n---\n\n## Why this is effective\n\nThis workflow transforms a simple \"list of companies\" into a **high-context sales sheet**. Instead of just having a website URL, your sales team receives:\n\n1. A specific person to contact.\n2. Their verified email and LinkedIn.\n3. A custom-tailored reason *why* they should talk to you based on current news and compliance gaps."
      },
      "typeVersion": 1
    },
    {
      "id": "ee707a66-0b28-46a5-9c65-4d9436aab62d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3168,
        3504
      ],
      "parameters": {
        "width": 816,
        "height": 1184,
        "content": "# Workflow 4 - Email Outreach\n\n## Workflow Overview\nThis n8n workflow is the final stage of your automated sales funnel: the **Hyper-Personalized Outreach Engine**. It takes the deep research gathered in previous steps and uses AI to write and send tailored emails that appear to be written by a human CEO.\n\n### 1. Lead Selection\n\n* **Trigger:** Set to run daily on a **Schedule Trigger** (at 2 AM).\n* **Database Retrieval:** Queries the **Postgres** `leads` table for up to 5 prospects who have been researched but haven't received an email yet (`sent_date IS NULL`).\n* **Batching:** Uses a **Loop** to process each lead individually, ensuring high-quality output for every recipient.\n\n### 2. AI Copywriting (The \"Personalization Agent\")\n\n* **Context Injection:** The **Email Personalization Agent** (powered by **Gemini**) receives:\n* The prospect's name and title.\n* The deep company research (pain points, regulatory challenges).\n* Access to the **Regula Knowledge Base** (via Pinecone) to match product features to the prospect's specific problems.\n\n\n* **The Prompt:** The AI is instructed to write a professional yet friendly email (150\u2013200 words) from your CEO, **Mushood Hanif**. It ensures the email isn't generic by referencing the specific news or challenges identified in the research phase.\n\n### 3. Automated Sending (Gmail)\n\n* **Structured Parsing:** The **Parser** ensures the AI output is perfectly formatted into a JSON object containing a subject line, an HTML body, and a Call to Action (CTA).\n* **Gmail Integration:** Sends the final email directly through a connected Gmail account.\n\n### 4. Closing the Loop\n\n* **Database Update:** Once the email is successfully sent, the workflow updates the Postgres record.\n* **Tracking:** It records the `sent_date` and saves the exact `email_content` that was sent, preventing duplicate outreach and maintaining a clear history for the sales team.\n\n---\n\n## The \"End-to-End\" Result\n\nYou have now built a complete **Autonomous Sales Department**:\n\n1. **Workflow 1:** Syncs your product knowledge.\n2. **Workflow 2:** Finds companies that need your product.\n3. **Workflow 3:** Researches those companies and finds the decision-makers.\n4. **Workflow 4 (This one):** Sends a personalized \"Cold\" email that references their specific company news."
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Insert Lead",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Company Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Company Research Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini": {
      "ai_languageModel": [
        [
          {
            "node": "Lead Criteria Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Hunter": {
      "main": [
        [
          {
            "node": "Parse Decision Makers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Company Research Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Add to Record Manger",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update the RecordManger",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini1": {
      "ai_languageModel": [
        [
          {
            "node": "Company Research Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Gemini2": {
      "ai_languageModel": [
        [
          {
            "node": "Email Personalization Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Parser ": {
      "ai_outputParser": [
        [
          {
            "node": "Lead Criteria Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Email Personalization Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "If Leads": {
      "main": [
        [
          {
            "node": "Extract Lead Names",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Parsed Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Leads": {
      "main": [
        [
          {
            "node": "Loop Over Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings": {
      "ai_embedding": [
        [
          {
            "node": "KB - Lead Criteria",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "KB - Email": {
      "ai_tool": [
        [
          {
            "node": "Email Personalization Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Send Gmail": {
      "main": [
        [
          {
            "node": "Update Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "createHash": {
      "main": [
        [
          {
            "node": "searchRecordManger",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings1": {
      "ai_embedding": [
        [
          {
            "node": "KB - Research",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings2": {
      "ai_embedding": [
        [
          {
            "node": "KB - Email",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Insert Lead": {
      "main": [
        [
          {
            "node": "Update Company Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Lead": {
      "main": [
        [
          {
            "node": "Loop Over Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "createHash",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Companies": {
      "main": [
        [
          {
            "node": "Loop Over Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "KB - Research": {
      "ai_tool": [
        [
          {
            "node": "Company Research Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Download file1": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file2": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Queries": {
      "main": [
        [
          {
            "node": "Loop Over Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "nonDownloadableFile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Leads": {
      "main": [
        [],
        [
          {
            "node": "Email Personalization Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Companies": {
      "main": [
        [
          {
            "node": "Get Existing Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Companies": {
      "main": [
        [
          {
            "node": "Loop Over Queries",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Lead Criteria Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Queries": {
      "main": [
        [],
        [
          {
            "node": "Web Search - Serper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Get Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger2": {
      "main": [
        [
          {
            "node": "Get Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Lead Names": {
      "main": [
        [
          {
            "node": "Filter Existing Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Existing Leads": {
      "main": [
        [
          {
            "node": "If Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "KB - Lead Criteria": {
      "ai_tool": [
        [
          {
            "node": "Lead Criteria Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "searchRecordManger": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_document",
            "index": 0
          },
          {
            "node": "Pinecone Vector Store1",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Lead Criteria Agent": {
      "main": [
        [
          {
            "node": "Extract Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Companies": {
      "main": [
        [],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Web Search - Serper": {
      "main": [
        [
          {
            "node": "Parse Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "nonDownloadableFile": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to Record Manger": {
      "main": [
        [
          {
            "node": "Download file1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Parsed Companies": {
      "main": [
        [
          {
            "node": "Insert Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Web Search - Serper1": {
      "ai_tool": [
        [
          {
            "node": "Company Research Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Filter Existing Leads": {
      "main": [
        [
          {
            "node": "Insert Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Decision Makers": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Company Status": {
      "main": [
        [
          {
            "node": "Loop Over Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Company Research Agent": {
      "main": [
        [
          {
            "node": "Wait Before Email Finder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update the RecordManger": {
      "main": [
        [
          {
            "node": "Download file2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Google Gemini": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Pinecone Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Search files and folders": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Email Finder": {
      "main": [
        [
          {
            "node": "Hunter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Personalization Agent": {
      "main": [
        [
          {
            "node": "Send Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Search files and folders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}