n8n Webhooks
MediaMagic CRM uses n8n webhooks for workflow automation triggered by entity changes.
Overview
Configuration
Set the n8n webhook base URL in your environment:
N8N_WEBHOOK_BASE=https://your-n8n-instance.comThe Bridge appends workflow paths to this base URL.
Available Webhooks
Guest Booking Triggers
| Trigger | Path | When |
|---|---|---|
guest-confirmed | /webhook/guest-confirmed | Guest agrees to appear |
guest-scheduled | /webhook/guest-scheduled | Recording date set |
guest-recorded | /webhook/guest-recorded | Recording complete |
guest-published | /webhook/guest-published | Episode published |
Content Triggers
| Trigger | Path | When |
|---|---|---|
content-created | /webhook/content-created | New content created |
content-scheduled | /webhook/content-scheduled | Date/time set |
content-recording | /webhook/content-recording | Recording started |
content-editing | /webhook/content-editing | In editing phase |
content-publish | /webhook/content-publish | Ready to publish |
content-published | /webhook/content-published | All platforms done |
Platform Triggers
| Trigger | Path | When |
|---|---|---|
platform-live | /webhook/platform-live | Livestream is live |
Clip Triggers
| Trigger | Path | When |
|---|---|---|
clip-ready | /webhook/clip-ready | Clip ready for distribution |
clip-published | /webhook/clip-published | Clip published |
Payload Structure
All webhooks send the entity data in this format:
{
"event": "guest-confirmed",
"timestamp": "2026-02-05T12:00:00.000Z",
"entity": {
"id": "abc123",
"name": "John Smith",
"email": "john@example.com",
"stage": "Confirmed",
// ... all entity fields
},
"previousStage": "Responded",
"triggeredBy": "user-id"
}Example Workflows
Guest Confirmed Workflow
n8n Workflow:
- Webhook node: Receive guest-confirmed
- Slack node: Post to #guests channel
- Email node: Send confirmation template to guest
- Google Sheets node: Add row to planning sheet
Content Published Workflow
Clip Ready Workflow
Setting Up n8n
1. Create Webhook Node
In n8n, create a new workflow with a Webhook trigger:
- HTTP Method: POST
- Path:
guest-confirmed(matches Bridge trigger) - Authentication: None (or add header auth)
2. Add Action Nodes
Connect action nodes for your desired outputs:
- Slack: Send notifications to channels
- Email (SMTP/SendGrid): Send emails
- Google Sheets: Log to spreadsheets
- HTTP Request: Call other APIs
3. Activate Workflow
Click "Active" to enable the workflow.
4. Get Webhook URL
Copy the webhook URL and set as your N8N_WEBHOOK_BASE:
# If n8n URL is: https://n8n.example.com/webhook/guest-confirmed
# Set base as:
N8N_WEBHOOK_BASE=https://n8n.example.comBridge Integration
The Bridge triggers n8n using the helper:
// bridge/helpers/n8n/triggerWorkflow.js
export async function triggerN8nWorkflow(path, data) {
const url = `${process.env.N8N_WEBHOOK_BASE}/webhook/${path}`;
await axios.post(url, {
event: path,
timestamp: new Date().toISOString(),
entity: data,
});
}Common Patterns
Conditional Actions
Delayed Actions
Loop Through Platforms
Debugging
Test Webhooks
Use curl to test n8n webhooks:
curl -X POST https://your-n8n.com/webhook/test \
-H "Content-Type: application/json" \
-d '{"test": true}'Check Bridge Logs
docker compose logs bridge | grep n8nn8n Execution History
In n8n, check Executions to see webhook receipts and workflow runs.
Best Practices
Use Webhook Authentication
Add an API key header to prevent unauthorized triggers.
Error Handling
Add error handling nodes to catch failures and notify you.
Idempotency
Design workflows to handle duplicate triggers gracefully.
Rate Limits
Be mindful of rate limits on external services (Slack, email providers).