n8n: Webhook Data Sync
Receives data via webhook, transforms it, and syncs to an external API endpoint.
Template
{
"name": "Webhook Data Sync",
"nodes": [
{
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [250, 300],
"parameters": {
"httpMethod": "POST",
"path": "data-sync",
"responseMode": "onReceived"
}
},
{
"name": "Transform Data",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [450, 300],
"parameters": {
"jsCode": "const input = items[0].json.body; return [{ json: { name: input.name || '', email: input.email || '', source: 'webhook', synced_at: new Date().toISOString() } }];"
}
},
{
"name": "Validate",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [650, 300],
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.email }}",
"operation": "isNotEmpty"
}
]
}
}
},
{
"name": "Sync to API",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [850, 250],
"parameters": {
"method": "POST",
"url": "https://your-api.example.com/contacts",
"sendBody": true,
"bodyParameters": {
"parameters": [
{ "name": "name", "value": "={{ $json.name }}" },
{ "name": "email", "value": "={{ $json.email }}" },
{ "name": "source", "value": "={{ $json.source }}" }
]
}
}
},
{
"name": "Log Rejected",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [850, 400],
"parameters": {
"jsCode": "console.log('Rejected record: missing email', items[0].json); return items;"
}
}
],
"connections": {
"Webhook": { "main": [[{ "node": "Transform Data" }]] },
"Transform Data": { "main": [[{ "node": "Validate" }]] },
"Validate": { "main": [[{ "node": "Sync to API" }], [{ "node": "Log Rejected" }]] }
},
"active": false,
"settings": {}
}Setup
- 1
Copy the workflow JSON above.
- 2
In n8n, go to Workflows and click Import.
- 3
Paste the JSON and update credential references.
- 4
Activate the workflow.
Import into n8n
This is an n8n workflow. Import it directly into your n8n instance.
- 1
Open your n8n instance (localhost:5678 or your cloud URL).
- 2
Go to Workflows and click the + New button.
- 3
Click the three-dot menu in the top right, then select "Import from JSON".
- 4
Paste the workflow JSON from the template above.
- 5
Update any placeholder values (channel names, webhook URLs, credentials).
- 6
Activate the workflow with the toggle in the top right.
# Alternatively, import via n8n CLI:
n8n import:workflow --input=workflow.jsonVersion History
Framework
N8nRequirements
File type
Version
Updated Mar 16, 2026
You might also like
Client Onboarding
Track new client setup tasks. Send reminders until everything is done.
~$0.20/day · ~10 min setup
Invoice Tracker
Track sent invoices. Alert on overdue payments.
~$0.10/day · ~5 min setup
Lead Qualifier
Score inbound leads from form submissions. Route hot leads immediately.
~$0.30/day · ~10 min setup