Skip to content

Flow notify nodes cannot be localized: title/message are raw strings with no template or locale channel, so a four-locale app sends English-only notifications #9205

Description

@os-steve

Problem

HotCRM ships 4 locales (en, zh-CN, ja-JP, es-ES) and 16 notify flow nodes with channels: ['inbox', 'email']. Every one of them carries inline English literals:

title: 'Large deal won: {record.name}',message: '{record.name} closed at {record.amount}. Congratulations to the team.',

A Japanese sales rep receives "Large deal won" in English, in their inbox and their mail. There is no way for a metadata app to do better today:

  • packages/spec/src/automation/io-node-config.zod.tsNotifyNodeConfig.title / message are plain strings. {token} interpolation resolves record fields only; there is no template reference and no locale awareness.
  • packages/spec/src/system/translation.zod.ts:679 — the flows translation surface carries the flow label, per-screen headings and per-screen field copy. Its own guidance block states notification/toast text is not part of the surface (i18n: TranslationBundle has no surface for screen-flow UI — wizard screens render source-language only, even in a fully localized app #7646).
  • EmailTemplateDefinitionSchema (system/email-template.zod.ts) already resolves by (name, locale) via IEmailService.sendTemplate({ template, locale }) — but a notify node cannot reference one.

So the gap is a missing bridge, not a missing subsystem.

Ruled direction

Maintainer ruling, 2026-08-17, PM session chat (verbatim): 「立项,走 emailTemplates 路线」 — chosen over extending the flows translation surface (whose guidance explicitly excludes notification text; widening it would overturn #7646).

Proposed shape (for the spec seat to refine): let NotifyNodeConfig reference an email template by name — e.g. template: 'large_deal_won' (+ optional templateData) as an alternative to inline title/message — with the notification service resolving (name, recipient locale) at delivery time, for the email channel and ideally the inbox channel too. Inline strings remain valid (existing flows keep working); the template reference is the localizable path.

Notes for triage

  • This expands the accepted set of NotifyNodeConfig ⇒ semantic/contract change; per dispatch rules any implementing card is domain:spec and model: claude-fable-5.
  • Cross-repo contract-first: the consumer card (localize HotCRM's 16 notify nodes in 4 locales) is filed in hotcrm with a Blocked-by: on this issue.
  • Re-check commands: grep -n "title\|message\|template" packages/spec/src/automation/io-node-config.zod.ts · grep -rn "type: 'notify'" ../hotcrm/src/flows/ | wc -l (16 as of hotcrm@2342811).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions