{ "name": "Save PhantomBuster Leads to Airtable", "nodes": [ { "name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [ 270, 300 ], "parameters": {}, "typeVersion": 1, "id": "phantombuster-leads-to-airtable-0" }, { "name": "Phantombuster", "type": "n8n-nodes-base.phantombuster", "position": [ 470, 300 ], "parameters": { "agentId": "YOUR_PHANTOM_ID", "operation": "getOutput", "additionalFields": {}, "resolveData": true }, "typeVersion": 1, "id": "phantombuster-leads-to-airtable-1" }, { "name": "Set", "type": "n8n-nodes-base.set", "position": [ 670, 300 ], "parameters": { "values": { "string": [ { "name": "Name", "value": "={{$node[\"Phantombuster\"].json[\"general\"][\"fullName\"]}}" }, { "name": "Email", "value": "={{$node[\"Phantombuster\"].json[\"details\"][\"mail\"]}}" }, { "name": "Company", "value": "={{$node[\"Phantombuster\"].json[\"jobs\"][0][\"companyName\"]}}" } ] }, "options": {}, "keepOnlySet": true }, "typeVersion": 1, "id": "phantombuster-leads-to-airtable-2" }, { "name": "Airtable", "type": "n8n-nodes-base.airtable", "position": [ 870, 300 ], "parameters": { "table": "Leads", "options": {}, "operation": "append", "application": "YOUR_AIRTABLE_BASE_ID", "addAllFields": true, "authentication": "airtableTokenApi" }, "typeVersion": 1, "id": "phantombuster-leads-to-airtable-3" }, { "id": "phantombuster-leads-to-airtable-4", "name": "Validate lead fields", "type": "n8n-nodes-base.code", "typeVersion": 2, "parameters": { "mode": "runOnceForAllItems", "jsCode": "const items=$input.all();if(items.length===1&&Object.keys(items[0].json).length===0)return [];for(const {json:x} of items)if(typeof x?.general?.fullName!=='string'||!x.general.fullName.trim()||typeof x?.details?.mail!=='string'||!x.details.mail.trim()||typeof x?.jobs?.[0]?.companyName!=='string'||!x.jobs[0].companyName.trim())throw Error('Each result needs general.fullName, details.mail and jobs[0].companyName');return items;" } } ], "active": false, "settings": {}, "connections": { "Set": { "main": [ [ { "node": "Airtable", "type": "main", "index": 0 } ] ] }, "Phantombuster": { "main": [ [ { "node": "Validate lead fields", "type": "main", "index": 0 } ] ] }, "On clicking 'execute'": { "main": [ [ { "node": "Phantombuster", "type": "main", "index": 0 } ] ] }, "Validate lead fields": { "main": [ [ { "node": "Set", "type": "main", "index": 0 } ] ] } }, "pinData": {} }