Webhook Triggers

Copy page

Create webhook endpoints for external services to invoke your Agents

Triggers create webhook endpoints that allow external services to invoke your Agents via HTTP. When a service like GitHub, Slack, or Stripe sends a webhook, the payload is validated, transformed, and used to start a new conversation with your Agent.

How Triggers Work

  1. External service sends a webhook to your trigger's URL
  2. Authentication is verified (API key, bearer token, or signature)
  3. Payload is validated against the input schema (if configured)
  4. Payload is transformed using the message template
  5. Invocation is logged and the webhook returns immediately with 202 Accepted
  6. Agent processes the message asynchronously in a new conversation

When to Use Triggers

Triggers are ideal for:

Use CaseExample
CI/CD pipelinesTrigger code review agents on PR creation
Customer eventsRespond to Stripe payment webhooks
DevOps alertsProcess PagerDuty or Datadog alerts
Chat integrationsHandle Slack or Discord messages
Form submissionsProcess Typeform or webhook-enabled forms
Scheduled tasksInvoke agents from cron jobs or schedulers

Trigger Configuration

Each trigger is configured with:

Required

  • Name: Human-readable identifier for the trigger
  • Message Template: Template that converts the webhook payload into a message for the Agent

Optional

  • Input Schema: JSON Schema to validate incoming payloads
  • Authentication: API key, bearer token, or basic auth
  • Signing Secret: HMAC-SHA256 signature verification (for GitHub, Slack, etc.)
  • Output Transform: JMESPath or object mapping to reshape payloads

Authentication Options

Triggers support multiple authentication methods:

TypeHeaderUse Case
api_keyCustom header (e.g., X-API-Key)Simple token auth
bearer_tokenAuthorization: Bearer <token>OAuth-style auth
basic_authAuthorization: Basic <base64>Username/password
noneNo authenticationPublic webhooks with signature verification
Note
Note

For services that sign webhooks (GitHub, Stripe, Slack), you can use authentication: { type: 'none' } combined with signingSecret for security.

Webhook URL Format

After creating a trigger, the webhook URL follows this pattern:

POST https://<your-run-api>/tenants/{tenantId}/projects/{projectId}/agents/{agentId}/triggers/{triggerId}

You can find the complete webhook URL in the API response when creating or listing triggers.

Invocation Tracking

Every webhook invocation is tracked with:

  • Status: pendingsuccess or failed
  • Request Payload: The original webhook body
  • Transformed Payload: The payload after transformation
  • Conversation ID: The conversation created for this invocation
  • Error Message: Details if the invocation failed

This allows you to monitor webhook activity, debug failures, and audit trigger usage.

Example: GitHub Issue Handler

Here's a conceptual example of a trigger that responds to GitHub issues:

// When GitHub sends: { action: "opened", issue: { title: "Bug report", body: "..." }, ... }
// The trigger creates a message like:
// "New GitHub issue opened: Bug report\n\nDescription: ..."
// And starts a conversation with your support agent

The Agent then processes this message like any other conversation, using its configured tools and sub-agents to respond.

Next Steps