diff --git a/.changeset/24965-script-template-tombstone.md b/.changeset/24965-script-template-tombstone.md new file mode 100644 index 00000000000..eb3dad6dc16 --- /dev/null +++ b/.changeset/24965-script-template-tombstone.md @@ -0,0 +1,9 @@ +--- +'@objectstack/spec': patch +--- + +fix(spec): the `script.config.template` tombstone points at the `notify` node's own `template` key + +Clause-②: no (prose only: no shape, key, default or accepted value moves) + +The rejection an author sees for the retired `script.config.template` key said that stored templates live in the messaging service (`sys_notification_template`). That text predates the `notify` node's own `template` key. It now prescribes that key: name an email template (`email_template`) in a `notify` node's `template`, with `templateData` filling its placeholders, and the email and in-app inbox channels render it in each recipient's locale; otherwise the node carries inline `title`/`message`. It mentions `sys_notification_template` only as the rows the `email` and `sms` channels read, `email` only when the node names no template. The key stays rejected exactly as before, and the generated reference page carries the same text. diff --git a/content/docs/references/automation/schemaless-node-config.mdx b/content/docs/references/automation/schemaless-node-config.mdx index 945d8a00ca3..b45f61f391d 100644 --- a/content/docs/references/automation/schemaless-node-config.mdx +++ b/content/docs/references/automation/schemaless-node-config.mdx @@ -168,7 +168,7 @@ const result = DecisionConditionSchema.parse(data); | **inputs** | `Record` | optional | Inputs passed to the function: each value a CEL value envelope `{ dialect: 'cel', source }` evaluated against the live flow variables, or a literal written as it is — a `{…}` template token is refused | | **outputVariable** | `string` | optional | Flow variable the function's return value is bound to — a name without a leading `$` (the `$` names are the flow engine's own), read as `{{ name }}` | | **actionType** | `never` | optional | [REMOVED] `script.config.actionType` was removed in @objectstack/spec 17 — none of its values did what it said. The two built-ins were logger-backed stubs that recorded the intent and delivered nothing under any configuration, and every other value was a second spelling of `config.function`. Replace it per branch: for `email` use a `notify` node (it delivers through the messaging service — the in-app inbox by default, real email once `@objectstack/plugin-email` is installed); for `slack` use a `connector_action` node with the Slack connector, or an `http` node posting to a webhook; for anything else, move the name into `config.function`. Run `os migrate meta --from 16` to list the mechanical edits for the shorthand case into `config.function`; `--write` applies the ones it can prove, and the stub and marker values are removed. | -| **template** | `never` | optional | [REMOVED] `script.config.template` was removed in @objectstack/spec 17 — it fed only the logger-backed `email`/`slack` stubs, which never rendered or sent a message, so no template id was ever resolved. Delete the key. A `notify` node carries its own `title`/`message`, and stored templates live in the messaging service (`sys_notification_template`), not on the node. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | +| **template** | `never` | optional | [REMOVED] `script.config.template` was removed in @objectstack/spec 17 — it fed only the logger-backed `email`/`slack` stubs, which never rendered or sent a message, so no template id was ever resolved. Delete the key. For templated content use a `notify` node and name an email template (`email_template`) in its own `template` key, with `templateData` filling its placeholders: the email and in-app inbox channels render that template in each recipient's locale. Otherwise the node carries inline `title`/`message`. The messaging service's `sys_notification_template` rows are read only by the `email` and `sms` channels, `email` only when the node names no template. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **recipients** | `never` | optional | [REMOVED] `script.config.recipients` was removed in @objectstack/spec 17 — the addresses were logged, never messaged: the `email`/`slack` branches it fed delivered nothing. Use a `notify` node, whose `recipients` (user ids, field refs or addresses) reach the messaging service for real. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **variables** | `never` | optional | [REMOVED] `script.config.variables` was removed in @objectstack/spec 17 — it injected values into a template no side effect ever rendered. Delete the key. A `notify` node carries structured data in `payload`; a registered function takes it in `config.inputs`. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **script** | `never` | optional | [REMOVED] `script.config.script` was removed in @objectstack/spec 17 — the built-in runtime has no server-side JS sandbox, so an inline body was recognized and never executed: the node warned and completed as a no-op. Move the logic into a registered function (`defineStack({ functions })`) and name it in `config.function`. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | diff --git a/packages/spec/src/automation/schemaless-node-config.zod.ts b/packages/spec/src/automation/schemaless-node-config.zod.ts index d2a1ab6ab08..fe3d6c680ab 100644 --- a/packages/spec/src/automation/schemaless-node-config.zod.ts +++ b/packages/spec/src/automation/schemaless-node-config.zod.ts @@ -353,9 +353,12 @@ export const ScriptConfigSchema = lazySchema(() => strictObject({ template: retiredKey( '`script.config.template` was removed in @objectstack/spec 17 — it fed only the ' + 'logger-backed `email`/`slack` stubs, which never rendered or sent a message, so no template ' - + 'id was ever resolved. Delete the key. A `notify` node carries its own `title`/`message`, and ' - + 'stored templates live in the messaging service (`sys_notification_template`), not on the ' - + 'node. ' + + 'id was ever resolved. Delete the key. For templated content use a `notify` node and name an ' + + 'email template (`email_template`) in its own `template` key, with `templateData` filling its ' + + 'placeholders: the email and in-app inbox channels render that template in each recipient\'s ' + + 'locale. Otherwise the node carries inline `title`/`message`. The messaging service\'s ' + + '`sys_notification_template` rows are read only by the `email` and `sms` channels, `email` ' + + 'only when the node names no template. ' + 'Run `os migrate meta --from 16` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand.', ), recipients: retiredKey(