How to configure workflows
Workflows are stored as configuration. Adjust stages, approval roles, and options per workflow type.
1. View workflow configuration
Use GET /api/workflow/config to list all workflow types, or GET /api/workflow/config/{workflowType} for one (e.g. purchase_request, stock_transfer). Each config has stages (order, name, action) and stage options (requiresApproval, approvalRoles, scanMode, etc.).
2. Change stages or options
Use PUT /api/workflow/config/{workflowType} to update. Add or remove stages, set approval roles for a stage, or change scan mode (item, bundle, both). Transitions define allowed moves between stages.
3. Use the inbox
Users see pending items in GET /api/workflow/inbox (or /api/workflow/inbox/{module}). Each item shows reference, current stage, and required action. Advance via POST /api/workflow/instances/{id}/advance with optional payload; reject via /reject.
4. Delegation and SLA
Create delegation rules so another user can act on approvals when someone is away. Configure per-stage SLA (hours) and escalation; optional reminders and auto-approve on timeout.