Approval Workflow API
Visual workflow definitions with versioning, publishing lifecycle, and human approval task management.
| Field | Value |
|---|---|
| Port | Via API Gateway (8080) |
| Base Path | /api/v1 |
| Source | Frontend service integration (no OpenAPI spec) |
Workflow Definitions
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/workflows | List workflows (paginated, filterable) |
| POST | /api/v1/workflows | Create workflow definition |
| GET | /api/v1/workflows/{id} | Get workflow details |
| PUT | /api/v1/workflows/{id} | Update workflow |
| DELETE | /api/v1/workflows/{id} | Delete workflow |
Workflow Versioning & Lifecycle
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/workflows/{id}/versions | List versions |
| POST | /api/v1/workflows/{id}/versions | Create new version |
| POST | /api/v1/workflows/{id}/publish | Publish workflow |
| GET | /api/v1/workflows/{id}/instances | List running instances |
Approval Tasks
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/tasks | List user's tasks |
| GET | /api/v1/tasks/{id} | Get task details |
| POST | /api/v1/tasks/{id}/claim | Claim task |
| POST | /api/v1/tasks/{id}/complete | Complete task (with form data) |
| POST | /api/v1/tasks/{id}/delegate | Delegate to another user |
| POST | /api/v1/tasks/bulk/claim | Bulk claim multiple tasks |
Key Types
WorkflowDefinition
{
id: string;
name: string;
description: string;
status: 'draft' | 'published' | 'archived';
versions: WorkflowVersion[];
createdAt: string;
updatedAt: string;
}
Workflow Node Types (11)
start | approval | condition | parallel-split | parallel-join | notification | timer | script | reject | loop | end
Task Status
pending | claimed | completed | delegated | escalated | expired | cancelled
Instance Status
running | completed | cancelled | error
Frontend Integration
| File | Purpose |
|---|---|
services/approval-workflow/workflow.service.ts | Workflow CRUD & lifecycle |
services/approval-workflow/task.service.ts | Task operations |
services/approval-workflow/useApprovalWorkflow.ts | React Query hook |
types/approval-workflow.types.ts | TypeScript types |
stores/useWorkflowDesignerStore.ts | Zustand canvas state |