Skip to content

Commit be9efd1

Browse files
committed
docs(automation): the flows guide states the decider's segment identity
The runAs row and the resume section of the hand-written flows guide now say what the describe says: a 'user' run is the trigger user until a human decision and the decider after it, a 'system' run's attribution user is the decider after a decision, and a resumed run continues under the identity stored on the run. The decider pin file's header names the approvals test that holds the hand-off pins. Claude-Session: https://claude.ai/code/session_01Nk17Z26X5DB59iQztDBADH Co-authored-by: Claude <noreply@anthropic.com>
1 parent c17394e commit be9efd1

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎content/docs/automation/flows.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const approvalFlow = {
7373
| `version` | `number` | optional | Version number (defaults to `1`) |
7474
| `status` | `enum` | optional | `'draft'`, `'active'`, `'obsolete'`, `'invalid'` (defaults to `'draft'`) |
7575
| `type` | `FlowType` | ✅ | Flow trigger type (see below) |
76-
| `runAs` | `enum` | optional | `'system'` (elevated, bypasses RLS) or `'user'` (the triggering user, RLS-respecting; the default). A `'user'` run that resolved **no** trigger user has nothing to scope to, so its data operations are refused — declare `'system'` for schedule / time-relative / API triggers and for record-change flows fired by a write that carried no user |
76+
| `runAs` | `enum` | optional | `'system'` (elevated, bypasses RLS; after an approval decision its attribution user is the decider) or `'user'` (the default, RLS-respecting: the trigger user until a human decision, the decider after it, with the decider's permissions). A `'user'` run that resolved **no** trigger user has nothing to scope to, so its data operations are refused — declare `'system'` for schedule / time-relative / API triggers and for record-change flows fired by a write that carried no user |
7777
| `variables` | `FlowVariable[]` | optional | Input/output variables |
7878
| `nodes` | `FlowNode[]` | ✅ | Flow nodes |
7979
| `edges` | `FlowEdge[]` | ✅ | Connections between nodes |
@@ -1088,8 +1088,8 @@ referent there. The shape is `ResumeFailureDetailsSchema` in
10881088
The route asks two questions, in this order. Both must pass.
10891089

10901090
**1. Who is resuming.** A resumed run continues under the identity stored on
1091-
the run, so its data nodes run as the user who **started** it, whoever sent the
1092-
values. The route therefore admits only:
1091+
the run — the user who **started** it or, after an approval decision, the
1092+
decider — whoever sent the values. The route therefore admits only:
10931093

10941094
- the user who started the run (the run's `trigger.userId`) — no extra
10951095
permission needed;

‎packages/services/service-automation/src/resume-decider-identity.integration.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* declares `resumeAuthority: 'service'`, resumed with the
4242
* `RESUME_AUTHORITY_SERVICE` marker and `resumedBy` exactly as
4343
* `ApprovalService.decide` hands them over (that hand-off is pinned in
44-
* `plugin-approvals`' `decision-resume-decider.test.ts`).
44+
* `plugin-approvals`' `restored-approval-continuation.test.ts`).
4545
*/
4646

4747
import { describe, it, expect, beforeAll, afterAll } from 'vitest';

0 commit comments

Comments
 (0)