HTTP API routes and admin web UI handlers for workflow management.
API Endpoints (canonical): GET /api/v1/workflow/instances?entity-type=&entity-id= — an entity's instances GET /api/v1/workflow/instances/:id — current state + metadata GET /api/v1/workflow/instances/:id/audit — full audit log POST /api/v1/workflow/instances — start a new workflow instance POST /api/v1/workflow/instances/:id/transition — execute a transition
Compatibility: /api/workflow/* redirects to /api/v1/workflow/* via versioning middleware.
Admin Web UI (mounted under /web/admin): GET /workflows — list all workflow instances GET /workflows/:id — instance detail with state viz + audit trail
Every route requires authentication: the API answers 401 without it, the
admin pages send to the login form. Instances live in the tenant's schema,
read through the request's tenant-bound transaction, so every route also
refuses a caller outside the request's tenant with 403. The API's reads,
and starting an instance, need an admin or a :workflow/read grant; the
admin pages need an admin. In a tenant, both are the tenant's: its admins
(access/tenant-admin?) and grants scoped {:tenant-id <its id>}.
HTTP API routes and admin web UI handlers for workflow management.
API Endpoints (canonical):
GET /api/v1/workflow/instances?entity-type=&entity-id= — an entity's instances
GET /api/v1/workflow/instances/:id — current state + metadata
GET /api/v1/workflow/instances/:id/audit — full audit log
POST /api/v1/workflow/instances — start a new workflow instance
POST /api/v1/workflow/instances/:id/transition — execute a transition
Compatibility:
/api/workflow/* redirects to /api/v1/workflow/* via versioning middleware.
Admin Web UI (mounted under /web/admin):
GET /workflows — list all workflow instances
GET /workflows/:id — instance detail with state viz + audit trail
Every route requires authentication: the API answers 401 without it, the
admin pages send to the login form. Instances live in the tenant's schema,
read through the request's tenant-bound transaction, so every route also
refuses a caller outside the request's tenant with 403. The API's reads,
and starting an instance, need an admin or a :workflow/read grant; the
admin pages need an admin. In a tenant, both are the tenant's: its admins
(`access/tenant-admin?`) and grants scoped {:tenant-id <its id>}.(handle-find-instances engine request)GET /api/v1/workflow/instances?entity-type=…&entity-id=…
The entity's instances, one per workflow it is in; [] for none. Without their available transitions: GET /instances/:id has those.
GET /api/v1/workflow/instances?entity-type=…&entity-id=… The entity's instances, one per workflow it is in; [] for none. Without their available transitions: GET /instances/:id has those.
(handle-get-audit-log engine request)GET /api/v1/workflow/instances/:id/audit
GET /api/v1/workflow/instances/:id/audit
(handle-get-instance engine request)GET /api/v1/workflow/instances/:id
GET /api/v1/workflow/instances/:id
(handle-get-instance-web store registry admin request)GET /workflows/:id — render the workflow instance detail page. An id that is not a UUID names no instance: 404, like an unknown one.
GET /workflows/:id — render the workflow instance detail page. An id that is not a UUID names no instance: 404, like an unknown one.
(handle-list-instances-web store registry admin request)GET /workflows — render the workflow instances list page.
GET /workflows — render the workflow instances list page.
(handle-start-workflow engine request)POST /api/v1/workflow/instances
POST /api/v1/workflow/instances
(handle-transition engine request)POST /api/v1/workflow/instances/:id/transition
POST /api/v1/workflow/instances/:id/transition
The grant that lets a non-admin read instances and their audit through the API.
The grant that lets a non-admin read instances and their audit through the API.
(workflow-routes engine)(workflow-routes engine group-service)Reitit route data for the workflow API. Mounted under /api/v1.
The POST routes declare their body schema, which is what makes
[:parameters :body] exist. Without it the handlers read nil whatever the
caller sent, and a POST was answered from an empty body rather than
refused (BOU-478).
Every route requires a signed-in user. The global authenticate-if-present
sets :user from a bearer token or a session; the interceptor refuses the
request without one, with the same 401 the scaffolded APIs give.
Args: engine - WorkflowService (IWorkflowEngine) group-service - IUserGroupService, for the :workflow/read grant; nil admits only admins to the reads
Reitit route data for the workflow API. Mounted under /api/v1.
The POST routes declare their body schema, which is what makes
`[:parameters :body]` exist. Without it the handlers read nil whatever the
caller sent, and a POST was answered from an empty body rather than
refused (BOU-478).
Every route requires a signed-in user. The global `authenticate-if-present`
sets `:user` from a bearer token or a session; the interceptor refuses the
request without one, with the same 401 the scaffolded APIs give.
Args:
engine - WorkflowService (IWorkflowEngine)
group-service - IUserGroupService, for the :workflow/read grant; nil
admits only admins to the reads(workflow-web-routes store registry user-service admin)Web routes for the workflow admin UI, as Reitit data.
Routes are mounted under /web/admin by the HTTP handler: GET /web/admin/workflows — list all workflow instances GET /web/admin/workflows/:id — instance detail + audit trail
Route-level :middleware is Reitit's own and applies to every endpoint
beneath it — the :meta wrapper this used to need is gone (ADR-037).
Args: store - IWorkflowStore registry - IWorkflowRegistry user-service - IUserService (for authentication middleware) admin - {:logo-url} for the admin shell, or nil
Web routes for the workflow admin UI, as Reitit data.
Routes are mounted under /web/admin by the HTTP handler:
GET /web/admin/workflows — list all workflow instances
GET /web/admin/workflows/:id — instance detail + audit trail
Route-level `:middleware` is Reitit's own and applies to every endpoint
beneath it — the `:meta` wrapper this used to need is gone (ADR-037).
Args:
store - IWorkflowStore
registry - IWorkflowRegistry
user-service - IUserService (for authentication middleware)
admin - {:logo-url} for the admin shell, or nilcljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |