{ "name": "Outlevo: New qualified companies to HubSpot, daily", "nodes": [ { "id": "fcacfbe4-4b04-4ac9-aa93-9007f3cbdb9a", "name": "How to set it up", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -40, -360 ], "parameters": { "content": "## How to set it up\n\n**Credentials** (n8n asks for each on first open):\n- **Outlevo API key**: a Header Auth credential, name `Authorization`, value `Bearer olv_live_…` (Settings → API keys in Outlevo).\n- **HubSpot private app**: connect your HubSpot private app account.\n\n**API key scopes**: `companies:read`.\n\nThen switch the workflow to **Active**.", "height": 300, "width": 620 } }, { "id": "fdf618c3-6dc0-4428-9cb1-4e2fc9bf9691", "name": "Every morning", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ], "parameters": { "rule": { "interval": [ { "field": "days", "daysInterval": 1, "triggerAtHour": 7 } ] } } }, { "id": "f6c41008-3592-4ed3-b3f8-c1eb1b79f2ae", "name": "Qualified since yesterday", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 240, 0 ], "parameters": { "method": "GET", "url": "=https://api.outlevo.com/v1/companies", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "status", "value": "qualified" }, { "name": "updated_since", "value": "={{ $now.minus({ days: 1 }).toUTC().toISO() }}" }, { "name": "limit", "value": "1000" } ] }, "options": {} }, "credentials": { "httpHeaderAuth": { "id": "", "name": "Outlevo API key (Authorization: Bearer olv_live_…)" } } }, { "id": "18cb7a6d-c9dd-43b4-ab11-b63d8dacf2c9", "name": "Only new ones", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 480, 0 ], "parameters": { "mode": "runOnceForAllItems", "jsCode": "// Companies seen in earlier runs are skipped (remembered for 90 days in this workflow's static data).\nconst seen = $getWorkflowStaticData('global');\nseen.ids = seen.ids || {};\nconst now = Date.now();\nfor (const [id, at] of Object.entries(seen.ids)) if (now - at > 90 * 864e5) delete seen.ids[id];\nconst fresh = ($input.first().json.data || []).filter((co) => !seen.ids[co.id]);\nfor (const co of fresh) seen.ids[co.id] = now;\nreturn fresh.map((co) => ({ json: { id: co.id, name: co.name || co.domain, domain: co.domain, website: co.website_url || `https://${co.domain}`, country: co.country || '', note: `Qualified by Outlevo.\\nhttps://app.outlevo.com/accounts/${co.id}` } }));\n" } }, { "id": "6b19373d-f032-4c9e-a7fd-50c3b07ea02d", "name": "Add the HubSpot company", "type": "n8n-nodes-base.hubspot", "typeVersion": 2.1, "position": [ 720, 0 ], "parameters": { "authentication": "appToken", "resource": "company", "operation": "create", "name": "={{ $json.name }}", "additionalFields": { "companyDomainName": "={{ $json.domain }}", "websiteUrl": "={{ $json.website }}", "description": "={{ $json.note }}" } }, "credentials": { "hubspotAppToken": { "id": "", "name": "HubSpot private app" } } } ], "connections": { "Every morning": { "main": [ [ { "node": "Qualified since yesterday", "type": "main", "index": 0 } ] ] }, "Qualified since yesterday": { "main": [ [ { "node": "Only new ones", "type": "main", "index": 0 } ] ] }, "Only new ones": { "main": [ [ { "node": "Add the HubSpot company", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }