Webhooks & Event-Driven Automation
TalkOps listens on HTTP webhooks (/webhooks/{provider}) to transform real-time production alerts, CI/CD pipeline failures, and ITSM tickets into autonomous LangGraph investigations—and writes structured Root Cause Analysis (RCA) findings back to your incident management tools.
When an alert fires in PagerDuty, Prometheus Alertmanager, Datadog, AWS SNS/CloudWatch, CloudEvents, ServiceNow, Jenkins, GitHub Actions, or Azure Monitor, TalkOps verifies the cryptographic signature, deduplicates alert storms, maps related events for the same incident into a stateful conversation thread, executes diagnostic subagents under Jev Smart Mode guardrails, and posts the RCA back to the originating ticket, pull request, or Slack channel.
Out-of-the-box normalization for sns, pagerduty, alertmanager, cloudevents, jenkins, github, datadog, servicenow, and generic (including native Azure Monitor Common Alert Schema, Opsgenie, Jira, ArgoCD, and GitLab).
Suppresses duplicate webhook bursts within a configurable TTL window (default 300s) and bounds concurrent background agent runs (default 5).
Routes follow-up alerts sharing the same incident_id into the existing LangGraph thread via ThreadStore so the agent retains full historical context across an evolving outage.
Automatically posts completed Root Cause Analysis reports back to PagerDuty Incident Notes, ServiceNow work_notes, GitHub PR/commit comments, Slack webhooks, and custom HTTP callbacks.
Starting the webhook listener
Launch the webhook listener via talkops serve (or its aliases talkops webhooks and talkops webhook):
# Start central server & webhook listener on port 2024
talkops serve --host 0.0.0.0 --port 2024 --webhook-secret "$TALKOPS_WEBHOOK_SECRET"
# Or run the alias directly
talkops webhooks --port 2024 --approval-mode smart
# List all registered webhook providers and endpoint paths
talkops webhooks list
Dedicated webhook port (--webhook-port)
If you want connected operator TUI clients on an internal port (2024) while exposing only /webhooks/* to an external API gateway on port 8080, pass --webhook-port:
talkops serve \
--host 0.0.0.0 \
--port 2024 \
--webhook-port 8080 \
--postgres-uri "postgresql://ops:secret@db:5432/talkops"
How the webhook ingestion pipeline works
Every POST /webhooks/{provider} request flows through the 8-stage WebhookDispatcher pipeline (src/talkops/webhooks/dispatcher.py):
- Cryptographic Verification: Validates provider-specific HMAC signatures (
X-PagerDuty-Signature,X-Hub-Signature-256,X-Gitlab-Token) or shared bearer/query tokens (Authorization: Bearer <secret>,X-Webhook-Secret, or?token=<secret>). - Protocol Handshakes: Automatically confirms AWS SNS
SubscriptionConfirmationrequests via HTTPGET(webhooks.sns_auto_confirm = true) and responds to GitHubpingevents. - Normalization (
WebhookEvent): Extractsevent_type,severity(critical,high,warning,info),title,summary,source_service,incident_id,dedupe_key,repository,branch,commit_sha, and constructs a structured DevOps investigation prompt. - Actionable Filtering: Automatically ignores
resolved/okalerts (ignore_resolved=True) and successful CI runs (ignore_non_actionable_ci=True) so agent compute is spent strictly on active incidents. - Alert Storm Deduplication & Throttling: Drops duplicate
dedupe_keydeliveries withinwebhooks.dedupe_ttl_seconds(300sdefault) and caps simultaneous webhook-triggered agent runs atwebhooks.max_concurrent_runs(5default). - Stateful Thread Mapping & RBAC:
ThreadStoremaps the event'sincident_idto a persistent LangGraphthread_id. If an incident triggers 5 cascading alerts over 20 minutes, all 5 alerts append to the same investigation thread.IdentityMapperassigns the appropriate RBAC role and allowed subagent capabilities. - Asynchronous Execution (
202 Accepted): Immediately returns202 Acceptedwith thedelivery_idandthread_idwhile executing the LangGraph run in the background. Fires thewebhook.receivedlifecycle hook. - Bidirectional RCA Write-Back: Upon completion,
dispatch_completion_sinksposts the agent's Root Cause Analysis back to the originating platform and fires thewebhook.completedhook.
Supported webhook providers
1. PagerDuty (POST /webhooks/pagerduty)
Ingests PagerDuty v3 webhook subscriptions (incident.triggered, incident.escalated, incident.reopened).
- Inbound Verification:
TALKOPS_WEBHOOK_PAGERDUTY_SECRET(verifiesX-PagerDuty-Signature: v1=<hmac_sha256>). - Stateful Threading: Maps
data.id(incident_id) to a persistent LangGraph thread. - Automated Write-Back: Set
TALKOPS_WEBHOOK_PAGERDUTY_API_KEYandTALKOPS_WEBHOOK_PAGERDUTY_FROM_EMAILto automatically post the agent's RCA as a PagerDuty Incident Note (POST https://api.pagerduty.com/incidents/{id}/notes).
curl -X POST http://localhost:2024/webhooks/pagerduty \
-H "Content-Type: application/json" \
-H "X-PagerDuty-Signature: v1=..." \
-d '{
"event": {
"id": "01B2C3D4",
"event_type": "incident.triggered",
"data": {
"id": "Q123456789",
"title": "High 5xx Error Rate on checkout-service (prod-us-east-1)",
"urgency": "high",
"service": {"summary": "checkout-service"}
}
}
}'
2. Prometheus Alertmanager (POST /webhooks/alertmanager)
Ingests Alertmanager group webhook payloads (firing alerts), extracting labels (alertname, severity, namespace, pod, service, cluster) and annotations (summary, description, runbook_url).
- Inbound Verification:
TALKOPS_WEBHOOK_SECRETviaAuthorization: Bearer <secret>or?token=<secret>. - Stateful Threading: Uses
groupKey/fingerprintto correlate grouped alerts into a single thread.
3. AWS SNS & CloudWatch Alarms (POST /webhooks/sns)
Ingests AWS SNS HTTP/HTTPS notifications, automatically unwrapping embedded CloudWatch Alarm JSON payloads (AlarmName, NewStateValue, NewStateReason, Namespace, MetricName, Dimensions).
- Automatic Subscription Confirmation: When you subscribe
https://talkops.company.com/webhooks/snsto an SNS topic, TalkOps automatically fetches theSubscribeURLwhenType == "SubscriptionConfirmation"(webhooks.sns_auto_confirm = true).
4. Datadog (POST /webhooks/datadog or /webhooks/dd)
Ingests Datadog Monitor and Synthetics alert webhooks (alert_transition: Triggered, No Data), extracting monitor tags, host, query, and snapshot links.
- Inbound Verification:
TALKOPS_WEBHOOK_SECRETorTALKOPS_WEBHOOK_SECRET_DATADOG. - Stateful Threading: Correlates by
alert_idorevent_id.
5. ServiceNow ITSM (POST /webhooks/servicenow, /webhooks/snow, /webhooks/itsm)
Ingests ServiceNow Incident webhook payloads (number, sys_id, priority, urgency, short_description, cmdb_ci, assignment_group).
- Automated Write-Back: When the payload includes
instance_urlandsys_id(andSERVICENOW_USER/SERVICENOW_PASSWORDorSERVICENOW_TOKENis configured), TalkOps automatically patches the incident'swork_notes(PATCH {instance_url}/api/now/table/incident/{sys_id}) with the completed RCA.
6. GitHub Actions, Issues & PRs (POST /webhooks/github)
Ingests GitHub workflow_run failures, check_suite failures, issues, and pull_request events.
- Inbound Verification:
TALKOPS_WEBHOOK_GITHUB_SECRET(verifiesX-Hub-Signature-256: sha256=<hmac_sha256>). - Automated Write-Back: Set
TALKOPS_WEBHOOK_GITHUB_TOKEN(orGITHUB_TOKEN) to automatically post the RCA comment back to the originating Pull Request (/issues/{pr}/comments) or Commit (/commits/{sha}/comments).
7. Jenkins CI/CD (POST /webhooks/jenkins)
Ingests Jenkins Notification Plugin and Pipeline build webhooks (FAILED, UNSTABLE, ABORTED), extracting job name, build number, Git branch/commit, and console failure logs.
- Inbound Verification:
TALKOPS_WEBHOOK_JENKINS_TOKENviaAuthorization: Bearer <token>orX-Webhook-Token.
8. CNCF CloudEvents 1.0 (POST /webhooks/cloudevents)
Ingests standard CNCF CloudEvents (specversion: "1.0") both in structured JSON mode and binary header mode (ce-id, ce-type, ce-source, ce-subject)—ideal for Argo Events, Knative Eventing, Keptn, and Kubernetes Event Exporters.
9. Generic & Multi-Platform Adapter (POST /webhooks/{alias})
The universal adapter handles custom JSON webhooks as well as dedicated aliases:
POST /webhooks/azure-monitor: Native parser for the Azure Monitor Common Alert Schema (data.essentials.alertRule,severity,monitorCondition,alertTargetIDs,alertContext).POST /webhooks/opsgenie: Opsgenie alert webhooks.POST /webhooks/argocd: ArgoCD Application sync/health failure notifications.POST /webhooks/gitlab: GitLab CI pipeline and merge request hooks (verified viaTALKOPS_WEBHOOK_GITLAB_TOKEN/X-Gitlab-Token).POST /webhooks/jira: Jira issue/incident automation webhooks.POST /webhooks/generic/POST /webhooks/custom: Any custom JSON payload (automatically extractstitle,summary,message,severity,service,incident_id, andcallback_url).
Outbound RCA write-back sinks
When a webhook-triggered LangGraph investigation finishes, dispatch_completion_sinks() (src/talkops/webhooks/sinks.py) delivers the formatted Root Cause Analysis to all configured sinks in parallel:
| Sink | Configuration Key / Env Var | Behavior |
|---|---|---|
| PagerDuty Incident Notes | webhooks.pagerduty_api_key (TALKOPS_WEBHOOK_PAGERDUTY_API_KEY) + webhooks.pagerduty_from_email (TALKOPS_WEBHOOK_PAGERDUTY_FROM_EMAIL) | Posts [TalkOps Automated RCA] directly to POST /incidents/{incident_id}/notes when provider == "pagerduty". |
| ServiceNow Work Notes | SERVICENOW_TOKEN or SERVICENOW_USER + SERVICENOW_PASSWORD | Updates work_notes on /api/now/table/incident/{sys_id} when provider == "servicenow". |
| GitHub PR / Commit Comments | webhooks.github_token (TALKOPS_WEBHOOK_GITHUB_TOKEN or GITHUB_TOKEN) | Posts ### 🤖 TalkOps Automated Root Cause Analysis on the PR or commit when provider == "github". |
| Slack Incoming Webhook | webhooks.slack_url (TALKOPS_WEBHOOK_SLACK_URL or SLACK_WEBHOOK_URL) | Posts severity-badged (🚨 CRITICAL, 🔥 HIGH, ⚠️ WARNING) RCA summary with provider, service, and thread_id to Slack for any webhook provider. |
| Custom HTTP Callback | webhooks.callback_url (TALKOPS_WEBHOOK_CALLBACK_URL) or per-payload "callback_url" | Sends a structured JSON POST containing delivery_id, thread_id, provider, incident_id, severity, status, and response to your custom endpoint. |
Configuring [webhooks] in config.toml
You can configure all webhook listener settings, verification secrets, and outbound write-back sinks in ~/.talkops/config.toml or .talkops/config.toml:
[webhooks]
host = "0.0.0.0"
port = 2024
dedupe_ttl_seconds = 300
max_concurrent_runs = 5
sns_auto_confirm = true
# Inbound verification secrets (prefer env vars or `talkops auth` in production)
secret = "env:TALKOPS_WEBHOOK_SECRET"
pagerduty_secret = "env:TALKOPS_WEBHOOK_PAGERDUTY_SECRET"
github_secret = "env:TALKOPS_WEBHOOK_GITHUB_SECRET"
gitlab_token = "env:TALKOPS_WEBHOOK_GITLAB_TOKEN"
jenkins_token = "env:TALKOPS_WEBHOOK_JENKINS_TOKEN"
# Outbound RCA write-back sinks
slack_url = "https://hooks.slack.com/services/T000/B000/XXXX"
pagerduty_api_key = "env:TALKOPS_WEBHOOK_PAGERDUTY_API_KEY"
pagerduty_from_email = "talkops-bot@company.com"
github_token = "env:TALKOPS_WEBHOOK_GITHUB_TOKEN"
callback_url = "https://internal-event-bus.company.com/talkops/rca"
Inspecting deliveries & attaching to webhook threads
You can query recent webhook deliveries and attach an interactive TUI session directly to a webhook-spawned investigation thread:
-
Query recent deliveries via HTTP:
curl -s http://localhost:2024/webhooks/deliveries | jq .{
"deliveries": [
{
"delivery_id": "wh_9a8b7c6d5e4f",
"provider": "pagerduty",
"event_type": "incident.triggered",
"severity": "critical",
"title": "High 5xx Error Rate on checkout-service",
"incident_id": "Q123456789",
"thread_id": "3f9d2a11-8c4b-4e7a-9b12-0a1b2c3d4e5f",
"status": "completed",
"received_at": "2026-10-16T13:20:05Z"
}
],
"count": 1
} -
Attach your interactive TUI to the webhook's LangGraph thread:
talkops --server-url http://localhost:2024 -r 3f9d2a11-8c4b-4e7a-9b12-0a1b2c3d4e5fOnce attached, you see the full webhook prompt, every diagnostic command and subagent run executed during the autonomous RCA, and can immediately issue follow-up remediation commands or
/forkthe thread.
Next steps
- Central Server & Multi-Client Architecture — Scale
talkops servewith PostgreSQL and multi-user authentication - Hooks — Trigger local scripts on
webhook.receivedandwebhook.completedevents - Approval Modes & Jev Smart Mode — Learn how Smart Mode governs tool execution during unattended webhook runs