{ "name": "Enrich Company Firmographic Data in Google Sheets with Explorium MCP", "nodes": [ { "parameters": { "pollTimes": { "item": [ { "mode": "everyMinute" } ] }, "documentId": { "__rl": true, "mode": "list", "value": "1bAMUxQ2UCU_rd1khEkNZ0RKqmBzal7eKk90-AnVScQE", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bAMUxQ2UCU_rd1khEkNZ0RKqmBzal7eKk90-AnVScQE/edit?usp=drivesdk", "cachedResultName": "n8n test" }, "sheetName": { "__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bAMUxQ2UCU_rd1khEkNZ0RKqmBzal7eKk90-AnVScQE/edit#gid=0", "cachedResultName": "Sheet1" }, "options": {} }, "id": "e88652cf-cf09-4799-b664-45af4e314e83", "name": "Google Sheets Trigger", "type": "n8n-nodes-base.googleSheetsTrigger", "position": [ -704, 124 ], "typeVersion": 1 }, { "parameters": { "conditions": { "options": { "version": 1, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "8c7d5b8a-4569-4c8f-b5e8-6c5f5e5c5e5c", "operator": { "type": "string", "operation": "notEmpty" }, "leftValue": "={{ $json.name }}", "rightValue": "" }, { "id": "9d8e6c9b-5670-5d9f-c6f9-7d6g6f6d6f6d", "operator": { "type": "string", "operation": "notEmpty" }, "leftValue": "={{ $json.website }}", "rightValue": "" } ] }, "options": {} }, "id": "04290361-ad81-4f1a-b267-3d707f8cd253", "name": "Filter Valid Rows", "type": "n8n-nodes-base.if", "position": [ -480, 124 ], "typeVersion": 2 }, { "parameters": { "options": {} }, "id": "8bf68e42-a28c-4769-9e33-e0633668a1d9", "name": "Loop Over Items", "type": "n8n-nodes-base.splitInBatches", "position": [ -256, 124 ], "typeVersion": 3 }, { "parameters": { "promptType": "define", "text": "=You will be provided with company information including:\n\nName: {{ $json.name }}\nDomain: {{ $json.website }}\n\nYour task is to research and extract the following key business metrics for this company:\nRequired Data Points:\n- Name (keep the same as provided)\n- Website (keep the same as provided)\n- Annual revenue (as business_id first, then get the range)\n- Number of employees (range)\n- NAICS code\n\nUse the Explorium tools to:\n1. First use match-business to find the business ID\n2. Then use enrich-businesses-firmographics to get the company details\n\nReturn the data exactly in this format.", "hasOutputParser": true, "options": {} }, "id": "625db31b-0236-4897-9ddd-6aba1c5672bf", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 24, 0 ], "typeVersion": 1.6 }, { "parameters": { "model": { "__rl": true, "value": "claude-sonnet-4-5-20250929", "mode": "list", "cachedResultName": "Claude Sonnet 4.5" }, "options": {} }, "id": "225f4f5d-fe00-4747-9181-a9ac4dcb1aa8", "name": "Anthropic Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic", "position": [ -32, 224 ], "typeVersion": 1.3, "credentials": { "anthropicApi": {} } }, { "parameters": { "jsCode": "// Simply pass through the AI output with proper formatting\nreturn {\n name: $json.output.name || $json.name,\n website: $json.output.website || $json.website,\n business_id: $json.output.business_id || '',\n naics: $json.output.naics || '',\n number_of_employees_range: $json.output.number_of_employees_range || '',\n yearly_revenue_range: $json.output.yearly_revenue_range || ''\n};" }, "id": "0bab3c6b-51ad-44d5-8f48-f4108eeb6b54", "name": "Code - Format Output", "type": "n8n-nodes-base.code", "position": [ 432, 0 ], "typeVersion": 2 }, { "parameters": { "operation": "appendOrUpdate", "documentId": { "__rl": true, "mode": "list", "value": "1bAMUxQ2UCU_rd1khEkNZ0RKqmBzal7eKk90-AnVScQE", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bAMUxQ2UCU_rd1khEkNZ0RKqmBzal7eKk90-AnVScQE/edit?usp=drivesdk", "cachedResultName": "n8n test" }, "sheetName": { "__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bAMUxQ2UCU_rd1khEkNZ0RKqmBzal7eKk90-AnVScQE/edit#gid=0", "cachedResultName": "Sheet1" }, "columns": { "value": {}, "schema": [ { "id": "name", "type": "string", "display": true, "removed": false, "required": false, "displayName": "name", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "website", "type": "string", "display": true, "removed": false, "required": false, "displayName": "website", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "business_id", "type": "string", "display": true, "removed": false, "required": false, "displayName": "business_id", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "naics", "type": "string", "display": true, "removed": false, "required": false, "displayName": "naics", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "number_of_employees_range", "type": "string", "display": true, "removed": false, "required": false, "displayName": "number_of_employees_range", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "yearly_revenue_range", "type": "string", "display": true, "removed": false, "required": false, "displayName": "yearly_revenue_range", "defaultMatch": false, "canBeUsedToMatch": true } ], "mappingMode": "autoMapInputData", "matchingColumns": [ "name" ] }, "options": {} }, "id": "a76dbb00-24de-4cf2-b5ef-35839b7e68b3", "name": "Update Company Row", "type": "n8n-nodes-base.googleSheets", "position": [ 656, 124 ], "typeVersion": 4.5 }, { "parameters": { "content": "# Enrich Company Data from Google Sheets with Explorium MCP\n\nThis workflow automatically enriches company data when new rows are added or when the name/website fields are updated in your Google Sheet.", "height": 280, "width": 460, "color": 5 }, "id": "09191cb1-d819-4cd0-b0c1-01d6d4124b31", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -704, 400 ], "typeVersion": 1 }, { "parameters": { "jsonSchemaExample": "{\n \"name\": \"Microsoft Corporation\",\n \"website\": \"https://www.microsoft.com\",\n \"business_id\": \"a34bacf839b923770b2c360eefa26748\",\n \"naics\": \"511210\",\n \"number_of_employees_range\": \"10001+\",\n \"yearly_revenue_range\": \"100B-1T\"\n}" }, "id": "6190f78e-7d44-496d-9596-088fdca13584", "name": "Output Parser", "type": "@n8n/n8n-nodes-langchain.outputParserStructured", "position": [ 224, 224 ], "typeVersion": 1.2 }, { "parameters": { "content": "### Workflow Structure:\n\n**Google Sheets Trigger** → **Filter Valid Rows** → **Loop Over Items**\n ↓\n **AI Agent**\n ↓\n **Code - Format Output**\n ↓\n **Update Company Row**\n ↓\n (back to Loop Over Items)", "height": 280, "width": 460 }, "id": "d9e5f0fb-e66f-47a3-b0e0-92df54eb9450", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -208, 400 ], "typeVersion": 1 }, { "parameters": { "content": "### How the Loop Works:\n1. Loop Over Items splits the batch (size 1)\n2. Sends one item to AI Agent\n3. AI Agent enriches the data\n4. Code formats the output\n5. Google Sheets updates the row\n6. Flow returns to Loop Over Items for next item\n7. When all items are processed, loop ends\n\n### Key Points:\n- Each row is processed individually\n- The loop continues until all rows are done\n- Failed enrichments won't stop other rows\n\n### Testing:\n1. Add multiple rows with company names and websites\n2. Trigger the workflow\n3. Watch each row get processed sequentially\n4. All rows should be updated with enriched data", "height": 460, "width": 460, "color": 4 }, "id": "ffc1473a-158f-4d0e-831e-32f172701d60", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 304, 400 ], "typeVersion": 1 }, { "parameters": { "endpointUrl": "https://mcp-n8n.explorium.ai/mcp", "authentication": "headerAuth", "options": {} }, "type": "@n8n/n8n-nodes-langchain.mcpClientTool", "typeVersion": 1.2, "position": [ 96, 224 ], "id": "13f5c31b-be3b-4a09-b983-f33de15c4c2f", "name": "MCP Client", "credentials": { "httpHeaderAuth": {} } } ], "pinData": { "Google Sheets Trigger": [ { "json": { "name": "Amazon.com, Inc.", "naics": 454110, "website": "https://www.amazon.com", "row_number": 9, "business_id": "8f19793b2671094e63a15ab883d50137", "change_type": "updated", "yearly_revenue_range": "100B-1T", "number_of_employees_range": "10001+" } }, { "json": { "name": "Toyota North America", "naics": 336111, "website": "https://careers.toyota.com/us/en", "row_number": 10, "business_id": "9185f3ec501c674c7c788464a36e7fb3", "change_type": "updated", "yearly_revenue_range": "10B-100B", "number_of_employees_range": "10001+" } }, { "json": { "name": "The Coca-Cola Company", "naics": 312112, "website": "https://www.coca-colacompany.com", "row_number": 11, "business_id": "26751be1181460baf78db8d5eb7aad39", "change_type": "updated", "yearly_revenue_range": "10B-100B", "number_of_employees_range": "10001+" } } ] }, "connections": { "AI Agent": { "main": [ [ { "node": "Code - Format Output", "type": "main", "index": 0 } ] ] }, "Output Parser": { "ai_outputParser": [ [ { "node": "AI Agent", "type": "ai_outputParser", "index": 0 } ] ] }, "Loop Over Items": { "main": [ [], [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Filter Valid Rows": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Update Company Row": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Anthropic Chat Model": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Code - Format Output": { "main": [ [ { "node": "Update Company Row", "type": "main", "index": 0 } ] ] }, "Google Sheets Trigger": { "main": [ [ { "node": "Filter Valid Rows", "type": "main", "index": 0 } ] ] }, "MCP Client": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1" }, "versionId": "", "meta": { "instanceId": "0a70652f43c1b29dd16c35b61a38fd31c8004f58bc7e723bf43262a797407c77" }, "id": "wPoAbM9MyEUmG20lcRWLB", "tags": [] }