n8n
Add human review to your n8n workflows.
n8n is a workflow automation platform. This guide shows how to add human-in-the-loop review to your automated workflows using Datashift's REST API and webhooks.
What you'll build
A workflow that processes incoming leads, with human review before adding them to your CRM.
Prerequisites
- •A Datashift account with an API key (Settings → Credentials)
- •n8n instance (cloud or self-hosted)
- •A review queue created in Datashift
Architecture
The integration uses two n8n workflows:
1. Submit Workflow
Receives data, submits to Datashift for review, then pauses.
2. Webhook Workflow
Receives the review result from Datashift and continues processing.
Step 1: Create Webhook Workflow
First, create a workflow in n8n that will receive the review result:
Add a Webhook node
Set method to POST and copy the webhook URL
Add an IF node
Check if body.data.reviews[0].result contains "approved"
Add your action nodes
Connect approved path to your CRM node, rejected path to notification
Step 2: Register Webhook in Datashift
Go to Settings → Webhooks in Datashift:
Copy the signing secret — you'll use it to verify webhooks.
Step 3: Create Submit Workflow
Create a second workflow that submits tasks for review:
HTTP Request Node Configuration
Headers
{
"Authorization": "Bearer {{ $credentials.datashiftApiKey }}",
"Content-Type": "application/json"
}Body (JSON)
{
"queue_key": "lead-review",
"data": {
"lead_id": "{{ $json.id }}",
"company": "{{ $json.company }}",
"email": "{{ $json.email }}",
"source": "{{ $json.source }}"
},
"metadata": {
"n8n_execution_id": "{{ $execution.id }}"
},
"summary": "Review new lead: {{ $json.company }}"
}Complete Example
Here's how the complete flow looks:
Submit Workflow
Webhook Workflow
Verifying Webhooks (Optional)
For production, add a Code node to verify the webhook signature:
const crypto = require('crypto');
const signature = $input.first().headers['x-datashift-signature'];
const timestamp = $input.first().headers['x-datashift-timestamp'];
const body = JSON.stringify($input.first().body);
const payload = `${timestamp}.${body}`;
const expected = 'sha256=' + crypto
.createHmac('sha256', $credentials.webhookSecret)
.update(payload)
.digest('hex');
if (signature !== expected) {
throw new Error('Invalid webhook signature');
}
return $input.all();Tips
Store execution context
Include the n8n execution ID in metadata so you can correlate webhook responses with the original trigger.
Use credential nodes
Store your Datashift API key and webhook secret as n8n credentials, not hardcoded in nodes.
Handle timeouts
Reviews may take time. The webhook pattern is preferred over waiting, but you can also use the Wait node with a timeout.
Test with manual executions
Use n8n's test webhook feature to simulate Datashift callbacks during development.