Skip to content

app-showcase declares showcase_task_done_email but no flow references it — wiring it means giving up the script-node demonstration #10394

Description

@os-warren

Split out of #10267, which fixed the template's locale and wrapped it in defineEmailTemplateDefinition. That card scoped the wiring question as separate and left it to the executing seat; this is that seat filing it rather than deciding it, because the wiring is not an addition.

The state today

examples/app-showcase/src/system/emails/index.ts declares showcase_task_done_email and objectstack.config.ts passes it through emailTemplates:, so it is materialized into sys_email_template at boot. Nothing sends it — showcase_task_completed ("Notify on Task Completed") is the flow its docblock names, and that flow's notify node uses the inline content path:

{id: 'notify',type: 'notify',config: {recipients: '{record.assignee}',title: '✅ Task done: {record.title}',message: '{summary}',// …},}

Why this is a decision, not a mechanical edit

NotifyConfigSchema's superRefine (packages/spec/src/automation/io-node-config.zod.ts) refuses template combined with inline title/message outright:

template cannot be combined with inline title/message — pick ONE content path

So referencing the template there is a substitution: title and message have to go. And message: '{summary}' is the only consumer of the summarize script node's outputVariable — which is precisely what that flow exists to demonstrate. Its own docblock says so:

A flow function is PURE: it takes inputs, RETURNS a value, and a later declarative node uses or persists it (#4396).

Wiring the template therefore trades a live demonstration of the script-node contract for a demonstration of the template path. Both are worth showing; the showcase currently shows one of them and declares the other without showing it.

Two further costs worth pricing before anyone picks an option:

Options

  1. Add a second flow that demonstrates the template + templateData path, leaving showcase_task_completed as the script-node specimen. Costs one more flow in the corpus; keeps both demonstrations.
  2. Convert the existing notify node to the template path and move the summary text into the template bundle. Loses the script-node → later-node demonstration unless another node is added to consume {summary}.
  3. Keep the template unwired and say so in its docblock (what app-showcase's email template declares locale: 'en', which no en-US send can resolve — and it bypasses defineEmailTemplateDefinition #10267 did as an interim), on the grounds that a materialized template is itself the thing being demonstrated — it is reachable from services.email.sendTemplate and from Studio, flow or no flow.

No preference recorded here; #10267's surface was the declaration only. Filed unassigned.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions