{
  "name": "Enrich company leads with Firecrawl, OpenRouter AI, and Supabase",
  "nodes": [
    {
      "id": "82e8b97a-c916-41b0-b273-7fc8c31ab167",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -320
      ],
      "parameters": {
        "width": 464,
        "height": 112,
        "content": "## Supabase setup\nRun the SQL migration from the workflow README to create the `lead_enrichment` table with auto-updating timestamps."
      }
    },
    {
      "id": "9ca4cd14-9fb6-4eb4-b48c-8d5b108da22f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        -512
      ],
      "parameters": {
        "width": 384,
        "height": 560,
        "content": "### How it works\n1. A webhook receives a company URL via POST request\n2. The URL is validated and normalized\n3. Firecrawl scrapes the website and searches for additional company data\n4. An AI agent (O"
      }
    },
    {
      "id": "62943a2f-b3c2-49f0-82c3-c53a0db40024",
      "name": "Receive company URL",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -464,
        96
      ]
    },
    {
      "id": "4c7ca918-834c-4954-90ca-342757ed032e",
      "name": "Validate and normalize URL",
      "type": "n8n-nodes-base.code",
      "position": [
        -240,
        96
      ]
    },
    {
      "id": "9dd6f876-e97b-4d57-9c32-af4809e73d44",
      "name": "Extract business signals with AI",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        112,
        -160
      ]
    },
    {
      "id": "48741495-021d-408a-8b79-7cb490d7f131",
      "name": "OpenRouter LLM",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -16,
        64
      ]
    },
    {
      "id": "fa0674b2-3f3f-45d7-b0e1-02db4e267d8f",
      "name": "Scrape company website",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawlTool",
      "position": [
        144,
        64
      ]
    },
    {
      "id": "9701d370-aadc-4c39-b546-4224a49431f7",
      "name": "Search company data",
      "type": "@mendable/n8n-nodes-firecrawl.firecrawlTool",
      "position": [
        320,
        64
      ]
    },
    {
      "id": "427e93e2-595a-481f-83fe-749809eeb604",
      "name": "Parse into structured profile",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        480,
        64
      ]
    },
    {
      "id": "daccc2ad-5283-4c13-947a-640d2013718e",
      "name": "Check for duplicate in Supabase",
      "type": "n8n-nodes-base.supabase",
      "position": [
        576,
        -64
      ]
    },
    {
      "id": "9d7822f4-441d-4d0a-b92f-f114567a00e2",
      "name": "Skip if already enriched",
      "type": "n8n-nodes-base.if",
      "position": [
        800,
        -64
      ]
    },
    {
      "id": "9cf3219c-b671-40b4-be38-696e97c60d98",
      "name": "Prepare profile for insert",
      "type": "n8n-nodes-base.code",
      "position": [
        1056,
        48
      ]
    },
    {
      "id": "5a1823a8-0293-4571-b577-6c32257afa18",
      "name": "Save enriched profile to Supabase",
      "type": "n8n-nodes-base.supabase",
      "position": [
        1232,
        48
      ]
    },
    {
      "id": "b72fa969-c647-41b4-9789-7a39aa5affc3",
      "name": "Return enriched profile",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1424,
        -80
      ]
    },
    {
      "id": "daca8e6b-8ad3-4850-a76e-7a39bd515e2e",
      "name": "Return URL validation error",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        176,
        240
      ]
    }
  ],
  "connections": {
    "OpenRouter LLM": {
      "ai_languageModel": [
        [
          {
            "node": "Extract business signals with AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Receive company URL": {
      "main": [
        [
          {
            "node": "Validate and normalize URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search company data": {
      "ai_tool": [
        [
          {
            "node": "Extract business signals with AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Scrape company website": {
      "ai_tool": [
        [
          {
            "node": "Extract business signals with AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Skip if already enriched": {
      "main": [
        [
          {
            "node": "Return enriched profile",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare profile for insert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare profile for insert": {
      "main": [
        [
          {
            "node": "Save enriched profile to Supabase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate and normalize URL": {
      "main": [
        [
          {
            "node": "Extract business signals with AI",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Return URL validation error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse into structured profile": {
      "ai_outputParser": [
        [
          {
            "node": "Extract business signals with AI",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Check for duplicate in Supabase": {
      "main": [
        [
          {
            "node": "Skip if already enriched",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract business signals with AI": {
      "main": [
        [
          {
            "node": "Check for duplicate in Supabase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save enriched profile to Supabase": {
      "main": [
        [
          {
            "node": "Return enriched profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}