Phase 3: export working lead-intake workflow; gitignore .secrets
- n8n/lead-intake.json: Webhook → Build lead row (sanitized) → Leads append → Activity Log append. Verified end-to-end. - .gitignore: ensure .secrets/ excluded. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ dist/
|
||||
.env.*
|
||||
*.secret
|
||||
credentials/
|
||||
.secrets/
|
||||
stacks/**/.env
|
||||
|
||||
# n8n local data
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
{
|
||||
"name": "SMB \u00b7 Lead Intake",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {
|
||||
"httpMethod": "POST",
|
||||
"path": "lead-intake",
|
||||
"options": {}
|
||||
},
|
||||
"id": "2e5b1c7a-55b0-43ca-a300-d9f856b4e808",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"typeVersion": 2,
|
||||
"position": [
|
||||
240,
|
||||
304
|
||||
],
|
||||
"webhookId": "ef3cbead-dfbc-494f-8030-c627603bee73"
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"jsCode": "const i=$input.first().json; const b=i.body||i;\nconst now=new Date().toISOString().replace('T',' ').slice(0,16);\nconst s=v=>{v=(v==null?'':String(v)); return /^[=+\\-@\\t\\r]/.test(v)?\"'\"+v:v;};\nreturn [{ json:{ lead_id:'L-'+Date.now(), received_at:now, client_id:s(b.client_id),\n source:s(b.source), name:s(b.name), contact:s(b.contact||b.email||b.phone),\n service_interest:s(b.service_interest||b.service), message:s(b.message), status:'new',\n notified:'FALSE' }}];"
|
||||
},
|
||||
"id": "1d63c005-b837-4d76-8ecb-621fd9f142f9",
|
||||
"name": "Build lead row",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"typeVersion": 2,
|
||||
"position": [
|
||||
464,
|
||||
304
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"authentication": "serviceAccount",
|
||||
"operation": "append",
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"value": "1raMSWRZw_JfHlWqOb3LbhaQ6LWx0VGblxIV4Z2pSzp8",
|
||||
"mode": "id"
|
||||
},
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"value": "571719114",
|
||||
"mode": "list",
|
||||
"cachedResultName": "Leads"
|
||||
},
|
||||
"columns": {
|
||||
"mappingMode": "autoMapInputData",
|
||||
"value": {},
|
||||
"matchingColumns": [],
|
||||
"schema": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"id": "19c6fb29-4dd4-4860-b0e7-0ef370ca6eaa",
|
||||
"name": "Append to Leads",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"typeVersion": 4.5,
|
||||
"position": [
|
||||
688,
|
||||
304
|
||||
],
|
||||
"credentials": {
|
||||
"googleApi": {
|
||||
"id": "45TWPyl1wVk2Vxdm",
|
||||
"name": "SMB Google (service account)"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"jsCode": "const lead=$('Build lead row').first().json;\nconst now=new Date().toISOString().replace('T',' ').slice(0,16);\nreturn [{ json:{ ts:now, workflow:'lead-intake', client_id:lead.client_id||'',\n action:'lead captured', detail:(lead.name||'')+' / '+(lead.contact||''), result:'ok' }}];"
|
||||
},
|
||||
"id": "95572843-5dc4-4839-a7f4-ebeaf19e5fc3",
|
||||
"name": "Build activity",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"typeVersion": 2,
|
||||
"position": [
|
||||
912,
|
||||
304
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"authentication": "serviceAccount",
|
||||
"operation": "append",
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"value": "1raMSWRZw_JfHlWqOb3LbhaQ6LWx0VGblxIV4Z2pSzp8",
|
||||
"mode": "id"
|
||||
},
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"value": "170940481",
|
||||
"mode": "list",
|
||||
"cachedResultName": "Activity Log"
|
||||
},
|
||||
"columns": {
|
||||
"mappingMode": "autoMapInputData",
|
||||
"value": {},
|
||||
"matchingColumns": [],
|
||||
"schema": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"id": "eed090ac-e64a-4369-9122-da535fd1139b",
|
||||
"name": "Append to Activity Log",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"typeVersion": 4.5,
|
||||
"position": [
|
||||
1120,
|
||||
304
|
||||
],
|
||||
"credentials": {
|
||||
"googleApi": {
|
||||
"id": "45TWPyl1wVk2Vxdm",
|
||||
"name": "SMB Google (service account)"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Build lead row",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Build lead row": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Append to Leads",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Append to Leads": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Build activity",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Build activity": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Append to Activity Log",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1",
|
||||
"callerPolicy": "workflowsFromSameOwner",
|
||||
"availableInMCP": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user