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 →
{
"name": "VenueDesk \u2014 API: Update Lead Status",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "leads-update",
"authentication": "none",
"responseMode": "responseNode",
"options": {}
},
"id": "wh-leads-upd-01",
"name": "Webhook: Update Lead Status",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
-560,
200
],
"credentials": {}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true
},
"conditions": [
{
"id": "cond-hot-prospect",
"leftValue": "={{ $json.body.status }}",
"rightValue": "hot_prospect",
"operator": {
"type": "string",
"operation": "equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "if-hot-prospect-01",
"name": "IF: Is Hot Prospect",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
-320,
200
]
},
{
"parameters": {
"operation": "executeQuery",
"query": "CREATE TABLE IF NOT EXISTS prospects (\n id SERIAL PRIMARY KEY,\n lead_id UUID UNIQUE NOT NULL,\n venue_name TEXT,\n contact_name TEXT,\n email TEXT,\n phone TEXT,\n website_url TEXT,\n ai_score INTEGER,\n status TEXT NOT NULL DEFAULT 'ready_for_onboarding',\n created_at TIMESTAMPTZ DEFAULT NOW()\n);\nALTER TABLE prospects ADD COLUMN IF NOT EXISTS contact_name TEXT;\nALTER TABLE prospects ADD COLUMN IF NOT EXISTS status TEXT NOT NULL DEFAULT 'ready_for_onboarding';",
"options": {}
},
"id": "db-ensure-prospects-01",
"name": "DB: Ensure Prospects Table",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.6,
"position": [
-80,
0
],
"continueOnFail": true,
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "executeQuery",
"query": "INSERT INTO prospects (lead_id, venue_name, contact_name, email, phone, website_url, ai_score, status)\nSELECT id, venue_name, contact_name, email, phone, website_url, ai_score, 'ready_for_onboarding'\nFROM leads\nWHERE id = $1::uuid\nON CONFLICT (lead_id) DO NOTHING;",
"options": {
"queryReplacement": "={{ [$('Webhook: Update Lead Status').first().json.body.id] }}"
}
},
"id": "db-insert-prospect-01",
"name": "DB: Insert Prospect",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.6,
"position": [
160,
0
],
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "executeQuery",
"query": "UPDATE leads\nSET status = $2\nWHERE id = $1::uuid\nRETURNING id, status;",
"options": {
"queryReplacement": "={{ [\n $('Webhook: Update Lead Status').first().json.body.id,\n $('Webhook: Update Lead Status').first().json.body.status || 'new'\n] }}"
}
},
"id": "db-leads-upd-01",
"name": "DB: Update Status",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.6,
"position": [
400,
200
],
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ JSON.stringify({ success: true, id: $json.id, status: $json.status }) }}",
"options": {
"responseHeaders": {
"entries": [
{
"name": "Access-Control-Allow-Origin",
"value": "*"
}
]
}
}
},
"id": "re-leads-upd-01",
"name": "Respond: OK",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
640,
200
]
}
],
"connections": {
"Webhook: Update Lead Status": {
"main": [
[
{
"node": "IF: Is Hot Prospect",
"type": "main",
"index": 0
}
]
]
},
"IF: Is Hot Prospect": {
"main": [
[
{
"node": "DB: Ensure Prospects Table",
"type": "main",
"index": 0
}
],
[
{
"node": "DB: Update Status",
"type": "main",
"index": 0
}
]
]
},
"DB: Ensure Prospects Table": {
"main": [
[
{
"node": "DB: Insert Prospect",
"type": "main",
"index": 0
}
]
]
},
"DB: Insert Prospect": {
"main": [
[
{
"node": "DB: Update Status",
"type": "main",
"index": 0
}
]
]
},
"DB: Update Status": {
"main": [
[
{
"node": "Respond: OK",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1",
"availableInMCP": false
},
"versionId": "1ead-5tat-0003-0000-000000000003",
"id": "LeadsUpdateWF01",
"tags": []
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
postgres
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
VenueDesk — API: Update Lead Status. Uses postgres. Webhook trigger; 6 nodes.
Source: https://github.com/AndyJay72/VenueDesk/blob/main/n8n-workflows/LeadsUpdateWF.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.
Vendor Lead - Log WhatsApp Click. Uses postgres, whatsApp. Webhook trigger; 3 nodes.
VenueDesk — API: Edit Lead. Uses postgres. Webhook trigger; 3 nodes.
This workflow automates bulk email campaigns with built-in validation, deliverability protection, and smart send-time optimization.
get-data-for-marketting-dashboard. Uses postgres, googleAnalytics, httpRequest. Webhook trigger; 20 nodes.
Enrich person L3. Uses executeWorkflowTrigger, postgres, perplexity, httpRequest. Webhook trigger; 12 nodes.