The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"updatedAt": "2026-03-15T20:38:39.206Z",
"createdAt": "2026-02-26T15:06:57.393Z",
"id": "kB5xoIh4gcaRsCpW",
"name": "Create Customer (Upsert)",
"description": null,
"active": true,
"isArchived": false,
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "create-customer",
"authentication": "none",
"responseMode": "responseNode",
"options": {}
},
"id": "14cad524-9e15-4c9b-a110-e6159e31e2ec",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
240,
300
],
"credentials": {}
},
{
"parameters": {
"jsCode": "const body = $input.first().json.body || $input.first().json;\n\nconst name = (body.customer_name || body.name || '').trim();\nconst email = (body.customer_email || body.email || '').trim().toLowerCase();\nconst phone = (body.customer_phone || body.phone || body.contact || '').trim();\n\nif (!name) throw new Error('customer_name is required');\nif (!email && !phone) throw new Error('At least one of customer_email or customer_phone is required');\n\nreturn [{ json: { name, email, phone } }];\n"
},
"id": "0175b5b9-6622-44ed-8750-7c75b3453ea3",
"name": "Validate Input",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
480,
300
]
},
{
"parameters": {
"method": "GET",
"url": "https://n8n.srv1090894.hstgr.cloud/webhook/all-customers",
"options": {
"response": {
"response": {
"responseFormat": "autodetect"
}
}
}
},
"id": "16b46ec3-122a-44a1-a696-908d8be21e6c",
"name": "Fetch All Customers",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
720,
300
]
},
{
"parameters": {
"jsCode": "const validated = $('Validate Input').first().json;\nconst name = validated.name;\nconst email = validated.email;\nconst phone = validated.phone;\n\nconst custJson = $input.first().json;\nconst customers = custJson.data || (Array.isArray(custJson) ? custJson : []);\n\n// Strip non-digits for phone comparison\nconst digitsOnly = s => (s || '').replace(/\\D/g, '');\nconst phoneDigits = digitsOnly(phone);\n\nconst match = customers.find(c =>\n (email && c.email && c.email.toLowerCase() === email) ||\n (phoneDigits.length >= 7 && digitsOnly(c.phone) === phoneDigits)\n);\n\nif (match) {\n return [{ json: {\n customer_id: match.customer_id || match.id,\n customer_name: match.full_name || match.name || name,\n customer_email: match.email || email,\n customer_phone: match.phone || phone,\n is_new: false\n }}];\n}\n\n// No match \u2014 flag for creation\nreturn [{ json: { customer_id: null, customer_name: name, customer_email: email, customer_phone: phone, is_new: true } }];\n"
},
"id": "ef42acc1-6e7b-4dc9-bd80-e45464ad2d95",
"name": "Find Existing Customer",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
960,
300
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": false
},
"conditions": [
{
"id": "is-new",
"leftValue": "={{ $json.is_new }}",
"rightValue": true,
"operator": {
"type": "boolean",
"operation": "equals"
}
}
],
"combinator": "and"
}
},
"id": "47bd5052-ee46-4764-9486-65289f882f43",
"name": "Is New Customer?",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
1200,
300
]
},
{
"parameters": {
"method": "POST",
"url": "https://n8n.srv1090894.hstgr.cloud/webhook/create-customer-record",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ { full_name: $json.customer_name, email: $json.customer_email, phone: $json.customer_phone } }}",
"options": {
"response": {
"response": {
"responseFormat": "autodetect"
}
}
}
},
"id": "07fd6a47-2fa1-4237-a223-93ee666e7dc8",
"name": "Create New Customer Record",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
1440,
160
]
},
{
"parameters": {
"jsCode": "// After creation \u2014 extract the new customer_id from the DB response\nconst resp = $input.first().json;\nconst newId = resp.customer_id || resp.id || resp.data?.customer_id || resp.data?.id || '';\nconst prev = $('Find Existing Customer').first().json;\nreturn [{ json: {\n customer_id: newId,\n customer_name: prev.customer_name,\n customer_email: prev.customer_email,\n customer_phone: prev.customer_phone,\n is_new: true\n}}];\n"
},
"id": "6e82d6f4-b540-429b-b5d6-53a57f8248c4",
"name": "Extract New Customer ID",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1680,
160
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ JSON.stringify({ success: true, customer_id: $json.customer_id, customer_name: $json.customer_name, customer_email: $json.customer_email, is_new: $json.is_new }) }}",
"options": {
"responseCode": 200
}
},
"id": "f2bd8d7a-803b-45af-b073-2d075f3d72d3",
"name": "Respond",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
1680,
160
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ JSON.stringify({ success: true, customer_id: $json.customer_id, customer_name: $json.customer_name, customer_email: $json.customer_email, is_new: $json.is_new }) }}",
"options": {
"responseCode": 200
}
},
"id": "2e01b402-66bf-4a98-9053-eedc5f16084f",
"name": "Respond Existing",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
1680,
420
]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Validate Input",
"type": "main",
"index": 0
}
]
]
},
"Validate Input": {
"main": [
[
{
"node": "Fetch All Customers",
"type": "main",
"index": 0
}
]
]
},
"Fetch All Customers": {
"main": [
[
{
"node": "Find Existing Customer",
"type": "main",
"index": 0
}
]
]
},
"Find Existing Customer": {
"main": [
[
{
"node": "Is New Customer?",
"type": "main",
"index": 0
}
]
]
},
"Is New Customer?": {
"main": [
[
{
"node": "Create New Customer Record",
"type": "main",
"index": 0
}
],
[
{
"node": "Respond Existing",
"type": "main",
"index": 0
}
]
]
},
"Create New Customer Record": {
"main": [
[
{
"node": "Extract New Customer ID",
"type": "main",
"index": 0
}
]
]
},
"Extract New Customer ID": {
"main": [
[
{
"node": "Respond",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1",
"binaryMode": "separate",
"availableInMCP": true,
"saveManualExecutions": true,
"callerPolicy": "workflowsFromSameOwner",
"errorWorkflow": ""
},
"staticData": null,
"meta": null,
"versionId": "46874f31-9c3b-4fd3-a653-edbcdd37af39",
"activeVersionId": "46874f31-9c3b-4fd3-a653-edbcdd37af39",
"versionCounter": 40,
"triggerCount": 1,
"shared": [
{
"updatedAt": "2026-02-26T15:06:57.393Z",
"createdAt": "2026-02-26T15:06:57.393Z",
"role": "workflow:owner",
"workflowId": "kB5xoIh4gcaRsCpW",
"projectId": "xsdyFVsct988qLUy",
"project": {
"updatedAt": "2025-12-04T20:24:17.537Z",
"createdAt": "2025-12-04T19:47:48.685Z",
"id": "xsdyFVsct988qLUy",
"name": "andrew johnson <andrew.ralston.johnson@gmail.com>",
"type": "personal",
"icon": null,
"description": null,
"creatorId": "e2485274-7097-4eb5-8502-e39b2308096c"
}
}
],
"tags": [],
"activeVersion": {
"updatedAt": "2026-03-10T20:55:11.133Z",
"createdAt": "2026-03-10T20:55:11.133Z",
"versionId": "46874f31-9c3b-4fd3-a653-edbcdd37af39",
"workflowId": "kB5xoIh4gcaRsCpW",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "create-customer",
"authentication": "none",
"responseMode": "responseNode",
"options": {}
},
"id": "14cad524-9e15-4c9b-a110-e6159e31e2ec",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
240,
300
],
"webhookId": "create-customer-webhook",
"credentials": {}
},
{
"parameters": {
"jsCode": "const body = $input.first().json.body || $input.first().json;\n\nconst name = (body.customer_name || body.name || '').trim();\nconst email = (body.customer_email || body.email || '').trim().toLowerCase();\nconst phone = (body.customer_phone || body.phone || body.contact || '').trim();\n\nif (!name) throw new Error('customer_name is required');\nif (!email && !phone) throw new Error('At least one of customer_email or customer_phone is required');\n\nreturn [{ json: { name, email, phone } }];\n"
},
"id": "0175b5b9-6622-44ed-8750-7c75b3453ea3",
"name": "Validate Input",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
480,
300
]
},
{
"parameters": {
"method": "GET",
"url": "https://n8n.srv1090894.hstgr.cloud/webhook/all-customers",
"options": {
"response": {
"response": {
"responseFormat": "autodetect"
}
}
}
},
"id": "16b46ec3-122a-44a1-a696-908d8be21e6c",
"name": "Fetch All Customers",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
720,
300
]
},
{
"parameters": {
"jsCode": "const validated = $('Validate Input').first().json;\nconst name = validated.name;\nconst email = validated.email;\nconst phone = validated.phone;\n\nconst custJson = $input.first().json;\nconst customers = custJson.data || (Array.isArray(custJson) ? custJson : []);\n\n// Strip non-digits for phone comparison\nconst digitsOnly = s => (s || '').replace(/\\D/g, '');\nconst phoneDigits = digitsOnly(phone);\n\nconst match = customers.find(c =>\n (email && c.email && c.email.toLowerCase() === email) ||\n (phoneDigits.length >= 7 && digitsOnly(c.phone) === phoneDigits)\n);\n\nif (match) {\n return [{ json: {\n customer_id: match.customer_id || match.id,\n customer_name: match.full_name || match.name || name,\n customer_email: match.email || email,\n customer_phone: match.phone || phone,\n is_new: false\n }}];\n}\n\n// No match \u2014 flag for creation\nreturn [{ json: { customer_id: null, customer_name: name, customer_email: email, customer_phone: phone, is_new: true } }];\n"
},
"id": "ef42acc1-6e7b-4dc9-bd80-e45464ad2d95",
"name": "Find Existing Customer",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
960,
300
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": false
},
"conditions": [
{
"id": "is-new",
"leftValue": "={{ $json.is_new }}",
"rightValue": true,
"operator": {
"type": "boolean",
"operation": "equals"
}
}
],
"combinator": "and"
}
},
"id": "47bd5052-ee46-4764-9486-65289f882f43",
"name": "Is New Customer?",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
1200,
300
]
},
{
"parameters": {
"method": "POST",
"url": "https://n8n.srv1090894.hstgr.cloud/webhook/create-customer-record",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ { full_name: $json.customer_name, email: $json.customer_email, phone: $json.customer_phone } }}",
"options": {
"response": {
"response": {
"responseFormat": "autodetect"
}
}
}
},
"id": "07fd6a47-2fa1-4237-a223-93ee666e7dc8",
"name": "Create New Customer Record",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
1440,
160
]
},
{
"parameters": {
"jsCode": "// After creation \u2014 extract the new customer_id from the DB response\nconst resp = $input.first().json;\nconst newId = resp.customer_id || resp.id || resp.data?.customer_id || resp.data?.id || '';\nconst prev = $('Find Existing Customer').first().json;\nreturn [{ json: {\n customer_id: newId,\n customer_name: prev.customer_name,\n customer_email: prev.customer_email,\n customer_phone: prev.customer_phone,\n is_new: true\n}}];\n"
},
"id": "6e82d6f4-b540-429b-b5d6-53a57f8248c4",
"name": "Extract New Customer ID",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1680,
160
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ JSON.stringify({ success: true, customer_id: $json.customer_id, customer_name: $json.customer_name, customer_email: $json.customer_email, is_new: $json.is_new }) }}",
"options": {
"responseCode": 200
}
},
"id": "f2bd8d7a-803b-45af-b073-2d075f3d72d3",
"name": "Respond",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
1680,
160
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ JSON.stringify({ success: true, customer_id: $json.customer_id, customer_name: $json.customer_name, customer_email: $json.customer_email, is_new: $json.is_new }) }}",
"options": {
"responseCode": 200
}
},
"id": "2e01b402-66bf-4a98-9053-eedc5f16084f",
"name": "Respond Existing",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
1680,
420
]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Validate Input",
"type": "main",
"index": 0
}
]
]
},
"Validate Input": {
"main": [
[
{
"node": "Fetch All Customers",
"type": "main",
"index": 0
}
]
]
},
"Fetch All Customers": {
"main": [
[
{
"node": "Find Existing Customer",
"type": "main",
"index": 0
}
]
]
},
"Find Existing Customer": {
"main": [
[
{
"node": "Is New Customer?",
"type": "main",
"index": 0
}
]
]
},
"Is New Customer?": {
"main": [
[
{
"node": "Create New Customer Record",
"type": "main",
"index": 0
}
],
[
{
"node": "Respond Existing",
"type": "main",
"index": 0
}
]
]
},
"Create New Customer Record": {
"main": [
[
{
"node": "Extract New Customer ID",
"type": "main",
"index": 0
}
]
]
},
"Extract New Customer ID": {
"main": [
[
{
"node": "Respond",
"type": "main",
"index": 0
}
]
]
}
},
"authors": "andrew johnson",
"name": null,
"description": null,
"autosaved": false,
"workflowPublishHistory": [
{
"createdAt": "2026-03-15T20:38:39.240Z",
"id": 1365,
"workflowId": "kB5xoIh4gcaRsCpW",
"versionId": "46874f31-9c3b-4fd3-a653-edbcdd37af39",
"event": "deactivated",
"userId": "e2485274-7097-4eb5-8502-e39b2308096c"
},
{
"createdAt": "2026-03-15T20:38:39.249Z",
"id": 1366,
"workflowId": "kB5xoIh4gcaRsCpW",
"versionId": "46874f31-9c3b-4fd3-a653-edbcdd37af39",
"event": "activated",
"userId": "e2485274-7097-4eb5-8502-e39b2308096c"
},
{
"createdAt": "2026-03-10T20:55:11.158Z",
"id": 959,
"workflowId": "kB5xoIh4gcaRsCpW",
"versionId": "46874f31-9c3b-4fd3-a653-edbcdd37af39",
"event": "deactivated",
"userId": "e2485274-7097-4eb5-8502-e39b2308096c"
},
{
"createdAt": "2026-03-10T20:55:11.169Z",
"id": 960,
"workflowId": "kB5xoIh4gcaRsCpW",
"versionId": "46874f31-9c3b-4fd3-a653-edbcdd37af39",
"event": "activated",
"userId": "e2485274-7097-4eb5-8502-e39b2308096c"
}
]
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Create Customer (Upsert). Uses httpRequest. Webhook trigger; 9 nodes.
Source: https://github.com/AndyJay72/VenueDesk/blob/2b877fc3d0dba284a404cc64fcc153b92c612ae3/n8n-workflows/kB5xoIh4gcaRsCpW.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This n8n template provides enterprise-level version control for your workflows using GitHub integration. Stop losing hours to broken workflows and manual exports – get proper commit history, visual di
This flow creates dummy files for every item added in your *Arrs (Radarr/Sonarr) with the tag .
eek-Go v2 (Batch-Then-Review). Uses httpRequest. Webhook trigger; 75 nodes.
This workflow receives webhook requests from a content calendar and uses the X API v2 to publish text posts, threads, image/video posts, and polls, as well as delete existing posts and run a credentia
This workflow acts as a central API gateway for all technical indicator agents in the Binance Spot Market Quant AI system. It listens for incoming webhook requests and dynamically routes them to the c