Skip to main content

Event-Triggered Execution

Trigger agent execution from external systems via HTTP webhook. Perfect for integrating with CI/CD pipelines, alerting systems, or any automation that can make HTTP requests.

Endpoint

Port 8587 is the Dynamic Agent MCP server, which also serves the webhook endpoint.

Request Format

Request Parameters

With Variables

Response

Success (202 Accepted)

Error (400/401/404)

Authentication

Local Mode (Default)

No authentication required when running locally.

Production

Set a static API key:
Include in requests:

CloudShip OAuth

When CloudShip OAuth is enabled, webhook requests use the same OAuth flow as MCP clients.

Integration Examples

PagerDuty

Auto-investigate when alerts fire:

GitHub Actions

Trigger analysis on deployment:

Datadog Monitor

Trigger from Datadog webhook:

Slack Slash Command

Create a Slack app that posts to your Station:

Prometheus Alertmanager

Configure alertmanager webhook:

Configuration

Enable/Disable

API Key

In config.yaml

Checking Run Status

After triggering, use the run_id to check status:

Async Execution

Webhook triggers are asynchronous - the response returns immediately with a run_id. The agent executes in the background. To wait for completion, poll the run status:

Security Considerations

  1. Always use API keys in production - Never expose unauthenticated webhooks
  2. Use HTTPS - Encrypt webhook traffic
  3. Validate sources - Consider IP allowlisting for known sources
  4. Rate limiting - Station doesn’t rate limit by default; use a reverse proxy
  5. Audit logs - All webhook executions are logged with source info

Troubleshooting

Connection Refused

Check:
  1. Station is running: stn status
  2. Port 8587 is accessible
  3. Firewall allows inbound connections

401 Unauthorized

Check:
  1. STN_WEBHOOK_API_KEY is set on Station
  2. Request includes Authorization: Bearer <key> header
  3. Key matches exactly

Agent Not Found

Check:
  1. Agent name is correct (case-sensitive)
  2. Agent exists: stn agent list
  3. Agent is enabled

Run Fails

Check run details:
Common issues:
  • Agent prompt errors
  • MCP tool failures
  • Timeout exceeded

Comparison: Webhooks vs Notify

See Notifications for outbound notifications.

Next Steps