diff --git a/.changeset/37353-approver-expression-string.md b/.changeset/37353-approver-expression-string.md new file mode 100644 index 00000000000..eaa7858a038 --- /dev/null +++ b/.changeset/37353-approver-expression-string.md @@ -0,0 +1,10 @@ +--- +'@objectstack/skills': patch +--- + +docs(skills): `objectstack-automation` spells an `expression` approver's `value` as the plain CEL string the schema accepts + +Clause-②: no +Metadata-protocol: none + +`skills/objectstack-automation/references/state-machines-and-approvals.md`, *Dynamic approvers*: the three fragments wrote the approver's `value` with the `cel` tag, which builds a `{ dialect, source }` object. `ApprovalNodeApproverSchema.value` is a string, so an approval node copied from them failed validation with `expected string, received object`. They now read `value: 'current.co_review_departments'`, `value: 'vars.lead_review.next_reviewers'` and `value: 'current.picked_departments'`, the spelling the end-to-end flow below them already used. The `expression` row of the approver table says `value` is the expression string. The file is two bytes shorter and its token ceiling is unchanged. diff --git a/skills/objectstack-automation/references/state-machines-and-approvals.md b/skills/objectstack-automation/references/state-machines-and-approvals.md index da8e2b8c552..2d257aac9a3 100644 --- a/skills/objectstack-automation/references/state-machines-and-approvals.md +++ b/skills/objectstack-automation/references/state-machines-and-approvals.md @@ -226,7 +226,7 @@ an id that does not exist gets. | `manager` | The submitter's manager (`sys_user.manager_id`) | | `field` | User id read from a record field (`value` = field name). Resolved against the record's **live** state at node entry, so a field written mid-flow routes correctly; a multi-select user field fans out into one approver per user | | `queue` | Members of ownership queue `value` at node entry; an empty queue adds nobody. In a packaged flow, see below | -| `expression` | A **CEL expression** resolved at node entry (`value` = the expression) — see **Dynamic approvers** below. The optional `resolveAs: 'user'(default) \| 'department' \| 'position' \| 'team'` re-expands each resolved id through the graph | +| `expression` | A **CEL expression** resolved at node entry (`value` = the expression string) — see **Dynamic approvers** below. The optional `resolveAs: 'user'(default) \| 'department' \| 'position' \| 'team'` re-expands each resolved id through the graph | **A packaged flow's `queue` approver** (ADR-0150 D3) resolves `value` as a packaged assignment rule does (SKILL.md § Assignment rules), from the package @@ -260,16 +260,16 @@ slate — guard genuinely-optional inputs explicitly, e.g. ```typescript // ① Route on a field an EARLIER approver filled in mid-flow (live value): -{ type: 'expression', value: cel`current.co_review_departments`, resolveAs: 'department' } +{ type: 'expression', value: 'current.co_review_departments', resolveAs: 'department' } // ② The previous approval node's decision outputs pick this node's approvers: -{ type: 'expression', value: cel`vars.lead_review.next_reviewers` } +{ type: 'expression', value: 'vars.lead_review.next_reviewers' } // ③ Dynamic co-sign: expression yields department ids; resolveAs expands // each into its members, and with behavior: 'per_group' EACH department is // its own sign-off group: { - approvers: [{ type: 'expression', value: cel`current.picked_departments`, resolveAs: 'department' }], + approvers: [{ type: 'expression', value: 'current.picked_departments', resolveAs: 'department' }], behavior: 'per_group', onEmptyApprovers: 'fail', }