{
  "id": "fIQYk1uGxYOsGTGk",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI Company Data Enrichment",
  "tags": [],
  "nodes": [
    {
      "id": "1b461701-6d5e-47cf-92d5-51b5e1b7df03",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        96,
        128
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "72c3faad-be68-43c9-8412-ffa1669cef38",
      "name": "Start Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1248,
        144
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8cfde1aa-392f-4832-90d0-4517efadbf59",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2080,
        -608
      ],
      "parameters": {
        "color": 5,
        "width": 784,
        "height": 576,
        "content": "\ud83d\udd39 AI Company Data Enrichment Workflow\n\nThis workflow automatically enriches company data using website URLs.\n\n\ud83d\udce5 Input:\n- Google Sheet with company website URLs\n\n\u2699\ufe0f Process:\n- Fetch pending records\n- Visit each website\n- Extract structured company data using AI\n- Merge and update results back into the sheet\n\n\ud83d\udce4 Output:\n- Enriched company details stored in the same Google Sheet\n\n\ud83e\udd16 AI Provider:\n- TinyFish AI\n\n\u23f1 Execution:\n- Processes 5 companies per run (configurable)"
      },
      "typeVersion": 1
    },
    {
      "id": "0c126dc3-a20e-4a54-905b-d5578d58c5b5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2080,
        16
      ],
      "parameters": {
        "color": 5,
        "width": 784,
        "height": 416,
        "content": "\u2699\ufe0f Setup Required Before Running\n\nMake sure the following are configured:\n\n1. Google Sheets credentials\n2. TinyFish API credentials\n3. Google Sheet ID & Sheet Name\n\n\ud83d\udccc Required Columns:\n- Website URL\n- Status\n\n\u2139\ufe0f Notes:\n- Only rows with empty \"Status\" will be processed\n- Other columns will be filled automatically"
      },
      "typeVersion": 1
    },
    {
      "id": "5f7a9460-a559-4eb9-9754-d931ab7d2acd",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        112
      ],
      "parameters": {
        "color": 6,
        "height": 496,
        "content": "\n\n\n\n\n\n\n\nReads company website URLs from Google Sheets.\n\n\u2714 Required Fields:\n- Website URL\n- Status\n\n\ud83d\udd0e Logic:\n- Only records with empty Status are selected"
      },
      "typeVersion": 1
    },
    {
      "id": "2553385c-a1b8-4c01-b604-b1d5e2bb8fb5",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -704,
        112
      ],
      "parameters": {
        "color": 6,
        "width": 256,
        "height": 448,
        "content": "\n\n\n\n\n\n\n\nChecks if the \"Status\" column is empty.\n\n\u2714 Empty \u2192 Process\n\u274c Completed \u2192 Skip\n\nThis avoids duplicate processing."
      },
      "typeVersion": 1
    },
    {
      "id": "3daf7ac9-ad81-4dd4-9a6a-212719f46577",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        112
      ],
      "parameters": {
        "color": 6,
        "width": 256,
        "height": 448,
        "content": "\n\n\n\n\n\n\nLimits execution to 5 records per run.\n\n\u26a0\ufe0f Why:\n- Prevent API overload\n- Stay within rate limits\n\n\ud83d\udd27 Tip:\nIncrease batch size if your API allows it."
      },
      "typeVersion": 1
    },
    {
      "id": "c8a73cf3-b2c3-4dd6-a30d-6e56a980f59a",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -496
      ],
      "parameters": {
        "color": 6,
        "width": 336,
        "height": 624,
        "content": "This step visits each company website and uses AI to extract structured business information.\n\n\ud83d\udcca Extracted Data:\n- Company Name\n- Email\n- Phone\n- LinkedIn\n- Founder / CEO\n- Industry\n- Address\n\n\u26a0\ufe0f Notes:\n- Only publicly available data is extracted\n- Missing values remain empty\n- Accuracy depends on website content\n\n\n\n\n\n\n\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ca6f3c9e-ea2c-4695-b1ae-855be261a2d7",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        -192
      ],
      "parameters": {
        "color": 6,
        "height": 496,
        "content": "Updates the same row with enriched company data.\n\n\u2714 Actions:\n- Writes extracted details\n- Marks Status as \"Completed\"\n\n\ud83c\udfaf Why:\nPrevents duplicate processing in future runs"
      },
      "typeVersion": 1
    },
    {
      "id": "67440511-6cbb-42f0-8d2b-137f25292e60",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        -144
      ],
      "parameters": {
        "color": 6,
        "width": 304,
        "height": 432,
        "content": "Adds a delay of 5\u201315 seconds between each request.\n\n\ud83c\udfaf Purpose:\n- Prevent API rate limit errors\n- Ensure stable workflow execution\n\n\ud83d\udca1 Tip:\nReduce delay only if your API supports higher limits"
      },
      "typeVersion": 1
    },
    {
      "id": "f3bcbb5d-cdc2-4976-a809-a9024540e6b4",
      "name": "\ud83d\udea6 Filter Pending Records",
      "type": "n8n-nodes-base.if",
      "position": [
        -656,
        144
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "27972148-20fc-4ad8-bb9f-04ce00fa8b9c",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json.Status }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "3c4e3b8b-95d6-4ba2-ad0c-c0050bb02274",
      "name": "\ud83d\udce5 Fetch Website URLs",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -896,
        144
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "=YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "03dad446-2741-43d0-86c9-d0679b27b874",
      "name": "\ud83d\udce6 Batch Processing",
      "type": "n8n-nodes-base.limit",
      "position": [
        -368,
        128
      ],
      "parameters": {
        "maxItems": 5
      },
      "typeVersion": 1
    },
    {
      "id": "29ca6f55-26fc-4f10-aa63-d59521e5ec7d",
      "name": "\ud83e\udd16 AI Data Extraction",
      "type": "n8n-nodes-tinyfish.tinyfish",
      "position": [
        400,
        -32
      ],
      "parameters": {
        "url": "={{ $json[\"Website URL\"] }}",
        "goal": "=Extract verified company details from this website.\n\nReturn JSON only.\n\n{\n  \"website_url\":\"\",\n  \"company_phone\":\"\",\n  \"company_linkedin\":\"\",\n  \"company_email\":\"\",\n  \"company_name\":\"\",\n  \"industry_vertical\":\"\",\n  \"company_description\":\"\",\n  \"target_customers\":\"\",\n  \"founder_name\":\"\",\n  \"founder_linkedin\":\"\",\n  \"ceo_name\":\"\",\n  \"ceo_linkedin\":\"\",\n  \"office_address\":\"\",\n  \"team_linkedin_profiles\":\"\",\n}\n\nRules:\n- Use \"\" if not found\n- No guessing",
        "options": {},
        "operation": "runSync"
      },
      "typeVersion": 1
    },
    {
      "id": "0c3b8b9f-6752-40c1-ac35-468cdcd0de93",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -208
      ],
      "parameters": {
        "color": 6,
        "height": 512,
        "content": "Combines:\n- Original Google Sheet row\n- AI extracted data\n\n\ud83c\udfaf Purpose:\nCreates a single structured dataset before updating the sheet.\n\n\u26a0\ufe0f Without this step:\nData may be overwritten or mismatched during update"
      },
      "typeVersion": 1
    },
    {
      "id": "762a6987-9d63-4a13-8001-951b69873ca0",
      "name": "\u23f1 Rate Limiting (API Protection)",
      "type": "n8n-nodes-base.wait",
      "position": [
        1360,
        128
      ],
      "parameters": {
        "amount": "={{ 5 + Math.floor(Math.random() * 10) + 1 }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "8d906b25-7bc2-4a5d-a371-63c26dfb2ce1",
      "name": "\ud83d\udcbe Save Results to Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        960,
        128
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "Completed",
            "CEO Name": "={{ $json.result.ceo_name }}",
            "Website URL": "={{ $json['Website URL'] }}",
            "CEO Linkedin": "={{ $json.result.ceo_linkedin }}",
            "Company Name": "={{ $json.result.company_name }}",
            "Founder Name": "={{ $json.result.founder_name }}",
            "Company Email": "={{ $json.result.company_email }}",
            "Company Phone": "={{ $json.result.company_phone }}",
            "Office Address": "={{ $json.result.office_address }}",
            "Company Linkedin": "={{ $json.result.company_linkedin }}",
            "Founder Linkedin": "={{ $json.result.founder_linkedin }}",
            "Target Customers": "={{ $json.result.target_customers }}",
            "Industry Vertical": "={{ $json.result.industry_vertical }}",
            "Company Description": "={{ $json.result.company_description }}",
            "Team Linkedin Profiles": "={{ $json.result.team_linkedin_profiles }}"
          },
          "schema": [
            {
              "id": "Website URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Website URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company Phone",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Company Phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company Linkedin",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Company Linkedin",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Company Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Company Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Industry Vertical",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Industry Vertical",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company Description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Company Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Target Customers",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Target Customers",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Founder Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Founder Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Founder Linkedin",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Founder Linkedin",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "CEO Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "CEO Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "CEO Linkedin",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "CEO Linkedin",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Office Address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Office Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Team Linkedin Profiles",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Team Linkedin Profiles",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Website URL"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "c2a6f389-2931-4957-8710-c8a213c8864d",
      "name": "\ud83d\udd17 Merge Source & AI Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        704,
        128
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "eeef4eb0-4b19-4fbd-826d-0be734ba3177",
  "nodeGroups": [],
  "connections": {
    "Start Workflow": {
      "main": [
        [
          {
            "node": "\ud83d\udce5 Fetch Website URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "\ud83e\udd16 AI Data Extraction",
            "type": "main",
            "index": 0
          },
          {
            "node": "\ud83d\udd17 Merge Source & AI Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "\ud83d\udce6 Batch Processing": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udce5 Fetch Website URLs": {
      "main": [
        [
          {
            "node": "\ud83d\udea6 Filter Pending Records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83e\udd16 AI Data Extraction": {
      "main": [
        [
          {
            "node": "\ud83d\udd17 Merge Source & AI Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udd17 Merge Source & AI Data": {
      "main": [
        [
          {
            "node": "\ud83d\udcbe Save Results to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udea6 Filter Pending Records": {
      "main": [
        [
          {
            "node": "\ud83d\udce6 Batch Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udcbe Save Results to Google Sheet": {
      "main": [
        [
          {
            "node": "\u23f1 Rate Limiting (API Protection)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u23f1 Rate Limiting (API Protection)": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}