Execution
Webhooks & Streaming
Execution completion webhooks with HMAC-SHA256, SSE streaming, and observability forwarding
Get notified when executions complete, stream live events via SSE, and forward everything to your observability stack.
AgentField pushes execution results to your endpoints via HMAC-signed webhooks, streams real-time events over SSE/WebSocket, and can forward all platform events to external observability systems. No polling required.
from agentfield.types import WebhookConfig
# HMAC-signed webhook — no polling, result pushed to your endpoint
execution_id = await app.client.execute_async(
target="analyzer.process",
input_data={"document": doc},
webhook=WebhookConfig(
url="https://your-api.com/hooks/done",
secret="whsec_your_hmac_secret", # HMAC-SHA256 signature
headers={"Authorization": "Bearer tok_..."}, # Custom headers forwarded
),
)
# Control plane retries 5x with exponential backoff. Failures land in dead letter queue.# SSE stream — pipe live execution events into a dashboard or CLI
curl -N http://localhost:8080/api/ui/v1/executions/events
# → event: execution.started
# → data: {"execution_id":"exec_abc","status":"running","agent_node_id":"analyzer"}
# → event: execution.completed
# → data: {"execution_id":"exec_abc","status":"succeeded","duration_ms":14200}
# Observability webhook — forward ALL platform events to your collector
curl -X POST http://localhost:8080/api/v1/settings/observability-webhook \
-H "Content-Type: application/json" \
-d '{
"url": "https://collector.example.com/agentfield/events",
"secret": "obs_hmac_secret",
"enabled": true
}'
# Batched delivery (10 events/req), 3 retries, dead letter queue for failures
# Inspect and replay failed deliveries from the dead letter queue
curl http://localhost:8080/api/v1/settings/observability-webhook/dlq
curl -X POST http://localhost:8080/api/v1/settings/observability-webhook/redriveWhat just happened
- The execution was submitted once, then completion moved to push delivery instead of polling
- Signatures and retries were handled by the control plane, not by ad hoc app code
- The same platform could stream live events and forward them to an external collector
Example completion webhook:
{
"event": "execution.completed",
"execution_id": "exec_abc",
"workflow_id": "run_x7y8z9",
"status": "succeeded",
"target": "analyzer.process",
"type": "reasoner",
"duration_ms": 14200,
"result": {
"summary": "Document processed successfully"
},
"timestamp": "2026-03-23T10:00:00Z"
}