Overview
Instead of polling for results, you can configure webhooks to receive automatic notifications when your flows complete. When you provide acallback configuration in your request, Edges will send a POST request to your specified URL with the results.
For action callbacks (outside of Flows), refer to the Managing Callbacks documentation in the main Edges docs.
Setting up callbacks
Include acallback object in your flow run request:
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The URL where Edges will send webhook notifications |
headers | object | No | Custom headers to include in the webhook request (e.g., for authentication) |
Webhook payload
When a flow completes (or reaches milestones), Edges sends this payload:Status values
Thestatus field in the webhook payload can have the following values:
| Status | Description |
|---|---|
CREATED | Flow run has been created |
QUEUED | Flow run is queued for execution |
RUNNING | Flow run is currently executing |
SUCCEEDED | Flow run completed successfully |
FAILED | Flow run failed |
PARTIAL_SUCCEEDED | Flow run partially succeeded (some items failed) |
Handling webhooks
Here’s an example of how to handle flow webhook payloads in your application:Best practices
Secure your webhook endpoint
Secure your webhook endpoint
Always use HTTPS for your webhook URL and include an authentication header in your callback configuration. Verify this header in your webhook handler to ensure requests are coming from Edges.
Respond quickly
Respond quickly
Your webhook endpoint should respond with a 2xx status code within a few seconds. If you need to do heavy processing, acknowledge the webhook first and process asynchronously.
Handle retries gracefully
Handle retries gracefully
Edges may retry failed webhook deliveries. Make your webhook handler idempotent by checking if you’ve already processed a given
flow_run_uid.Handle errors
Handle errors
Always check the
status field and handle error cases. If status is FAILED, check the error field for details about what went wrong.
