- API invoke starts a run through
POST /v1/workflow/invokewith a workspace API key. - Webhook trigger starts a deployed variant through
POST /v1/workflow/webhooks/...with the deployment webhook secret. - Callback delivery returns immediately and later sends a signed completion event to
async.callback_url.
async for API compatibility, but the product behavior is callback delivery.
Overview
The workflow deployment helper exposes API invocation and webhook triggering for the selected deployment variant. Webhook triggers use the deployment webhook secret and do not require a workspace API key. API invoke requests can choose direct delivery or callback delivery. When you includeasync.callback_url, Fetch Hive returns immediately and later delivers a signed callback event to that URL.
Webhook triggers always use callback delivery. They require async.callback_url, return quickly, and deliver the final result only through the signed callback event.
The same deployment secret is used in both directions. A caller proves it can start the deployed workflow by sending the secret in X-Fetch-Hive-Webhook-Secret. Your callback receiver proves the later event came from Fetch Hive by verifying X-Fetch-Hive-Signature with HMAC SHA256 and that same secret.
How do I trigger a workflow by webhook?
Open More in the workflows sidebar and click Get Code, or open Code Snippet from a workflow deployment page. Select the Deployment and Variant you want to trigger, then open the Webhook trigger tab. Copy the webhook URL and send aPOST request with the deployment secret in X-Fetch-Hive-Webhook-Secret:
?secret=YOUR_WEBHOOK_SECRET as a fallback. Prefer the header whenever the provider supports it.
Use the deployment webhook secret shown in the helper. This is the same secret Fetch Hive uses to sign callback delivery events for this deployment.
When the body has an inputs object, Fetch Hive uses that object as the workflow start inputs. If the body is a JSON object without inputs, Fetch Hive treats the whole object as workflow inputs.
You can also include optional user and metadata fields beside inputs. The async.callback_url field is required:
metadata is caller-defined user metadata for audit and log filtering. It must be a flat object whose values are strings, numbers, booleans, or null; nested objects and arrays return a validation error before the run starts. To send metadata, use the wrapped body shape shown above with metadata beside inputs. If you omit inputs, the whole JSON object is treated as workflow inputs, so metadata is not extracted as log-filter metadata.
Webhook-triggered runs appear under Source: Webhook in workflow logs and show Delivery: Callback with callback delivery logs.
How do I enable callback delivery for API invoke?
Open More in the workflows sidebar and click Get Code, or open Code Snippet from a workflow deployment page. Select the Deployment and Variant you want to invoke. Turn on Callback delivery. The cURL snippet updates to include:How do I verify callback signatures?
Turn on Callback delivery in the code snippet dialog, or open the Webhook trigger tab. Copy the Signing secret shown below the snippet, or view the same secret from the workflow deployment details page. When your server receives the callback event, verify theX-Fetch-Hive-Signature header using HMAC SHA256 and that signing secret.
Treat any callback event that fails signature verification as untrusted.
If the workflow was started by the webhook trigger, this signing secret is the same value the triggering system sent in X-Fetch-Hive-Webhook-Secret. The inbound trigger check is a bearer-style secret check; the outbound callback check is HMAC signature verification.
What response do I get from callback delivery?
When callback delivery is enabled, the public route returns immediately instead of waiting for the workflow output. The API invoke route can return arunning state:
queued state:
request_id for your own request tracking, and rely on callback delivery for the final result.
Workflow webhook triggers also return quickly:
What validation rules apply to callback delivery?
Ifasync.enabled is true, callback_url is required.
Webhook triggers always require async.callback_url.
Fetch Hive also validates that callback_url is a valid URL.
Workflows that contain a Human in the Loop step always require callback delivery, even for API invoke requests. They cannot complete synchronously because Fetch Hive pauses the workflow until the selected workspace member responds.
For example, these errors are explicitly confirmed:
What callback events does Fetch Hive emit?
Every callback delivery has the same envelope:event_type field tells you which terminal state the workflow reached:
workflow.completed- the workflow finished successfully.data.outputcontains the final output value.workflow.failed- the workflow errored during execution.data.errorcontains the error message.workflow.cancelled- the workflow was cancelled before it could complete, either by a user in the Fetch Hive dashboard or directly via the orchestrator.data.errorcontains the cancellation reason, anddata.reasonis always the string"cancelled"so you can branch without parsing the message.
workflow.completed includes a structured output object:
data.output.settings(model and settings used)data.output.assets(generated uploaded assets)
workflow.cancelled payload:
workflow.cancelled as a terminal state on your side. No further callback event will be delivered for that request_id. The workflow run’s partial progress, including any completions that finished before the cancel, is still available via the run detail view and the Logs endpoints.

