Skip to main content

Webhook Trigger

The Webhook Trigger (also called "Webhook Received") starts a workflow when an external system sends an HTTP request to your webhook endpoint.

Jerome Bajou avatar
Written by Jerome Bajou
Updated this week

Overview

The Webhook Trigger (also called "Webhook Received") starts a workflow when an external system sends an HTTP request to your webhook endpoint.

When It Triggers

  • An external system sends a POST request to your webhook URL

  • Webhook payload is received and validated

  • Can be triggered by any external service or system

Use Cases

  • Integrate with third-party services

  • Receive data from external systems

  • Process incoming API requests

  • Sync data from partner systems

  • Handle external event notifications

  • Process form submissions

  • Connect to Zapier, Make, or other automation tools


Configuration

This trigger requires minimal configuration but provides a unique webhook URL for your workflow.

Webhook URL

Each workflow with a webhook trigger gets a unique URL:

<https://you.captainbook.io/hooks/w/{workflow-id}>

Optional Configuration

  • Token Authentication (optional) - Add token-based authentication

  • Custom Headers - Validate specific headers if needed

Security

  • Each workflow has a unique webhook URL

  • Optional token authentication for additional security

  • Rate limiting based on your plan


Available Data

When this trigger fires, it provides the webhook payload and headers.

Context Data Structure

Payload

  • payload - The webhook request body (parsed as JSON/object)

  • Contains whatever data the external system sent

Headers

  • headers - HTTP headers from the webhook request

  • Includes standard headers (Content-Type, User-Agent, etc.)

  • Includes any custom headers sent by the external system

Timestamp

  • timestamp - Unix timestamp when webhook was received

Accessing Webhook Data

{payload.field_name} 
{payload.data.id}
{headers.Content-Type}
{headers.X-Custom-Header}
{timestamp}

Example Payload Structure

The payload structure depends on what the external system sends. Common formats:

{
"event": "booking.created",
"data": {
"id": 123,
"customer": "John Doe"
}
}

Example Workflows

1. Process External Booking

Workflow Steps:

  1. Trigger: Webhook Received

  2. Action: Create Booking

    • Use data from {payload}

    • Map external fields to booking fields

2. Sync Customer Data

Workflow Steps:

  1. Trigger: Webhook Received

  2. Condition: If {payload.event} equals "customer.updated"

  3. Action (True): Find Customers (by external ID)

  4. Action: Update Customer (with new data)

3. Handle Form Submission

Workflow Steps:

  1. Trigger: Webhook Received

  2. Action: Create Customer

    • Name: {payload.name}

    • Email: {payload.email}

  3. Action: Send Notification (thank you email)

4. Process Payment Webhook

Workflow Steps:

  1. Trigger: Webhook Received

  2. Condition: If {payload.status} equals "succeeded"

  3. Action (True): Get Booking (using {payload.booking_id})

  4. Action: Update Booking (mark as paid)

5. Zapier Integration

Workflow Steps:

  1. Trigger: Webhook Received

  2. Action: Process data from Zapier

  3. Action: Create or update records

  4. Action: Send Webhook (response back to Zapier)


Testing

When testing this trigger:

  1. Use the test modal to simulate webhook payloads

  2. Enter JSON payload data

  3. Add custom headers if needed

  4. Review execution logs to see received data

Test Data

Default test data includes:

  • Sample payload with example fields

  • Common headers (Content-Type, User-Agent)

  • Current timestamp

You can modify test data to match your actual webhook format.


Best Practices

  1. Validate payload - Use conditions to verify required fields exist

  2. Handle errors - Set up error notifications for invalid webhooks

  3. Secure endpoints - Use token authentication for sensitive workflows

  4. Log webhooks - Review execution logs to debug issues

  5. Rate limiting - Be aware of webhook rate limits per plan

  6. Idempotency - Handle duplicate webhooks gracefully

  7. Error responses - Return appropriate HTTP status codes


Webhook URL

Getting Your Webhook URL

  1. Create a workflow with Webhook trigger

  2. The webhook URL is displayed in the trigger configuration

  3. Copy the URL to use in external systems

URL Format

<https://you.captainbook.io/hooks/w/{workflow-id}>

Authentication

If token authentication is enabled:

  • Include token in request: ?token=your-token

  • Or in header: X-Webhook-Token: your-token


Rate Limits

Webhook triggers are subject to rate limits based on your plan:

  • Starter: 100 calls per hour

  • Extended: 500 calls per hour

  • Ultra: 2,000 calls per hour

  • Corporate: 10,000 calls per hour

If rate limit is exceeded, webhook requests will be rejected.


HTTP Response

Your workflow can send responses back to the webhook caller using the "Send Webhook" action, but note:

  • The webhook trigger itself responds immediately with 200 OK

  • Use "Send Webhook" for async responses to external systems


Related Documentation

Did this answer your question?