Portal Community

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

Pending
Awaiting action
Claimed
Locked to actor
Completed
Response submitted

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 ColorMeaning
NN pending tasks — none are overdue
NN pending tasks — at least one is overdue (past dueAt)
No badgeInbox 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

EndpointPurpose
GET /api/workdesk/inboxList pending tasks for current user (paginated, filterable)
GET /api/workdesk/inbox/countFast 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}/claimClaim a task (optional — locks task to caller)
DELETE /api/workdesk/tasks/{taskId}/claimRelease a claim
POST /api/executions/{executionId}/resumeSubmit HIL response — resumes the workflow
GET /api/workdesk/tasks/completedRecently completed tasks (last 30 days)