Skip to content

docs(automation): job and email_template are authorable, referenced, and have no how-to page #10211

Description

@os-elon

Part of #10206

The gap

Both kinds are first-class: members of MetadataTypeSchema, bound to schemas in BUILTIN_METADATA_TYPE_SCHEMAS, and authorable as defineStack({ jobs, emailTemplates }).

jobreferences/system/job.mdx (182 lines) is the only page. automation/index.mdx mentions it in exactly one bullet ("Scheduled jobs run on setInterval or cron via the job service, alongside schedule-type flows") and gives it no Card and no page. The stack describe string is 'Background / Scheduled Jobs (run by IJobService on cron/interval/once schedules)'.

email_templatereferences/system/email-template.mdx (95 lines) publishes the shape. kernel/runtime-services/email-service.mdx documents services.email and sendTemplate({ template, locale }) — i.e. how to send. Nothing documents how to author a template, how locale resolves, or how a flow's notify node reaches one. Grep for emailTemplates across the hand-written docs returns zero hits.

File surface

  • content/docs/automation/jobs.mdx — new
  • content/docs/automation/email-templates.mdx — new
  • content/docs/automation/index.mdx — edit ("The building blocks" bullet + a Card each)
  • content/docs/automation/meta.json — two added entries

⛔ Nothing outside content/docs/automation/. In particular do not edit kernel/runtime-services/email-service.mdx — cross-link it instead; that file is the service contract and belongs to a different surface.

PM ruling on placement

Both pages go in automation/. job clearly belongs beside flows and hooks. email_template is System Protocol by schema module, but its reader arrives from an automation need ("my flow should email someone"), and automation/ is where that reader is. If while writing you find a concrete reason this misleads, say so in the report and place it anyway — do not re-shelve on your own.

What to write

jobs.mdx

Read JobSchema (packages/spec/src/system/job.zod.ts) and the IJobService contract, and write from them:

  • what a job is and how it differs from a schedule-type flow — this distinction is the reason the page exists, so lead with it and make it decidable, not descriptive;
  • the schedule forms the schema actually accepts (cron / interval / once) with real examples;
  • how the handler is bound and what runs it;
  • cluster semantics — kernel/cluster.mdx already says something about which node fires a scheduled job; cross-link rather than restate, and verify what it says still holds;
  • failure, retry and observability, to whatever depth the schema and service actually support. If a facet is not supported, say nothing rather than implying it.

email-templates.mdx

Read EmailTemplateDefinitionSchema (packages/spec/src/system/email-template.zod.ts):

⛔ Non-goals

  • Do not touch packages/spec/**. If a schema property looks dead or contradicts the service, report it — that is a domain:spec finding, not something to document around.
  • Do not document capabilities the runtime does not implement. An undocumented gap is a smaller problem than a documented fiction.

Gates (derived at dispatch time via node scripts/pm/dispatch-gates.mjs, not recalled)

check:doc-anchors, check:docs-audit-scope, check:docs-redirects, check:published-readme-links, check:role-word, check:cross-package-test-inputs, and the spec liveness set (check:empty-state, check:liveness, check:strictness-ledger, check:variant-docs). Re-derive against your actual diff.

Acceptance

  • A developer who needs a nightly job, or an outbound templated email, lands on a page from the Automation sidebar and can author one without opening packages/spec.
  • Every code sample validates against the real schema.
  • Named gates green.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions