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
Request Format
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
agent_name | string | One of name/id | Agent name to execute |
agent_id | integer | One of name/id | Agent ID to execute |
task | string | Yes | Task/prompt for the agent |
variables | object | No | Variables for template rendering |
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: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 therun_id to check status:
Async Execution
Webhook triggers are asynchronous - the response returns immediately with arun_id. The agent executes in the background.
To wait for completion, poll the run status:
Security Considerations
- Always use API keys in production - Never expose unauthenticated webhooks
- Use HTTPS - Encrypt webhook traffic
- Validate sources - Consider IP allowlisting for known sources
- Rate limiting - Station doesn’t rate limit by default; use a reverse proxy
- Audit logs - All webhook executions are logged with source info
Troubleshooting
Connection Refused
- Station is running:
stn status - Port 8587 is accessible
- Firewall allows inbound connections
401 Unauthorized
STN_WEBHOOK_API_KEYis set on Station- Request includes
Authorization: Bearer <key>header - Key matches exactly
Agent Not Found
- Agent name is correct (case-sensitive)
- Agent exists:
stn agent list - Agent is enabled
Run Fails
Check run details:- Agent prompt errors
- MCP tool failures
- Timeout exceeded
Comparison: Webhooks vs Notify
| Feature | Webhooks (this page) | Notify Tool |
|---|---|---|
| Direction | External → Station | Station → External |
| Purpose | Trigger agents | Send notifications |
| Endpoint | POST /execute | Configured webhook URL |
| Example | PagerDuty triggers investigation | Agent sends Slack alert |
Next Steps
- Notifications - Outbound notifications from agents
- Scheduling - Cron-based execution
- Observability - Monitor webhook executions

