Workflows
Base URL: https://app.neureus.ai
Auth: Authorization: Bearer <api_key>
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /workflows | Create a workflow definition |
GET | /workflows | List workflow definitions |
GET | /workflows/:id | Get workflow |
PUT | /workflows/:id | Update workflow |
DELETE | /workflows/:id | Delete workflow |
POST | /workflows/:id/execute | Start a workflow run |
GET | /workflows/:id/runs/:runId | Get run status |
GET | /workflows/approvals | List pending approvals |
POST | /workflows/approvals/:id/decide | Approve 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:
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.