Skip to content

Workflows

Base URL: https://app.neureus.ai
Auth: Authorization: Bearer <api_key>

Endpoints

MethodPathDescription
POST/workflowsCreate a workflow definition
GET/workflowsList workflow definitions
GET/workflows/:idGet workflow
PUT/workflows/:idUpdate workflow
DELETE/workflows/:idDelete workflow
POST/workflows/:id/executeStart a workflow run
GET/workflows/:id/runs/:runIdGet run status
GET/workflows/approvalsList pending approvals
POST/workflows/approvals/:id/decideApprove or reject a HITL step

Workflow steps

A workflow is a sequence of typed steps:

type Step =
| { type: 'ai_completion'; model: string; prompt: string }
| { type: 'rag_query'; query: string }
| { type: 'human_approval'; assigneeRole: 'owner' | 'admin'; timeoutMs?: number }
| { type: 'webhook'; url: string; method: string; body?: object }
| { type: 'condition'; expression: string; then: Step[]; else: Step[] };

Human-in-the-loop (HITL)

When a human_approval step is reached, the workflow pauses and creates an approval request. Call the decide endpoint when ready:

Terminal window
curl -X POST https://app.neureus.ai/workflows/approvals/approval_abc/decide \
-H "Authorization: Bearer nru_your_key" \
-H "Content-Type: application/json" \
-d '{"decision": "approved", "comment": "Looks good"}'

decision must be "approved" or "rejected". Rejected workflows stop immediately. The decided_by field is always taken from the authenticated session — it cannot be set in the request body.