N8N Webhook Integration β
v1.6.0+Automate your workflows by connecting WhatsMarkSaaS with N8N. Track changes to contacts, sources, and statuses in real-time and trigger automated actions across your business tools.
Overview β
The Webhook Integration feature sends real-time notifications to N8N whenever important events occur in your WhatsMarkSaaS tenant. This enables you to:
- π Sync contacts to Google Sheets, CRMs, or databases
- π§ Send notifications via Slack, email, or SMS
- π€ Trigger workflows based on status changes
- π Update analytics dashboards in real-time
- π Connect with 400+ apps supported by N8N
Version Requirement
N8N integration support was introduced in version 1.6.0. The webhook payload format is now fully optimized for N8N workflows.
Supported Events β
WhatsMarkSaaS can send webhooks for the following resources:
| Resource | Events | Description |
|---|---|---|
| Contacts | created, updated, deleted | Customer and lead records |
| Sources | created, updated, deleted | Lead source tracking |
| Statuses | created, updated, deleted | Contact status tracking |
Quick Start β
Step 1: Enable Webhooks in WhatsMarkSaaS β
- Log into your tenant account
- Navigate to Settings β System Settings β Webhook Management
- Toggle Enable Webhooks to ON
- Select the events you want to track:
- β Contact Actions (create, update, delete)
- β Source Actions (create, update, delete)
- β Status Actions (create, update, delete)
Save Your Settings
Don't forget to click Save after configuring your webhook events.
Step 2: Create Webhook in N8N β
- Open your N8N workflow editor
- Add a Webhook node to your workflow
- Configure the node:
- HTTP Method:
POST - Path: Choose a unique path (e.g.,
/whatsmark-webhooks) - Authentication: None (or configure as needed)
- HTTP Method:
- Copy the generated webhook URL
N8N Setup
You can find the Webhook node in the Core Nodes section of N8N. The webhook URL will be automatically generated once you save the workflow.
Step 3: Configure Webhook URL β
Back in WhatsMarkSaaS:
- Go to Settings β System Settings β Webhook Management
- Paste your N8N webhook URL in the Webhook URL field
- Click Save
Step 4: Test the Connection β
- Create a new contact in WhatsMarkSaaS
- Check your N8N workflow - it should receive the webhook
- Inspect the payload to verify the data structure
Testing
Use N8N's Execute Node feature to test your webhook without waiting for real events.
Webhook Payload Structure β
Every webhook sent to N8N follows this standardized format:
{
"event": {
"id": "evt_1702468200_abc123",
"type": "contact.created",
"timestamp": "2025-12-12T14:30:00.000Z",
"version": "1.0"
},
"tenant": {
"id": 123,
"name": "Acme Corporation",
"domain": "acme"
},
"data": {
"resource": {
"type": "contact",
"id": 456,
"attributes": {
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"phone": "+1234567890",
"company": "Acme Inc"
}
},
"relationships": {
"status": {
"id": 1,
"name": "Active"
},
"source": {
"id": 2,
"name": "Website"
}
}
},
"changes": {
"previous": null,
"current": { "firstname": "John", "lastname": "Doe" },
"modified_fields": null
}
}Key Fields Explained β
event: Metadata about the webhook event
type: Event identifier (e.g.,contact.created,status.updated)timestamp: When the event occurred (ISO 8601 format)
tenant: Information about your WhatsMarkSaaS tenant
data: The actual resource data
resource.attributes: Direct properties of the resourcerelationships: Related data (status, source, groups, etc.)
changes: For
updatedevents onlyprevious: Old valuescurrent: New valuesmodified_fields: Array of changed field names
N8N Workflow Examples β
Example 1: New Contact Notification to Slack β
Send a Slack message whenever a new contact is created.
Workflow Nodes:
- Webhook - Receive webhook from WhatsMarkSaaS
- IF - Filter for contact creation events
- Slack - Send notification
IF Node Expression:
{
{
$json.event.type === 'contact.created';
}
}Slack Message:
π New Contact Added!
Name: {{ $json.data.resource.attributes.firstname }} {{ $json.data.resource.attributes.lastname }}
Email: {{ $json.data.resource.attributes.email }}
Phone: {{ $json.data.resource.attributes.phone }}
Source: {{ $json.data.relationships.source.name }}
Status: {{ $json.data.relationships.status.name }}Example 2: Sync Contacts to Google Sheets β
Automatically add new contacts to a Google Sheet.
Workflow Nodes:
- Webhook - Receive webhook
- IF - Filter for
contact.created - Google Sheets - Append row
Google Sheets Configuration:
- Column A:
{{ $json.data.resource.id }} - Column B:
{{ $json.data.resource.attributes.firstname }} - Column C:
{{ $json.data.resource.attributes.lastname }} - Column D:
{{ $json.data.resource.attributes.email }} - Column E:
{{ $json.data.resource.attributes.phone }} - Column F:
{{ $json.data.relationships.status.name }} - Column G:
{{ $json.data.relationships.source.name }} - Column H:
{{ $json.event.timestamp }}
Example 3: Status Change Alert β
Get notified when a contact becomes a "Hot Lead".
Workflow Nodes:
- Webhook - Receive webhook
- IF - Check for status change to "Hot Lead"
- Send Email - Alert sales team
IF Node Expression:
{
{
$json.event.type === 'contact.updated' &&
$json.changes.modified_fields?.includes('status_id') &&
$json.data.relationships.status.name === 'Hot Lead';
}
}Extracting Data in N8N β
Use these expressions to access webhook data in your N8N workflows:
Contact Information β
// Full name
{
{
$json.data.resource.attributes.firstname;
}
}
{
{
$json.data.resource.attributes.lastname;
}
}
// Email
{
{
$json.data.resource.attributes.email;
}
}
// Phone
{
{
$json.data.resource.attributes.phone;
}
}
// Company
{
{
$json.data.resource.attributes.company;
}
}Relationships β
// Status name
{
{
$json.data.relationships.status.name;
}
}
// Source name
{
{
$json.data.relationships.source.name;
}
}
// First group name
{
{
$json.data.relationships.groups[0]?.name;
}
}
// All groups (comma-separated)
{
{
$json.data.relationships.groups?.map((g) => g.name).join(', ');
}
}
// Assigned to
{
{
$json.data.relationships.assigned_to?.name;
}
}Change Tracking β
// Check if email changed
{
{
$json.changes.modified_fields?.includes('email');
}
}
// Previous email value
{
{
$json.changes.previous?.email;
}
}
// Current email value
{
{
$json.changes.current?.email;
}
}HTTP Headers β
WhatsMarkSaaS includes these headers with every webhook request:
Content-Type: application/json
X-Webhook-Event: contact.created
X-Webhook-Timestamp: 2025-12-12T14:30:00+00:00
X-Webhook-Format: n8nYou can use these headers in N8N for additional validation or routing logic.
Best Practices β
1. Filter Events Early β
Use IF nodes at the start of your workflow to filter only the events you need:
{
{
$json.event.type === 'contact.created' ||
$json.event.type === 'contact.updated';
}
}2. Handle Errors Gracefully β
Add error handling nodes to prevent workflow failures:
- Use Try/Catch blocks
- Set up Error Workflow in N8N settings
3. Avoid Rate Limits β
If processing large volumes:
- Use Batch nodes to group operations
- Add Wait nodes between API calls
- Consider using Queue nodes for async processing
4. Test with Real Data β
Always test your workflow with actual webhook data before deploying to production.
5. Monitor Webhook Deliveries β
Check your webhook logs in WhatsMarkSaaS:
- Go to Settings β System Settings β Webhook Management
- View delivery history and error logs
Troubleshooting β
Webhook Not Received β
Check N8N:
- β Workflow is activated
- β Webhook node is properly configured
- β URL is publicly accessible (not localhost)
Check WhatsMarkSaaS:
- β Webhooks are enabled
- β Correct URL is configured
- β Events are selected
- β Check webhook logs for errors
Incorrect Data Format β
- β Verify you're using version 1.6.0 or higher
- β Check the Webhook Format Reference for detailed payload structure
- β Use N8N's Execute Node to inspect raw payload
Authentication Errors β
If using webhook authentication in N8N:
- β Configure matching authentication in WhatsMarkSaaS
- β Use header-based auth (Basic or Bearer tokens)
Advanced Use Cases β
Multi-Tenant Workflows β
Filter webhooks by tenant:
{
{
$json.tenant.domain === 'your-tenant-name';
}
}Conditional Routing β
Route different event types to different workflows:
// Route by event type
{
{
$json.event.type.startsWith('contact.')
? 'contact-workflow'
: 'other-workflow';
}
}Data Transformation β
Transform webhook data before sending to other services:
// Create custom payload
{{
{
"full_name": $json.data.resource.attributes.firstname + ' ' + $json.data.resource.attributes.lastname,
"contact_email": $json.data.resource.attributes.email,
"lead_source": $json.data.relationships.source.name
}
}}Related Resources β
- Webhook Format Reference - Detailed payload documentation
- Webhook Management Settings - Configuration guide
- N8N Documentation - Official N8N docs