{
  "name": "Reverse lookup emails with ScraperCity and sync contacts to HubSpot CRM",
  "nodes": [
    {
      "id": "a1000000-0000-0000-0000-000000000001",
      "name": "When clicking 'Execute workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -2000,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000002",
      "name": "Configure Lookup Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        -1750,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000003",
      "name": "Start People Finder Scrape",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1500,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000004",
      "name": "Store Run ID",
      "type": "n8n-nodes-base.set",
      "position": [
        -1250,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000005",
      "name": "Wait Before First Poll",
      "type": "n8n-nodes-base.wait",
      "position": [
        -1000,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000006",
      "name": "Poll Loop",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -750,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000007",
      "name": "Check Scrape Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -500,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000008",
      "name": "Is Scrape Complete?",
      "type": "n8n-nodes-base.if",
      "position": [
        -250,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000009",
      "name": "Wait Before Retry",
      "type": "n8n-nodes-base.wait",
      "position": [
        -250,
        592
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000010",
      "name": "Download Scrape Results",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        0,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000011",
      "name": "Parse CSV Results",
      "type": "n8n-nodes-base.code",
      "position": [
        250,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000012",
      "name": "Remove Duplicate Contacts",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        500,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000013",
      "name": "Filter Valid Contacts",
      "type": "n8n-nodes-base.filter",
      "position": [
        750,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000014",
      "name": "Map Contact Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1000,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000015",
      "name": "Upsert Contact in HubSpot",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1250,
        400
      ]
    },
    {
      "id": "a1000000-0000-0000-0000-000000000099",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2600,
        100
      ],
      "parameters": {
        "width": 450,
        "height": 580,
        "content": "## How it works\n1. **Configure Lookup Parameters** -- set the email addresses you want to reverse-lookup and the max results per search.\n2. **Start People Finder Scrape** -- submits the emails to Scra"
      }
    },
    {
      "id": "a1000000-0000-0000-0000-000000000100",
      "name": "Section -- Config",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2040,
        -160
      ],
      "parameters": {
        "width": 730,
        "height": 330,
        "content": "## Configuration\n**Configure Lookup Parameters** is the only node you must edit. Enter target emails as a comma-separated string. **max_results** controls how many address records ScraperCity returns "
      }
    },
    {
      "id": "a1000000-0000-0000-0000-000000000101",
      "name": "Section -- Scrape Submit",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1290,
        -160
      ],
      "parameters": {
        "width": 730,
        "height": 330,
        "content": "## Scrape Submission\n**Start People Finder Scrape** posts the email list to ScraperCity's People Finder endpoint. **Store Run ID** captures the returned `runId` so the polling loop can reference it. *"
      }
    },
    {
      "id": "a1000000-0000-0000-0000-000000000102",
      "name": "Section -- Async Polling Loop",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -540,
        -160
      ],
      "parameters": {
        "width": 480,
        "height": 530,
        "content": "## Async Polling Loop\n**Poll Loop** iterates the status check. **Check Scrape Status** queries `/api/v1/scrape/status/{runId}`. **Is Scrape Complete?** routes to download on `SUCCEEDED`. Otherwise **W"
      }
    },
    {
      "id": "a1000000-0000-0000-0000-000000000103",
      "name": "Section -- Results Processing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        -160
      ],
      "parameters": {
        "width": 730,
        "height": 330,
        "content": "## Results Processing\n**Download Scrape Results** fetches the completed CSV. **Parse CSV Results** converts rows to JSON objects. **Remove Duplicate Contacts** deduplicates by email field. **Filter Va"
      }
    },
    {
      "id": "a1000000-0000-0000-0000-000000000104",
      "name": "Section -- HubSpot Output",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        710,
        -160
      ],
      "parameters": {
        "width": 730,
        "height": 330,
        "content": "## HubSpot Output\n**Upsert Contact in HubSpot** creates or updates a contact for each result using the email as the unique key. Address, phone, city, state, and zip are all written to standard HubSpot"
      }
    }
  ],
  "connections": {
    "Poll Loop": {
      "main": [
        [
          {
            "node": "Check Scrape Status",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Store Run ID": {
      "main": [
        [
          {
            "node": "Wait Before First Poll",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse CSV Results": {
      "main": [
        [
          {
            "node": "Remove Duplicate Contacts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Retry": {
      "main": [
        [
          {
            "node": "Poll Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map Contact Fields": {
      "main": [
        [
          {
            "node": "Upsert Contact in HubSpot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Scrape Status": {
      "main": [
        [
          {
            "node": "Is Scrape Complete?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Scrape Complete?": {
      "main": [
        [
          {
            "node": "Download Scrape Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Before Retry",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Valid Contacts": {
      "main": [
        [
          {
            "node": "Map Contact Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before First Poll": {
      "main": [
        [
          {
            "node": "Poll Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Scrape Results": {
      "main": [
        [
          {
            "node": "Parse CSV Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicate Contacts": {
      "main": [
        [
          {
            "node": "Filter Valid Contacts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start People Finder Scrape": {
      "main": [
        [
          {
            "node": "Store Run ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure Lookup Parameters": {
      "main": [
        [
          {
            "node": "Start People Finder Scrape",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking 'Execute workflow'": {
      "main": [
        [
          {
            "node": "Configure Lookup Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}