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 61f2a99
Browse filesBrowse the repository at this point in the historyBrowse files
docs(skills): teach the mail option formatter for a notice's select label and the active-member rule for a user target
The automation skill's notify section says an option label in a notice is
written in the mail template as the option formatter, which prints each
recipient's language, never label() in templateData (evaluated once per run,
before fan-out); its assignment-rules section says a user target holds the
row only while an active member of its organization. Eval 15 grades the
notice case. The queues-and-assignment-rules docs page gains the
organization-authored sys_assignment_rule rules beside the declared ones:
evaluated first, by sort_order then name, first match wins, a failed read
routes nothing, and the active-member rule. Paid inside SKILL.md by deleting
the CRM Automation Blueprint section and two restatements; the token ceiling
re-locked at the measurement.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibxujehvWJcGRXMYv7f
docs(skills): the automation skill teaches the mail `option` formatter for a notice's select label, and that a user target owns a row only while an active member
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
Two lines in `objectstack-automation/SKILL.md`, each following a platform change that landed before it. In the `notify` section: an option label in a notice is written in the mail `template` as `{{ stage | option:opportunity.stage }}`, which prints the label in each recipient's language and is mail-only (refused in an inline `title` / `message`) — never `label()` in `templateData`, which is evaluated once per run, before recipients fan out. In "Assignment rules": `assignTo: { type: 'user', value: '<id>' }` names an owner who holds the row only while an active member of its organization, else the row is written ownerless. Eval 15 of `evals/flows-triggers-approvals.json` grades the notice case. The docs page `automation/queues-and-assignment-rules` gains the organization-authored `sys_assignment_rule` rules beside the declared ones: evaluated first, by `sort_order` then name, first match wins, a failed read of the organization's rules routes nothing, and the active-member rule for a `user` target. Paid inside the skill by deleting the CRM Automation Blueprint section (the `src/flows` layout objectstack-platform's bootstrap reference carries) and two restatements.
Copy file name to clipboardExpand all lines: content/docs/automation/queues-and-assignment-rules.mdx
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,12 @@ export default defineStack({
93
93
94
94
The rule writes `owner_id` (when it chose a member) and `queue` (for a queue target), nothing else. The row's audit columns still record who inserted it; the owner the rule chose is ownership, not attribution.
95
95
96
+
**A `user` target owns the row only while an active member.**`assignTo: { type: 'user', value: '<id>' }` is honoured when that user has a `sys_member` row in the record's organization and no ban in force — asked again at every insert, not only when the rule was written. A target who has left or is banned when a row arrives leaves it ownerless (`queue` unset), logged once at `warn`; the insert is never refused. Point the rule at a current member, or at a queue.
97
+
98
+
An organization authors its own assignment rules too. A `sys_assignment_rule` record (Setup → Assignment Rules, for holders of `manage_platform_settings`) is one rule with one entry: `object_name`, an optional `criteria`, `recipient_type` (`queue` or `user`) with `recipient_id`, and for a queue target an optional `strategy` with its `load`; `active: false` switches it off without deleting it. Like `sys_queue`, it shares **one namespace, by name** with the declared rules: a record may not take a declared rule's name, and one found under that name is not evaluated — the declared rule answers for it, logged once. Unlike a `sys_queue` record, which resolves after the declared queues, **the organization's rules are evaluated first** — ascending by `sort_order`, then by `name` — and the stack's `assignmentRules`, in registry order, are the fallback, so an organization routes ahead of an installed app's rule, which it cannot switch off for itself alone (the activation ledger has no organization column). The first match across both sources wins. When the organization's rules cannot be read, its new rows are written as they stood and routed by **no** rule — not by the declared fallback its own rules would have overtaken — logged at `warn`.
99
+
100
+
The record is validated on save, one `VALIDATION_FAILED` naming every field at fault: a `name` that is not snake_case or that a declared rule holds; an `object_name` that is not registered or carries no `queue` column; the shape a declared entry refuses (a `strategy` on a user target, `least_loaded` without `load`); a `criteria` or `load` the engine cannot compile; a `user` target who is not an active member of the organization. A later patch of only the label, description, order or active flag is not re-judged, so a rule whose target has lapsed can still be switched off or renamed.
101
+
96
102
### 3. `load` is required with `least_loaded`
97
103
98
104
`least_loaded` counts each member's **open** rows of the object, and only you know what "open" means for it — `status != "closed"` for cases, `is_converted == false` for leads. So `load` is **required** with `least_loaded` and has no default: a default such as "every row" would count closed work and quietly make the busiest historical owner look the most loaded. `load` on any other strategy is refused, because nothing reads it.
@@ -153,6 +159,7 @@ A queue routes **records** to people. It is not an address for **messages**: a f
153
159
- The object is `ownership: 'user'`, and declares no field of its own named `queue`.
154
160
- The stack loads `@objectstack/plugin-sharing`; otherwise `queues` / `assignmentRules` refuse the boot.
155
161
- A declared queue's members are positions; organizations add users, teams and units through `sys_queue_member`.
162
+
- An organization's own `sys_assignment_rule` records are tried before the stack's rules, lowest `sort_order` first; a `user` target is an active member of the organization.
156
163
- Every `least_loaded` entry has a `load` your filter compiler can lower; no other entry has one.
157
164
- Code that claims a record sends `{ owner_id: <self> }` by id and handles `409` as "someone else took it".
158
165
- Alerts about new work address a team or a position, not the queue.
Copy file name to clipboardExpand all lines: skills/objectstack-automation/evals/flows-triggers-approvals.json
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -260,6 +260,23 @@
260
260
"actionUrl:"
261
261
]
262
262
}
263
+
},
264
+
{
265
+
"id": 15,
266
+
"prompt": "Email the opportunity owner and the sales manager when an opportunity has sat in one stage for 30 days; the subject must show the `stage` as its label, in each recipient's own language.",
267
+
"expected_output": "The notify node names a mail `template` (never inline `title` / `message`, which are one text for every recipient), and the template's subject prints the stage with the mail formatter `{{ stage | option:opportunity.stage }}` — the argument a bare `object.field`, no quotes — so the renderer prints that recipient's label from the field's option list in the recipient's locale. Not `label()` in `templateData`: the map is evaluated once per run, before recipients fan out, so it cannot differ per recipient; and `option` is mail-only, refused in an inline `title` / `message`. The stage value itself reaches the template as stored (`stage` in `templateData`).",
0 commit comments