Skip to content

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:

bash
N8N_WEBHOOK_BASE=https://your-n8n-instance.com

The Bridge appends workflow paths to this base URL.

Available Webhooks

Guest Booking Triggers

TriggerPathWhen
guest-confirmed/webhook/guest-confirmedGuest agrees to appear
guest-scheduled/webhook/guest-scheduledRecording date set
guest-recorded/webhook/guest-recordedRecording complete
guest-published/webhook/guest-publishedEpisode published

Content Triggers

TriggerPathWhen
content-created/webhook/content-createdNew content created
content-scheduled/webhook/content-scheduledDate/time set
content-recording/webhook/content-recordingRecording started
content-editing/webhook/content-editingIn editing phase
content-publish/webhook/content-publishReady to publish
content-published/webhook/content-publishedAll platforms done

Platform Triggers

TriggerPathWhen
platform-live/webhook/platform-liveLivestream is live

Clip Triggers

TriggerPathWhen
clip-ready/webhook/clip-readyClip ready for distribution
clip-published/webhook/clip-publishedClip published

Payload Structure

All webhooks send the entity data in this format:

json
{
  "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:

  1. Webhook node: Receive guest-confirmed
  2. Slack node: Post to #guests channel
  3. Email node: Send confirmation template to guest
  4. 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:

bash
# If n8n URL is: https://n8n.example.com/webhook/guest-confirmed
# Set base as:
N8N_WEBHOOK_BASE=https://n8n.example.com

Bridge Integration

The Bridge triggers n8n using the helper:

javascript
// 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:

bash
curl -X POST https://your-n8n.com/webhook/test \
  -H "Content-Type: application/json" \
  -d '{"test": true}'

Check Bridge Logs

bash
docker compose logs bridge | grep n8n

n8n 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).

MediaMagic CRM Documentation