HIL Inbox Overview
The HIL Inbox is the task queue in WorkDesk where pending Human-in-the-Loop tasks accumulate. When a workflow reaches a HIL node targeting you, the task appears here instantly via EdgeStream push — requiring no page refresh.
Three Task Types
Approval
Binary decision — Approve or Reject. A comment field lets you explain your decision. Most common for sign-off workflows.
Form
An Atlas Form rendered inline. Fill structured fields and submit. The form data is passed as output to the next workflow node.
Review
Read-only content displayed for inspection. Acknowledge with a click. Optional comment for audit trail. Used for document and report review.
Task Lifecycle
Tasks can also transition to Expired if the dueAt timestamp passes without action. The workflow designer configures whether expired tasks trigger a timeout branch or cancel the workflow.
Badge Count System
The inbox section link in the WorkDesk sidebar shows a live badge count. The count is maintained by a Zustand store that updates via EdgeStream subscription — no manual refresh needed.
| Badge Color | Meaning |
|---|---|
| N | N pending tasks — none are overdue |
| N | N pending tasks — at least one is overdue (past dueAt) |
| No badge | Inbox is empty — no pending tasks |
Real-Time Updates
WorkDesk subscribes to tasks.{userId} on EdgeStream. When a new HIL task is routed to the actor, the backend publishes an event to this topic. The WorkDesk inbox store receives the event and immediately adds the task to the list — the employee sees it appear in real time without refreshing the page.
// Inbox store — EdgeStream subscription
import { useSubscription } from '@bizfirstai/edge-stream-react';
import { useInboxStore } from '../stores/inboxStore';
function useInboxRealtime(userId: string) {
const { addTask, incrementCount } = useInboxStore();
useSubscription(`tasks.${userId}`, (event) => {
if (event.type === 'task_assigned') {
addTask(event.payload.task);
incrementCount();
}
if (event.type === 'task_completed_by_other') {
// Remove task if a colleague acted on it (multi-actor scenario)
removeTask(event.payload.taskId);
}
});
}
API Overview
| Endpoint | Purpose |
|---|---|
GET /api/workdesk/inbox | List pending tasks for current user (paginated, filterable) |
GET /api/workdesk/inbox/count | Fast count query — used by badge and dashboard widget |
GET /api/workdesk/tasks/{taskId} | Single task detail — includes full context and form metadata |
POST /api/workdesk/tasks/{taskId}/claim | Claim a task (optional — locks task to caller) |
DELETE /api/workdesk/tasks/{taskId}/claim | Release a claim |
POST /api/executions/{executionId}/resume | Submit HIL response — resumes the workflow |
GET /api/workdesk/tasks/completed | Recently completed tasks (last 30 days) |