Skip to main content
Webhook Trigger

Overview

The Webhook Trigger provides a unique HTTP endpoint that external systems can call to start your workflow. It’s the bridge between Langdock Workflows and any external service or application that can send HTTP requests.
Best for: Real-time integrations, external system events, API-driven workflows, and connecting services without native integrations.

When to Use Webhook Trigger

Perfect for:
  • Receiving events from external services (GitHub, Stripe, custom apps)
  • Real-time data processing from external systems
  • Building custom integrations
  • Connecting services that support webhooks (including other workflows)
  • API-driven workflows initiated by other systems
Not ideal for:
  • User-facing data collection (use Form Trigger)
  • Scheduled recurring tasks (use Scheduled Trigger)
  • Native integration events (use Integration Trigger)

Configuration

Basic Setup

Webhook Trigger When you add a Webhook Trigger, you automatically get:
  • Unique Webhook URL: A secure endpoint for receiving requests
  • Webhook ID: Identifier for your webhook

Security Options

Secret Authentication: Configure a secret to secure your webhook endpoint:
  1. Add a Secret (optional)
    • Set a secret value in the webhook configuration
    • Include this secret in the request header or body when calling the webhook
    • Only requests with the correct secret will trigger the workflow
  2. No Secret (default)
    • Webhook is publicly accessible
    • Anyone with the URL can trigger it
    • Good for testing and low-security use cases
Best Practice: Always use a secret for production webhooks to prevent unauthorized access

How It Works

  1. External system sends HTTP POST request to webhook URL
  2. Webhook validates authentication (if configured)
  3. Request payload is parsed (JSON)
  4. Workflow starts with payload data available as {{trigger}}
  5. Webhook responds immediately with 200 OK
  6. Workflow processes asynchronously
Important: Webhooks respond immediately (within ~100ms) and process the workflow asynchronously. Don’t rely on the webhook response for workflow results.

Making Requests to Your Webhook

Basic Request

curl -X POST https://app.langdock.com/api/workflows/webhooks/abc123 \
  -H "Content-Type: application/json" \
  -d '{"key": "value"}'

Example Use Cases

GitHub Webhook Integration

Webhook Trigger (GitHub push events)
→ Agent: Analyze commit messages
→ Condition: Check if documentation updated
  → Yes: Regenerate docs
  → No: Continue
→ Notification: Send deployment status
GitHub Webhook Configuration:
  • URL: Your webhook URL
  • Events: Push, Pull Request
  • Content type: application/json

Stripe Payment Webhook

Webhook Trigger (Stripe events)
→ Code: Validate Stripe signature
→ Condition: Check event type
  → payment_succeeded: Update user account
  → payment_failed: Send retry notification
  → subscription_canceled: Deactivate access

Custom Application Integration

Webhook Trigger
→ Code: Validate and transform data
→ HTTP Request: Enrich data from external API
→ Agent: Analyze and categorize
→ Action: Create record in CRM

Slack Command Integration

Webhook Trigger (from Slack slash command)
→ Agent: Process natural language command
→ HTTP Request: Execute action in external system
→ HTTP Response: Send result back to Slack

Accessing Webhook Data

Access the webhook payload using the trigger variable:
{{trigger.output.user_id}}
{{trigger.output.event_type}}
{{trigger.output.data.amount}}
Access in workflow:
Event: {{trigger.output.event}}
Order: {{triggeroutput.order_id}}
Customer: {{trigger.output.customer_name}}
First Item: {{trigger.output.items[0].product}}

Response Codes

CodeMeaningWhen It Happens
200SuccessWorkflow triggered successfully
400Bad RequestInvalid JSON or missing required fields
401UnauthorizedAuthentication failed
403ForbiddenWorkflow is paused or inactive
500Server ErrorInternal error processing webhook

Next Steps