API reference
Run a workflow
POST /api/pub/v1/workflows/{workflowId}/run, fill a workflow's fields and start the task it composes.
POST
https://api.dhanu.ai/api/pub/v1/workflows/{workflowId}/runFills the workflow’s fields and starts the task its prompt composes, assigned to
the workflow’s suggested staff member when it has one. Values are validated
server-side against the stored field definitions; a missing required field or a
value of the wrong type is invalid_workflow_values with an issues list.
Request
| Path parameter | Type | Required | Notes |
|---|---|---|---|
workflowId | string | Yes |
| Field | Type | Required | Notes |
|---|---|---|---|
values | object | Yes | One entry per field key; required fields must be present. |
curl -X POST https://api.dhanu.ai/api/pub/v1/workflows/$WORKFLOW_ID/run \
-H "Authorization: Bearer $DHANU_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "values": { "topic": "Q3 results", "audience": "board" } }'const task = await dhanu.workflows.run(workflowId, { topic: "Q3 results", audience: "board" });task = dhanu.workflows.run(workflow_id, {"topic": "Q3 results", "audience": "board"}) Response
202 Accepted: the task, as on create a task.
Errors
| Code | Status | Meaning |
|---|---|---|
invalid_api_key | 401 | The bearer key is missing or unknown. |
api_key_revoked | 401 | The key was revoked. |
api_key_expired | 401 | The key passed its expiry date. |
api_key_ip_not_allowed | 403 | The caller's IP is outside the key's allowlist. |
developer_access_revoked | 403 | The key's creator lost developer access in the workspace. |
api_key_project_scope | 403 | The key covers no active projects, or projectId is outside its scope. |
invalid_request_body | 422 | The body did not match the schema; error.issues names each field. |
not_found | 404 | No such resource in the key's workspace. |
invalid_workflow_values | 422 | The workflow values do not satisfy the workflow's fields; error.issues names each one. |