{ "name": "Outlevo: New qualified companies to Pipedrive, daily", "nodes": [ { "id": "28add722-294e-4406-a152-2cf4d698f1df", "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- **Pipedrive**: connect your Pipedrive account.\n\n**API key scopes**: `companies:read`.\n\nThen switch the workflow to **Active**.", "height": 300, "width": 620 } }, { "id": "504a3fe6-aabd-4d57-8e9c-be90c65f5eaf", "name": "Every morning", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ], "parameters": { "rule": { "interval": [ { "field": "days", "daysInterval": 1, "triggerAtHour": 7 } ] } } }, { "id": "d75da70d-3d38-4fc5-9fd3-9999bc613644", "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": "f2c9f9fd-562c-455f-aec3-501a83bb5f09", "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": "31016e0a-148a-4d43-a71c-c96bbd58c593", "name": "Add the organization", "type": "n8n-nodes-base.pipedrive", "typeVersion": 1, "position": [ 720, 0 ], "parameters": { "resource": "organization", "operation": "create", "name": "={{ $('Only new ones').item.json.name }}", "additionalFields": {} }, "credentials": { "pipedriveApi": { "id": "", "name": "Pipedrive" } } }, { "id": "43c17a0f-5b61-490b-9cae-1b48e4dd7a3a", "name": "Add the note", "type": "n8n-nodes-base.pipedrive", "typeVersion": 1, "position": [ 960, 0 ], "parameters": { "resource": "note", "operation": "create", "content": "={{ $('Only new ones').item.json.note }}", "additionalFields": { "org_id": "={{ $json.id }}" } }, "credentials": { "pipedriveApi": { "id": "", "name": "Pipedrive" } } } ], "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 organization", "type": "main", "index": 0 } ] ] }, "Add the organization": { "main": [ [ { "node": "Add the note", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }