Approval
Approval protocol schemas
Approval Step Approver Type
Source: packages/spec/src/automation/approval.zod.ts
TypeScript Usage
import { ApprovalAction, ApprovalActionType, ApprovalProcess, ApprovalStep, ApproverType } from '@objectstack/spec/automation';
import type { ApprovalAction, ApprovalActionType, ApprovalProcess, ApprovalStep, ApproverType } from '@objectstack/spec/automation';
// Validate data
const result = ApprovalAction.parse(data);ApprovalAction
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| type | Enum<'field_update' | 'email_alert' | 'webhook' | 'script' | 'connector_action'> | ✅ | |
| name | string | ✅ | Action name |
| config | Record<string, any> | ✅ | Action configuration |
| connectorId | string | optional | |
| actionId | string | optional |
ApprovalActionType
Allowed Values
field_updateemail_alertwebhookscriptconnector_action
ApprovalProcess
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | Unique process name |
| label | string | ✅ | Human readable label |
| object | string | ✅ | Target Object Name |
| active | boolean | ✅ | |
| description | string | optional | |
| entryCriteria | string | optional | Formula to allow submission |
| lockRecord | boolean | ✅ | Lock record from editing during approval |
| steps | Object[] | ✅ | Sequence of approval steps |
| escalation | Object | optional | SLA escalation configuration for pending approval steps |
| onSubmit | Object[] | optional | Actions on initial submission |
| onFinalApprove | Object[] | optional | Actions on final approval |
| onFinalReject | Object[] | optional | Actions on final rejection |
| onRecall | Object[] | optional | Actions on recall |
ApprovalStep
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | Step machine name |
| label | string | ✅ | Step display label |
| description | string | optional | |
| entryCriteria | string | optional | Formula expression to enter this step |
| approvers | Object[] | ✅ | List of allowed approvers |
| behavior | Enum<'first_response' | 'unanimous'> | ✅ | How to handle multiple approvers |
| rejectionBehavior | Enum<'reject_process' | 'back_to_previous'> | ✅ | What happens if rejected |
| onApprove | Object[] | optional | Actions on step approval |
| onReject | Object[] | optional | Actions on step rejection |
ApproverType
Allowed Values
userrolemanagerfieldqueue