@fetch-hive/sdk package when you want to invoke a workflow deployment from Node.js or TypeScript. The SDK wraps the public POST /v1/workflow/invoke endpoint, handles authentication, and supports both direct responses and callback delivery.
Installation
fetch) and ships with TypeScript types.
Authentication
Set theFETCH_HIVE_API_KEY environment variable to your workspace API key:
Basic example
Run a workflow deployment directly. The call blocks until the workflow finishes:Method reference
| Field | Type | Required | Description |
|---|---|---|---|
deployment | string | Yes | The workflow deployment name |
variant | string | No | The deployment variant name |
inputs | Record<string, unknown> | No | Key-value pairs for the variables defined on the Start step |
async | { enabled: boolean, callback_url?: string } | No | Callback delivery settings |
user | string | No | Opaque caller identifier surfaced in User Tracking |
metadata | Record<string, string | number | boolean | null> | No | Flat caller-defined metadata for audit and log filtering. See Invoke metadata |
Handling the response
Callback delivery
Pass anasync block to return immediately and have Fetch Hive call your callback URL when the run finishes:
webhook_secret so you can verify the signature on the incoming callback. See Callback Delivery and Webhook Triggers for the verification flow and signed payload shape.
Configuration
| Option | Default | Description |
|---|---|---|
apiKey | process.env.FETCH_HIVE_API_KEY | Bearer token from the dashboard |
baseURL | https://api.fetchhive.com/v1 | Override the API base URL |
async: { enabled: true, ... } over increasing client-side timeouts.
Errors
Non-2xx responses throw anError whose message includes the status code and response body:
Links
Next steps
- Callback Delivery and Webhook Triggers - Verify callback signatures
- Run with API - The same flow with cURL
- Run with Python SDK
- Run with Ruby SDK
- Run with PHP SDK
- Invoke Workflow - Full endpoint reference

