{
  "name": "New Jersey Business Registry Lookup & Name Checker - clean export",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "daysInterval": 1,
              "triggerAtHour": 8,
              "triggerAtMinute": 0
            }
          ]
        }
      },
      "id": "655b82ae-4c41-4199-a3cd-9eac403ac9c5",
      "name": "Daily trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -80,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// Edit this object for your run. The Actor's full input schema is linked in the sticky note.\nconst input = {\n  \"mode\": \"byKeyword\",\n  \"keywordSearches\": [\n    \"roofing\"\n  ],\n  \"maxItems\": 25\n};\n\nreturn [{ json: input }];"
      },
      "id": "4da545bd-4f62-45fb-a11b-c75372575f61",
      "name": "Configure input",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        160,
        0
      ],
      "notes": "Edit the input object for your city, keyword, URLs or limit."
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/acts/vexaloom-labs~new-jersey-business-registry-lookup-and-name/run-sync-get-dataset-items",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json) }}",
        "options": {
          "timeout": 300000
        }
      },
      "id": "4278c754-0d63-4e98-af2c-1b998e80067e",
      "name": "Run Apify Actor",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        400,
        0
      ],
      "notes": "Select the Apify API Token (Query Auth) credential."
    },
    {
      "parameters": {
        "jsCode": "const rows = $input.all().flatMap((item) => (Array.isArray(item.json) ? item.json : [item.json]));\nconst failed = rows.find((row) => row && row.error && typeof row.error === 'object' && Object.keys(row).length === 1);\nif (failed) throw new Error(`Apify: ${failed.error.type || 'error'} ${failed.error.message || ''}`.trim());\nconst keyField = \"entityId\"; // a stable identity from the Actor output\nconst kindField = rows.some((row) => row && row.recordType !== undefined) ? 'recordType' : null;\nconst scrapedAt = new Date().toISOString();\nconst seen = new Set();\nconst clean = [];\nfor (const row of rows) {\n  if (!row || typeof row !== 'object') continue;\n  const out = {};\n  for (const [k, v] of Object.entries(row)) {\n    if (v === null || v === undefined) continue;\n    out[k] = typeof v === 'string' ? v.trim() : v;\n  }\n  const value = keyField ? out[keyField] : undefined;\n  const id = (kindField ? `${out[kindField]}|` : '') + (value === undefined || value === '' ? JSON.stringify(out) : String(value).toLowerCase());\n  if (seen.has(id)) continue;\n  seen.add(id);\n  out._source = \"https://apify.com/vexaloom-labs/new-jersey-business-registry-lookup-and-name\";\n  out._scrapedAt = scrapedAt;\n  clean.push(out);\n}\nreturn clean.map((json) => ({ json }));"
      },
      "id": "7131b6e1-1bc9-49d0-a6bf-d7849ae1f2b0",
      "name": "Normalize + dedupe",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        640,
        0
      ]
    },
    {
      "parameters": {},
      "id": "fa4fead7-4d0a-4623-a354-c530a61fe023",
      "name": "Rows ready",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        880,
        0
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_SHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Rows",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {}
        },
        "options": {}
      },
      "id": "a6f019e3-d6fa-4753-a776-607f9ee3a961",
      "name": "Google Sheets (optional)",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1120,
        0
      ],
      "disabled": true,
      "notes": "Enable this after adding your Google Sheets credential and sheet ID."
    },
    {
      "parameters": {
        "content": "## New Jersey Business Registry Lookup & Name Checker\n\n**Actor:** [New Jersey Business Registry Lookup & Name Checker](https://apify.com/vexaloom-labs/new-jersey-business-registry-lookup-and-name)\n\n**Docs:** https://scraperfinder.com/n8n/new-jersey-business-registry-lookup-and-name-checker/\n\n### Setup\n1. Create an Apify account and copy an API token.\n2. In n8n, create a **Query Auth** credential:\n   - Name: `Apify API Token`\n   - Query parameter name: `token`\n   - Value: your Apify token\n3. Open **Run Apify Actor** and select that credential.\n4. Click **Execute workflow**. The rows appear in **Rows ready**.\n5. Optional: enable **Google Sheets** and set your document and sheet.\n\n### Notes\n- This calls the public Actor endpoint. No API token is stored in this file.\n- `run-sync-get-dataset-items` waits up to 300 seconds. For large runs, switch to the async run + dataset endpoint.\n- Public data only. Respect the target site's terms and local law.\n\n### Input fields\n- `mode` (string, required)\n- `businessNames` (array)\n- `keywordSearches` (array)\n- `entityIds` (array)\n- `linkType` (string)\n- `linkedName` (string)\n- `linkedFirstName` (string)\n- `linkedMiddleName` (string)\n- `linkedCity` (string)\n- `entityTypes` (array)\n- `cityFilter` (string)\n- `maxItems` (integer)\n\n### Output fields\n- `businessName` (Business Name)\n- `entityId` (Entity Id)\n- `entityTypeAbbr` (Entity Type Abbr)\n- `entityTypeFull` (Entity Type Full)\n- `city` (City)\n- `incorporatedDate` (Incorporated Date)\n- `incorporatedMonth` (Incorporated Month)\n- `isAvailable` (Is Available)\n- `documentCount` (Document Count)",
        "height": 640,
        "width": 560,
        "color": 4
      },
      "id": "293bd888-9717-46eb-a545-4b9a50e90b29",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -80,
        -700
      ]
    }
  ],
  "connections": {
    "Daily trigger": {
      "main": [
        [
          {
            "node": "Configure input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure input": {
      "main": [
        [
          {
            "node": "Run Apify Actor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Apify Actor": {
      "main": [
        [
          {
            "node": "Normalize + dedupe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize + dedupe": {
      "main": [
        [
          {
            "node": "Rows ready",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rows ready": {
      "main": [
        [
          {
            "node": "Google Sheets (optional)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": [],
  "versionId": "f4a0e1a1-f117-41db-af7b-c5eee644abfb",
  "description": "New Jersey business entity search: runs the New Jersey Business Registry Lookup & Name Checker Apify Actor, returns businessName, entityTypeAbbr, entityTypeFull, city, incorporatedDate and more, then normalizes and dedupes the rows before an optional Google Sheets append."
}
