Skip to content

Commit dd88e1c

Browse files
os-steveclaude
andauthored
docs(spec): FlowSchema terminal messages are every-terminal-run, not screen-flow-only (#9512) (#9548)
Since #9414, AutomationResult.successMessage/errorMessage are carried on EVERY terminal flow run — execute()'s exit, both retryExecution() exits, and the resume exit — not only screen-flow runs. Rewrite the JSDoc and describe() text above FlowSchema.successMessage/errorMessage to say so explicitly and to kill the screen-flow-only reading, which was the premise of a route considered and rejected at #9414's triage (narrowing the contract to screen-flow-only). Regenerate the two mirrored reference pages. Text-only: authorable-surface.base.json is unchanged (re-verified via check:generated, not inherited from the filer's claim). Claude-Session: https://claude.ai/code/session_01Fs18A2DdXLVN2h8PaaFBcP Co-authored-by: Claude <noreply@anthropic.com>
1 parent 56bca91 commit dd88e1c

4 files changed

Lines changed: 36 additions & 11 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
docs(spec): `FlowSchema.successMessage`/`errorMessage` describe themselves as carried on every terminal flow run, not screen-flow-only (#9512)
6+
7+
Since #9414, the pair is set on `AutomationResult` for every terminal run —
8+
`execute()`'s exit, both `retryExecution()` exits, and the resume exit — not
9+
only on `screen`-flow runs. The JSDoc and `describe()` text above
10+
`successMessage`/`errorMessage` in `packages/spec/src/automation/flow.zod.ts`
11+
previously said "Terminal messages for `screen`-flow runs", which stayed the
12+
premise of a route considered and rejected at #9414's triage (narrowing the
13+
contract to screen-flow-only). Text-only: no schema shape, validation, or
14+
`authorable-surface.base.json` change. The two mirrored reference pages
15+
(`content/docs/references/automation/flow.mdx`,
16+
`content/docs/references/api/automation-api.mdx`) are regenerated to match.

content/docs/references/api/automation-api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ const result = AutomationApiErrorCode.parse(data);
8888
| **name** | `string` || Machine name |
8989
| **label** | `string` || Flow label |
9090
| **description** | `string` | optional | |
91-
| **successMessage** | `string` | optional | Toast shown when a screen flow completes (defaults to a generic "Done"). |
92-
| **errorMessage** | `string` | optional | Toast shown when a screen flow fails (defaults to the raw error). |
91+
| **successMessage** | `string` | optional | Message carried on AutomationResult for every terminal run (not only screen flows); the screen-flow UI shows it as a toast instead of a generic "Done". |
92+
| **errorMessage** | `string` | optional | Message carried on AutomationResult for every terminal run (not only screen flows); the screen-flow UI shows it as a toast instead of the raw error. |
9393
| **version** | `integer` | optional (default: `1`) | Version number |
9494
| **status** | `Enum<'draft' \| 'active' \| 'obsolete' \| 'invalid'>` | optional (default: `"draft"`) | Deployment status |
9595
| **template** | `never` | optional | [REMOVED] `flow.template` was removed in @objectstack/spec 17.0.0 (#3896 audit close-out) — no designer or engine path ever read it, so flagging a flow as a template/subflow did nothing. Delete the key. Shared logic is invoked via a subflow NODE referencing the flow by name. Run `os migrate meta --from 16` to rewrite existing sources automatically. |

content/docs/references/automation/flow.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ const result = FlowSchema.parse(data);
4242
| **name** | `string` || Machine name |
4343
| **label** | `string` || Flow label |
4444
| **description** | `string` | optional | |
45-
| **successMessage** | `string` | optional | Toast shown when a screen flow completes (defaults to a generic "Done"). |
46-
| **errorMessage** | `string` | optional | Toast shown when a screen flow fails (defaults to the raw error). |
45+
| **successMessage** | `string` | optional | Message carried on AutomationResult for every terminal run (not only screen flows); the screen-flow UI shows it as a toast instead of a generic "Done". |
46+
| **errorMessage** | `string` | optional | Message carried on AutomationResult for every terminal run (not only screen flows); the screen-flow UI shows it as a toast instead of the raw error. |
4747
| **version** | `integer` | optional (default: `1`) | Version number |
4848
| **status** | `Enum<'draft' \| 'active' \| 'obsolete' \| 'invalid'>` | optional (default: `"draft"`) | Deployment status |
4949
| **template** | `never` | optional | [REMOVED] `flow.template` was removed in @objectstack/spec 17.0.0 (#3896 audit close-out) — no designer or engine path ever read it, so flagging a flow as a template/subflow did nothing. Delete the key. Shared logic is invoked via a subflow NODE referencing the flow by name. Run `os migrate meta --from 16` to rewrite existing sources automatically. |

packages/spec/src/automation/flow.zod.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -616,14 +616,23 @@ export const FlowSchema = lazySchema(() => strictObject(
616616
description: z.string().optional(),
617617

618618
/**
619-
* Terminal messages for `screen`-flow runs. When the run reaches a terminal
620-
* state, the UI flow-runner shows `successMessage` instead of a generic
621-
* "Done" toast, and `errorMessage` instead of the raw error. Both are
622-
* surfaced on the terminal {@link AutomationResult} (`successMessage` /
623-
* `errorMessage`). Plain strings; `{var}` is NOT interpolated here.
619+
* Terminal messages for the flow. Since #9414, carried on EVERY terminal
620+
* run — `execute()`'s exit, both `retryExecution()` exits, and the resume
621+
* exit — not only on `screen`-flow runs. The pair is set on the terminal
622+
* {@link AutomationResult} (`successMessage` on success, `errorMessage` on
623+
* failure) returned by any trigger route (e.g.
624+
* `POST /api/v1/automation/:name/trigger`), whether or not a UI is
625+
* listening; a `screen`-flow run additionally has the UI flow-runner show
626+
* `successMessage` as a toast instead of a generic "Done", and
627+
* `errorMessage` instead of the raw error. Reading this pair as
628+
* screen-flow-only was the alternative considered and rejected at #9414's
629+
* triage — narrowing the text would delete a declared, documented,
630+
* console-consumed capability to make a bug disappear — so treat the
631+
* screen-flow toast as one consumer, not the whole contract. Plain
632+
* strings; `{var}` is NOT interpolated here.
624633
*/
625-
successMessage: z.string().optional().describe('Toast shown when a screen flow completes (defaults to a generic "Done").'),
626-
errorMessage: z.string().optional().describe('Toast shown when a screen flow fails (defaults to the raw error).'),
634+
successMessage: z.string().optional().describe('Message carried on AutomationResult for every terminal run (not only screen flows); the screen-flow UI shows it as a toast instead of a generic "Done".'),
635+
errorMessage: z.string().optional().describe('Message carried on AutomationResult for every terminal run (not only screen flows); the screen-flow UI shows it as a toast instead of the raw error.'),
627636

628637
/** Metadata & Versioning */
629638
version: z.number().int().default(1).describe('Version number'),

0 commit comments

Comments
 (0)