ObjectStackObjectStack

Approval

Approval protocol schemas

Source: packages/spec/src/automation/approval.zod.ts

TypeScript Usage

import { ApprovalDecision, ApprovalEscalationSchema, ApprovalNodeApproverSchema, ApprovalNodeConfigSchema, ApproverType, DecisionOutputDefSchema } from '@objectstack/spec/automation';
import type { ApprovalDecision, ApprovalEscalation, ApprovalNodeApprover, ApprovalNodeConfig, ApproverType, DecisionOutputDef } from '@objectstack/spec/automation';

// Validate data
const result = ApprovalDecision.parse(data);

ApprovalDecision

Allowed Values

  • approve
  • reject

ApprovalEscalation

Properties

PropertyTypeRequiredDescription
enabledbooleanEnable SLA-based escalation for this node
timeoutHoursnumberHours before escalation triggers
actionEnum<'reassign' | 'auto_approve' | 'auto_reject' | 'notify'>Action on escalation timeout
escalateTostringoptionalUser id or position machine name to escalate to
notifySubmitterbooleanNotify the original submitter on escalation

ApprovalNodeApprover

Properties

PropertyTypeRequiredDescription
typeEnum<'manager' | 'position' | 'department' | 'team' | 'field' | 'expression' | 'org_membership_level' | 'role' | 'user' | 'queue'>
valuestringoptionalUser id / membership tier / position / team / department / field — per type; for expression, a CEL expression over current.* / trigger.* / vars.*
resolveAsEnum<'user' | 'department' | 'position' | 'team'>optionalHow an expression result is expanded into approvers (default 'user')
groupstringoptionalGroup label for per_group sign-off (e.g. "legal", "finance")
organizationstringoptionalADR-0105 D9 — organization whose directory resolves this approver: $root (group org), $parent (one level up), or an organization slug. Omitted = the request's own organization.

ApprovalNodeConfig

Properties

PropertyTypeRequiredDescription
approvers{ type: Enum<'manager' | 'position' | 'department' | 'team' | 'field' | 'expression' | … +4 more>; value?: string; resolveAs?: Enum<'user' | 'department' | 'position' | 'team'>; group?: string; … }[]Allowed approvers for this node
behaviorEnum<'first_response' | 'unanimous' | 'quorum' | 'per_group'>How to combine multiple approvers
minApprovalsintegeroptionalApprovals required — total (quorum) or per group (per_group). Default 1
lockRecordbooleanLock the record from editing while pending
approvalStatusFieldstringoptionalBusiness-object field to mirror request status onto
onEmptyApproversEnum<'admin_rescue' | 'fail' | 'auto_approve'>Behavior when no concrete approver resolves at node entry
decisionOutputs(string | { key: string; label?: string; type?: Enum<'text' | 'user' | 'department' | 'position' | 'team'>; multiple?: boolean; … })[]optionalAuthor-declared decision outputs — bare keys or typed { key, type, multiple } declarations
escalation{ enabled: boolean; timeoutHours: number; action: Enum<'reassign' | 'auto_approve' | 'auto_reject' | 'notify'>; escalateTo?: string; … }optionalPer-node SLA escalation
maxRevisionsintegerMax send-backs for revision before auto-reject (0 = send-back disabled)

ApproverType

Allowed Values

  • manager
  • position
  • department
  • team
  • field
  • expression
  • org_membership_level
  • role
  • user
  • queue

DecisionOutputDef

Properties

PropertyTypeRequiredDescription
keystringOutput key (the flow variable name under the node id)
labelstringoptionalField label in the decision dialog
typeEnum<'text' | 'user' | 'department' | 'position' | 'team'>optionalDecision-dialog input widget (default 'text')
multiplebooleanoptionalCollect multiple values (id array)
requiredbooleanoptionalApprover must supply this output to approve

On this page