You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 83b5ec5
Browse filesBrowse the repository at this point in the historyBrowse files
docs(skills): objectstack-automation teaches the emailField recipient, flow requiredPermissions, excludeSubmitter and the screen file field
Four audit rows the package taught nowhere, each in the fewest lines an AI
author needs:
- `notify.recipients` has a fourth form, `{ emailField }` — an `email`-typed
field of the trigger record, for a person who is not a user; the node then
names `channels: 'email'` alone. A CEL envelope must yield user ids, and an
address no user holds fails the node at run time (the trap SKILL.md's
"id, list, or envelope" line set).
- flow-level `requiredPermissions` — who may START a flow, checked at every
door that starts it by name; not a `current_user.positions` check inside it.
- `excludeSubmitter` in the approval config table — segregation of duties;
refused beside `onEmptyApprovers: 'auto_approve'`.
- the screen field typed `file` — the run resumes with the `sys_file` id,
which a later record write claims.
Three eval prompts, one per teaching. Paid down first: the CRM Blueprint's
approval row that restated the approvals reference, and Best Practices 1 and
4 that restated the Branching section; the measured remainder raises the
three token-ratchet rows, quoting the maintainer's ruling.
Claude-Session: https://claude.ai/code/session_01JQwxbXsLdroTYaf1DRqVUG
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: skills/objectstack-automation/SKILL.md
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ Flows are built from **20 built-in node types** (plugins register more via
88
88
|`notify`| Send a notification through the messaging service (inbox channel by default) |
89
89
|`connector_action`| Invoke a pre-built integration connector |
90
90
|`script`| Call a **registered** function named by `config.function` (see *Valid-but-silently-wrong*#3) |
91
-
|`screen`| Display a UI form to the user (screen flows only) |
91
+
|`screen`| Display a UI form to the user (screen flows only). `config.fields[]`: `{ name, label, type, required, options, defaultValue }`, `type` an open widget hint; `'file'` renders the upload widget and resumes with the `sys_file` id bound to `name` — a later `create_record` / `update_record` writes it into a `file` field, which claims the file: collect first, write after the last screen|
92
92
93
93
#### Human Decision
94
94
@@ -104,7 +104,9 @@ undeclared key is a named parse error. **RAW** keys are read as written: a
"prompt": "When a `job_application` is approved, email the applicant. Applicants are not users; the address is in the record's `applicant_email` field.",
57
+
"expected_output": "`notify` with `recipients: { emailField: 'applicant_email' }` (the fourth recipient form: an `email`-typed field of the trigger record) and `channels: 'email'` alone — never a CEL envelope over `record.applicant_email`, which must yield user ids and fails the node for an address no user holds.",
"prompt": "An expense approval only holders of the `expense.approve_request` capability may start; route to the `finance_manager` position, and the submitter must never approve their own expense.",
67
+
"expected_output": "Flow-level `requiredPermissions: ['expense.approve_request']` (checked at every door that starts the flow, not a `current_user.positions` check inside it); the `approval` node sets `excludeSubmitter: true`, and its `onEmptyApprovers` is anything but `auto_approve`, which is refused beside it.",
"prompt": "A screen flow: the user uploads the signed contract PDF on the last step, then the flow creates the `contract` record with the file in its `signed_copy` field.",
77
+
"expected_output": "A `screen` field `{ name: 'signed_copy', type: 'file', required: true }`; the screen resumes with the uploaded `sys_file` id bound to `signed_copy`, and a `create_record` after the last screen writes `fields: { signed_copy: { dialect: 'cel', source: 'signed_copy' } }`, which claims the file for the record.",
Copy file name to clipboardExpand all lines: skills/objectstack-automation/references/state-machines-and-approvals.md
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -347,6 +347,7 @@ Object-hook `ctx` is a different vocabulary — see **objectstack-data**
347
347
|`lockRecord`| Lock the triggering record from edits while pending. Default `true`|
348
348
|`approvalStatusField`| Business-object field to mirror `pending`/`approved`/`rejected`/`recalled` onto (should be readonly) |
349
349
|`onEmptyApprovers`| What an EMPTY resolved slate does: `admin_rescue` (default — request opens, only a privileged admin can act via Reassign; never waves through, never kills the run), `fail` (node fails — treat an empty slate as a config bug), `auto_approve` (skip the request, continue down `approve` with `output.autoApproved = true` — opt-in because it silently waves the record through), `fallback` (request opens on the sibling `fallbackApprovers` instead — same shape as `approvers`, required by this policy and refused under any other; a fallback that itself resolves to nobody degrades to `admin_rescue`). Declare it explicitly on any node with an `expression` approver (linted) |
350
+
|`excludeSubmitter`|`true` drops the run's submitter (`submitter_id`) from the resolved slate, whatever approver type produced them — segregation of duties; a slate it empties takes the `onEmptyApprovers` route, never a silent pass. `onEmptyApprovers: 'auto_approve'` is **refused** beside it (it would approve exactly the request this exists to stop): use `admin_rescue`, `fail` or `fallback`. Default `false`|
350
351
|`decisionOutputs`| Decision outputs a decision may carry (author declares, approvers fill values). Entries are bare keys (free-text input) **or typed declarations**`{ key, label?, type: 'text'\|'user'\|'department'\|'position'\|'team', multiple?, required? }` — a typed entry renders the matching record picker in the decision dialog (`multiple` collects an id array). Accepted outputs resume the run as `<nodeId>.<key>` variables; undeclared keys reject the decision; `decision`/`requestId` reserved |
351
352
|`escalation`| Optional per-node SLA — `{ enabled, timeoutHours, action: reassign\|auto_approve\|auto_reject\|notify, escalateTo?, notifySubmitter }`. `timeoutHours` is **calendar (wall-clock) hours** — nights, weekends and holidays count; the platform ships no business-hours calendar. `escalateTo` is a **position machine name** (expanded to its holders via `sys_user_position`, ADR-0090 D3) or a specific user id — never a membership tier. `reassign` without `escalateTo` degrades to notify (linted) |
352
353
|`maxRevisions`| ADR-0044 — max **send-backs-for-revision** per run before auto-reject. Default `3`; `0` disables send-back. Only meaningful when the node has a `revise` out-edge |
@@ -369,15 +370,11 @@ These are wired on the **graph**, not in node config:
369
370
370
371
### Approval Best Practices
371
372
372
-
1.**Gate entry on the edge** (`condition` into the Approval node) so the flow
373
-
only pauses for records that actually need sign-off.
374
-
2.**Set `approvalStatusField`** to mirror status onto the row — views and
373
+
1.**Set `approvalStatusField`** to mirror status onto the row — views and
375
374
formulas can then filter on it without joining `sys_approval_request`.
376
-
3.**Keep `lockRecord: true`** unless you have a strong reason to allow
375
+
2.**Keep `lockRecord: true`** unless you have a strong reason to allow
377
376
edits while pending — otherwise approvers chase a moving target.
378
-
4.**Model rejection as a visible branch** — a back-edge to revise, or an `end`
379
-
node to terminate. The path is on the diagram, not hidden in config.
380
-
5.**Notify the submitter from downstream nodes** wired to the `approve` /
377
+
3.**Notify the submitter from downstream nodes** wired to the `approve` /
381
378
`reject` edges. Opening already tells each resolved approver
382
379
(`approval.requested`); ⛔ no `notify` node for the opening: it tells
0 commit comments