Skip to main content
Use the official @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

The SDK targets Node.js 18+ (uses the global fetch) and ships with TypeScript types.

Authentication

Set the FETCH_HIVE_API_KEY environment variable to your workspace API key:
Or pass the key explicitly:
See API Keys for how to create and rotate keys.

Basic example

Run a workflow deployment directly. The call blocks until the workflow finishes:
See the direct response shape.

Method reference

Handling the response

Callback delivery

Pass an async block to return immediately and have Fetch Hive call your callback URL when the run finishes:
Store the 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

For long-running direct workflow requests, prefer async: { enabled: true, ... } over increasing client-side timeouts.

Errors

Non-2xx responses throw an Error whose message includes the status code and response body:
See Error Handling for workflow-specific failure cases and Errors and Rate Limits for HTTP status code meanings.

Next steps