Overview
This endpoint allows you to execute a specific workflow by providing its ID and required input parameters. The response is returned after the model finishes generating — ideal for server-side integrations where you don’t need real-time streaming.Endpoint
- HTTP Method: POST
-
URL:
/api/v1/run/{workflow_id}
Replace{workflow_id}with the actual workflow ID (e.g.wf_abc123).
Features
Full Response
Receive the complete generated output in a single JSON response.
Bearer Key Auth
Authenticate with your API secret key via the Authorization header.
Web Search Citations
Automatically receive source citations when the model uses web search.
Rate Limit Headers
Monitor your usage with rate limit headers in every response.
Authentication
Requires a Bearer token in theAuthorization header.
Request
Path Parameters| Name | Required | Type | Description |
|---|---|---|---|
| workflow_id | Yes | string | The ID of the workflow to run (e.g. wf_abc123) |
application/json
Pass your workflow’s input variables as key/value pairs. The keys must match the variable names defined in your workflow template.
Example Request
Response
A successful response returns the full generated text and optional citations:| Field | Type | Description |
|---|---|---|
| success | boolean | Always true on success |
| result | string | The generated text output |
| citations | string[] | Optional. Web sources if the model used web search |
| Header | Description |
|---|---|
| x-ratelimit-limit | Your rate limit per window |
| x-ratelimit-remaining | Remaining requests in window |
Error Responses
401 Unauthorized
401 Unauthorized
402 Payment Required
402 Payment Required
No credits remaining on the account.
404 Not Found
404 Not Found
Workflow not found or not published.
429 Too Many Requests
429 Too Many Requests
Rate limit exceeded.
500 Internal Server Error
500 Internal Server Error
Something went wrong during execution.
Code Examples
Python
Python
Node.js
Node.js
cURL
cURL
Additional Notes
-
Input Variables: The request body keys must exactly match the variable names in your workflow template (e.g.
{{story}}). - Max Duration: Requests can run for up to 300 seconds before timing out.
- Credits: Each successful run deducts credits from your organization’s balance based on token usage.
- Streaming Alternative: If you need real-time output as it’s generated, use the Streaming Workflow endpoint instead.
