{ "name": "Outlevo: new Google Sheet row → company in Accounts", "nodes": [ { "id": "7a2d3b20-0001-4d4f-8b62-000000000001", "name": "New row in the sheet", "type": "n8n-nodes-base.googleSheetsTrigger", "typeVersion": 1, "position": [0, 0], "parameters": { "pollTimes": { "item": [{ "mode": "everyMinute" }] }, "documentId": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit" }, "sheetName": { "__rl": true, "mode": "name", "value": "Accounts" }, "event": "rowAdded", "options": {} }, "credentials": { "googleSheetsTriggerOAuth2Api": { "id": "", "name": "Google Sheets" } } }, { "id": "7a2d3b20-0002-4d4f-8b62-000000000002", "name": "Add to Outlevo", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [240, 0], "parameters": { "method": "POST", "url": "https://api.outlevo.com/v1/companies", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendHeaders": true, "headerParameters": { "parameters": [{ "name": "Idempotency-Key", "value": "=sheet-{{ $json.row_number }}-{{ $json.Website }}" }] }, "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ domain: $json.Website, name: $json.Company || undefined, external_id: $json.ID ? String($json.ID) : undefined }) }}", "options": { "response": { "response": { "neverError": true, "fullResponse": true } } } }, "credentials": { "httpHeaderAuth": { "id": "", "name": "Outlevo API key (Authorization: Bearer olv_live_…)" } } }, { "id": "7a2d3b20-0003-4d4f-8b62-000000000003", "name": "Added or already there?", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [480, 0], "parameters": { "mode": "runOnceForEachItem", "jsCode": "// 201: added. 409 COMPANY_EXISTS: it was already in Accounts (www., subdomains and known aliases count as the same company); details.company_id is that account.\nconst r = $json;\nconst body = r.body || {};\nif (r.statusCode === 201) return { json: { status: 'added', company_id: body.id, domain: body.domain } };\nif (r.statusCode === 409 && body.error && body.error.code === 'COMPANY_EXISTS') return { json: { status: 'already_in_accounts', company_id: body.error.details.company_id } };\nthrow new Error(`Outlevo said ${r.statusCode}: ${body.error ? body.error.message : 'no body'}`);" } } ], "connections": { "New row in the sheet": { "main": [[{ "node": "Add to Outlevo", "type": "main", "index": 0 }]] }, "Add to Outlevo": { "main": [[{ "node": "Added or already there?", "type": "main", "index": 0 }]] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "active": false, "meta": { "templateCredsSetupCompleted": false }, "tags": [] }