{ "name": "Outlevo: New qualified companies to Google Sheets, daily", "nodes": [ { "id": "efc71dec-884e-44b2-9a03-bc13f3367ddc", "name": "How to set it up", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -40, -386 ], "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- **Google Sheets**: connect your Google Sheets account.\n\n**API key scopes**: `companies:read`.\n\n**Replace**: `YOUR_SHEET_ID`.\n\n**Columns in the \"Qualified\" sheet** (first row): `Company`, `Domain`, `Country`, `Account`.\n\nThen switch the workflow to **Active**.", "height": 326, "width": 620 } }, { "id": "7be7d3c3-e0fc-45b1-8ffb-2b52aa535856", "name": "Every morning", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ], "parameters": { "rule": { "interval": [ { "field": "days", "daysInterval": 1, "triggerAtHour": 7 } ] } } }, { "id": "e68bdf34-5212-47ea-92dd-8674007927c1", "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": "ed25b430-5b1e-4cb8-a5a2-9472cf5dcedd", "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": "864e4858-6df7-4f51-aa1b-427fbed26382", "name": "Write the row", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 720, 0 ], "parameters": { "mode": "runOnceForEachItem", "jsCode": "return { json: { Company: $json.name, Domain: $json.domain, Country: $json.country, Account: `https://app.outlevo.com/accounts/${$json.id}` } };\n" } }, { "id": "9ad43b70-6fe5-4ff8-ab15-8791647760dc", "name": "Add to the sheet", "type": "n8n-nodes-base.googleSheets", "typeVersion": 4.5, "position": [ 960, 0 ], "parameters": { "operation": "append", "documentId": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit" }, "sheetName": { "__rl": true, "mode": "name", "value": "Qualified" }, "columns": { "mappingMode": "autoMapInputData", "value": {}, "matchingColumns": [], "schema": [] }, "options": {} }, "credentials": { "googleSheetsOAuth2Api": { "id": "", "name": "Google Sheets" } } } ], "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": "Write the row", "type": "main", "index": 0 } ] ] }, "Write the row": { "main": [ [ { "node": "Add to the sheet", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }