X Enterprises
nuxt-x-app

Workflow

Workflow automation components for multi-step approval processes with sequential and parallel approval modes.

Workflow

The Workflow category provides components for building structured approval and review processes. XAWorkflowApproval renders a complete approver list with status indicators, inline approve/reject/request-changes actions, optional delegation, a comment modal, and a full decision history panel.

Components

<XAWorkflowApproval />

A self-contained approval widget. It accepts an approvers array and manages the interaction flow for whoever is the current approver. In sequential mode, approvers must act in order (a step connector line is rendered between cards); in parallel mode any approver can act independently. A modal collects optional or required comments before submitting a decision.

An overall status badge (pending / approved / rejected / changes_requested) is computed from the approvers array and displayed in the header.

<XAWorkflowApproval
  title="Contract Review"
  description="Please review and approve the vendor contract."
  :approvers="approvers"
  mode="sequential"
  :current-step="currentStep"
  :require-comment="false"
  :allow-delegation="true"
  :allow-changes-request="true"
  :show-history="true"
  size="md"
  @approve="(approver, index, comment) => submitApproval(approver, comment)"
  @reject="(approver, index, comment) => submitRejection(approver, comment)"
  @request-changes="(approver, index, comment) => submitChanges(approver, comment)"
  @delegate="(approver, index) => openDelegateModal(approver)"
/>

Approver Object Shape

interface Approver {
  id?: string | number
  name: string
  email?: string
  avatar?: string
  role?: string
  status: 'pending' | 'approved' | 'rejected' | 'changes_requested'
  decision?: {
    action: 'approved' | 'rejected' | 'changes_requested'
    comment?: string
    timestamp: Date | string
    attachments?: Array<{ name: string; url: string }>
  }
  delegatedTo?: {
    name: string
    email?: string
  }
}

Props

PropTypeDefaultDescription
approversApprover[]requiredList of approvers with their current status and optional decision.
modeString'sequential'Approval mode — 'sequential' (ordered) or 'parallel' (any order).
titleString'Approval Required'Panel heading.
descriptionStringOptional subtitle below the heading.
currentStepNumber0Zero-based index of the active approver in sequential mode.
requireCommentBooleanfalseWhen true, a comment is required before a decision can be submitted.
allowDelegationBooleantrueShow the Delegate button for the current approver.
allowChangesRequestBooleantrueShow the Request Changes button for the current approver.
showHistoryBooleantrueRender the decision history section below the approver list.
showModeIndicatorBooleantrueShow the sequential/parallel mode indicator banner.
sizeString'md'Component size — 'sm' or 'md'. Affects avatar sizes.

Events

EventPayloadDescription
approve(approver, index, comment?)Approver clicked Approve.
reject(approver, index, comment)Approver clicked Reject.
requestChanges(approver, index, comment)Approver clicked Request Changes.
delegate(approver, index)Approver clicked Delegate.
statusChange(status: string)Overall approval status changed.

AI Context

category: Workflow
package: "@xenterprises/nuxt-x-app"
use-when: >
  Use XAWorkflowApproval whenever a record (document, request, contract, etc.) requires
  sign-off from one or more people. Pass the approvers array with each person's current
  status; the component handles the visual state machine, comment collection modal,
  and action buttons automatically. Choose mode="sequential" when approvals must happen
  in order (e.g. manager then director) and mode="parallel" when any approver can
  act independently. Listen to the approve/reject/requestChanges events to persist
  decisions to your backend.
Copyright © 2026