{ "name": "Outlevo: New qualified companies to Salesforce, daily", "nodes": [ { "id": "654f8f1a-2dbc-4d7f-8bbd-421b295c88b8", "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- **Salesforce**: connect your Salesforce account.\n\n**API key scopes**: `companies:read`.\n\nThen switch the workflow to **Active**.", "height": 300, "width": 620 } }, { "id": "6034e3de-f3b8-4e68-9bd1-0945e57cf13c", "name": "Every morning", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ], "parameters": { "rule": { "interval": [ { "field": "days", "daysInterval": 1, "triggerAtHour": 7 } ] } } }, { "id": "fe0135e9-ef25-4688-8108-30b2f904d4f6", "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": "7915f90d-dbb8-4c5c-9b65-2fdbdc4ccf06", "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": "ac7dfafe-304a-4ba4-b5e8-386b4515a9bf", "name": "Add the Salesforce account", "type": "n8n-nodes-base.salesforce", "typeVersion": 1, "position": [ 720, 0 ], "parameters": { "authentication": "oAuth2", "resource": "account", "operation": "create", "name": "={{ $json.name }}", "additionalFields": { "website": "={{ $json.website }}", "description": "={{ $json.note }}" } }, "credentials": { "salesforceOAuth2Api": { "id": "", "name": "Salesforce" } } } ], "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 Salesforce account", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }