Web UI
Use this page to check the browser routes, authentication, screens, and responsive behaviour.
afe serve --ui serves a web UI on the API's own host and port. It is a static bundle that lives in
the afe-web Python package: no Node.js runs at serving time and nothing else is deployed.
export AFE_API_TOKEN=$(openssl rand -hex 32)
afe serve -c config/ --ui # open http://127.0.0.1:8765/
afe worker -c config/ # in another terminal: the UI shows the tickets it runs
Sign in
The UI asks for the engine's API token once. POST /auth/login sets an HttpOnly,
SameSite=Strict session cookie (signed with a key derived from the token, and Secure behind
HTTPS), so the JavaScript never holds the token. A session lasts 8 hours by default
(--session-hours). GET /auth/session tells the page whether it is signed in; a lost connection
that comes back 401 sends the user back to the login. The /rpc WebSocket accepts that cookie
only when the request's Origin is the server's own. The CLI keeps using the bearer token.
"Log out" calls POST /auth/logout, which ends the session. A session can also end while a page is
open, and the socket then closes with 4401. The UI goes back to the login and, after you sign in,
returns to the page you were on.
Screens
| Route | Page | What it does |
|---|---|---|
/ | Dashboard | tickets by state, filters, a search, and the ticket list with cost, sortable by any column (see below); a row opens the ticket |
/tickets/:id | Ticket | header and totals with cached and fresh tokens, the pending request, the flow's BPMN with the current node, the live timeline, the artifacts; pause, cancel, resume and rerun |
/approvals | Approvals | every ticket waiting for a person, read from the server a page at a time and answered in place |
/flows, /flows/:name | Flows | the flows of the current revision, each with its BPMN and a start button |
/flows/:name/start | Start a ticket | a form generated from the flow's input Schema; ?rerun=<id> fills it from a ticket |
/revisions/:id | Revision | a revision and its manifests, read-only YAML |
/workers | Workers | the live workers and the queue, refreshed at 2, 5 or 10 s, or paused |
/audit | Audit trail | the audit trail, newest first, with filters (see below) |
The Dashboard reads pages of 100 tickets, the most recent first. "Load more" adds the next page.
The counts by state come from ticket.counts and cover every ticket the caller sees, not only the
pages loaded. The state, flow and search filters and the column sort run on the server
(ticket.list), so each change starts again from the first page. The search is sent 300 ms after
the last key, and the flow menu comes from flow.list.
Approvals asks the server for the tickets with an unanswered request, the longest wait first. "Load more"
adds the next page. The badge on the Approvals link and the number on its page come from ticket.counts,
so they cover every ticket and not the loaded pages. When the count cannot be read, the badge shows a dash.
When a ticket changes while you have loaded more than the first page, the list does not move under you. A "New items" chip appears instead. Click it to start again from the first page.
The Ticket page reads the newest events first, 100 at a time. "Earlier events" loads the page before. The node panel asks the server for the last events of the selected node. Without a selection it follows the node the server highlights, which is the pending request's node, else the last node with an event.
The UI translates the engine's own questions from a message code and its params. A budget alert, a
loop and a hand-over read in the language you chose. A flow's own question stays as its author wrote it.
The UI asks the engine what the signed-in caller may reach, and shows only that. Permissions, the
sort columns, the search limit, the state order and the audit filters all come from caller.get and
meta.get, so the UI holds no copy of them:
- The Dashboard, the ticket list, Approvals and Ticket show only the tickets of projects the caller may see.
- The start form lists only the projects where the caller may start the flow. A flow with
can_startfalse offers no start. - Pause, cancel, resume, answer and rerun appear only when the ticket's
actionslist them. Nothing is disabled: a forbidden action is absent. - Workers and Revision, and their links, appear only when
capabilitieslists them. - Audit trail appears when
capabilities.auditis true, and the project filter offersaudit_projects. - A person with no role in any project sees a message that says they have no project yet.
Audit trail
The page reads audit.list, newest first, a page at a time. "Load more" adds the next page. A
global administrator sees every entry. A project administrator sees only the entries of its projects.
The page follows no live events. When the connection comes back, it reads the first page again and keeps the other loaded pages. If more than the first page is loaded, a "New items" chip appears. Click it to drop the loaded pages and read the first page again. A "Load more" already in flight is dropped, so no entry is skipped.
A change of filters starts again from the first page even while the connection is coming back: the pages of the filter you left are dropped at once.
Filters: a time range (From, To), one project, one caller id, one action (such as ticket.cancel
or project.access), one object id, and the outcome (accepted or refused).
An entry opens to its details: the sequence number and what the action carried. The entries cannot be
changed or deleted from the page. Export stays in the CLI: see afe audit.
A human node may name the actions whose answer needs a comment:
approve:
type: human
actions: [approve, reject]
requireComment: [reject]
On the Ticket and Approvals pages such an action opens a confirmation whose comment is required.
The engine refuses the answer without one, from the UI, the CLI or the API (INVALID_INPUT).
Every screen updates live from one events.subscribe on /rpc, shows a loading, empty and error
state, and reconnects with a banner when the WebSocket drops. If the server closes the connection (for example with 4008) and 5 reconnections in a row bring no event, the UI stops trying. It then shows the "Connection lost" banner (layout.offline). Reload the page. The UI speaks English and Italian from
one message file per language; the choice is remembered in the browser, and dates, numbers and costs
follow the locale. The BPMN is laid out automatically (bpmn-auto-layout) and shown read-only with
zoom and pan (bpmn-js); the bpmn.io watermark stays, as its licence asks.
In a ticket, a red dot marks the current node; a click on a node, gateway or pause event shows
its id, type and last events. It borders the node in blue. The pause events (the dashed circles on the
agent tasks: the agent may stop for its budget or the loop guard and wait for a person) sit on
their task's top-right corner. The diagram opens centred in a box as tall as the diagram, between
160 px and 60 % of the window's height; "Fit" fits it and centres it again.
On a phone and a tablet
The UI works from 360 px up and never scrolls sideways: long ids, JSON and YAML wrap or scroll inside their own box. It follows Material UI's breakpoints:
| Width | Layout |
|---|---|
| below 600 px (phone) | the layout below |
| 600–899 px (tablet) | the desktop pages, stacked in one column; tables keep every column |
| from 900 px (desktop) | side by side, as described above |
On a phone:
- App bar: the menu,
afeand the waiting bell. The language and "Log out" sit at the bottom of the navigation drawer. - Touch: every button, link row and card is at least 40 px tall, and nothing needs hover.
- Dashboard: the counts by state are one row of chips, every state with its number. The search comes first, the state and flow filters share the line below. Each ticket is a card (id, state, flow, round, cost, and project when set) that opens the ticket. A "Sort by" menu and an arrow button replace the column headers.
- Ticket: the id, the state under it, then the actions. The details and totals are one per line. The request panel's comment and buttons take the full width. The diagram, its node panel, the events and the artifacts follow in that order.
- BPMN: the diagram opens at 100 %, centred on the ticket's current node (or
START) when it is wider than the screen. Drag with one finger to pan and pinch to zoom; over the diagram the page does not scroll. Tapping a node opens its panel and scrolls to it. - Approvals, Flows, Start, Workers: cards, fields and buttons take the full width. The workers are cards (worker, host, pid, tickets over concurrency, last seen). The flow's revision chip shows the first 12 characters of the id.
What it does not do
- It does not edit flows or manifests, and it does not draw flows.
- It does not edit roles. They change only through the
accessblock of theProjectmanifest. - It has no dark theme.
- It is not an installable app (PWA): no offline use and no push notifications.
See also
- CLI for starting the server and worker.
- API for the WebSocket protocol.
- Ticket states for lifecycle values shown by the UI.