API Reference

Webhooks

Webhooks

Webhooks let you receive real-time notifications when events occur in your Flux workflows.

Supported Events

EventDescription
workflow.run.startedA workflow run has begun
workflow.run.completedA workflow run finished successfully
workflow.run.failedA workflow run encountered an error
step.completedAn individual step has finished
approval.requestedAn approval gate is waiting for a decision

Webhook Payload

Each webhook delivery includes a JSON payload with the event type, timestamp, and relevant resource data:

{
  "event": "workflow.run.completed",
  "timestamp": "2025-01-15T10:30:00Z",
  "data": {
    "run_id": "run_abc123",
    "workflow_id": "wf_xyz789",
    "status": "completed",
    "outputs": { ... }
  }
}

Configuration

Webhooks can be configured in your account settings or via the API. Each webhook endpoint requires a URL and a list of event types to subscribe to. Flux will retry failed deliveries up to 3 times with exponential backoff.

Security

Webhook payloads include an X-Flux-Signature header containing an HMAC-SHA256 signature. Verify this signature against your webhook secret to ensure the payload is authentic and hasn't been tampered with.

Agent Flux - The Hugging Face for AI Agents and Workflows