Builtin Node Config — Automation Protocol
Config contracts for the remaining flat builtins — the CRUD quartet (get_record / create_record / update_record / delete_record), screen, map.
Config contracts for the remaining flat builtins — the CRUD quartet
(get_record / create_record / update_record / delete_record),
screen, map (#4045), since #14149 assignment's value contract and,
since #14945, the structural end node's outcome (EndConfigSchema, the
one contract here the FLOW PARSE applies rather than an executor).
Sibling of io-node-config.zod.ts (notify / http) and control-flow.zod.ts
(loop / parallel / try_catch).
Provenance — written from the executors, not from the forms
Each schema was derived by reading what the executor actually does with
node.config (service-automation/builtin/crud-nodes.ts,
screen-nodes.ts, map-node.ts), not by transcribing the hand-written
configSchema literal on the node's descriptor. The two artifacts are
reconciled bidirectionally by builtin-node-form-zod-ledger.test.ts in
service-automation; a Zod copied from the form would make that
reconciliation a tautology (#4045).
Writing these against the executors is what surfaced the drift the
reconciliation exists to catch — keys the executors read that no form
offered anywhere (get_record.fields, screen.recordId, the screen
field-item keys options/defaultValue/placeholder, map.indexVariable,
map.input), and the undeclared map.flow alias, which graduated into the
ADR-0087 D2 conversion layer like notify.source before it.
What these schemas are wired to (#4277)
Live execute-time contracts: each executor parse()s its config against
its schema before running (service-automation's parse-config.ts), so
type and required violations refuse the node as a guard. All of these
parse the RAW stored config, as authored: no executor interpolates one —
the single-brace {token} dialect is retired from every flow position and
its interpolator deleted (#19939, ADR-0032 Sequencing 6). The value slots
refuse a {token} (the "value slots" section below), each operand of the
CRUD filter included, where a query placeholder stays the query engine's;
and the text slots since #22110 — a screen title / description and an
end message — render {{ }} holes, and a {token} there is refused
(flow-text-slot-template.ts).
Unknown keys — closed here too, as of #4001 批 9
These contracts used to say "unknown keys are rejected earlier, at
registerFlow() (the tightened #4059 check); the parse here strips them."
The registration walk is still the first and more informative door — it
descends NESTED config against the descriptor's JSON Schema, which is how it
catches fields[0].visibleIf (#3528) and not just top-level typos — but
"some other door is closed" is the exact reasoning #4001 exists to retire:
the sibling of every guard in this campaign turned out to leave the other
doors open, because its author was fixing one bug rather than auditing a
surface. A config reaching parse() without passing registration (tooling
that parses a contract directly, a host composing the engine itself) is no
longer silently trimmed.
The two doors are kept in agreement by builtin-node-form-zod-ledger.test.ts,
which reconciles these key sets against the descriptors' in both directions.
The per-key prescriptions below are the same curation the registration
rejection carries in FLOW_NODE_UNKNOWN_KEY_GUIDANCE — the campaign's
finding is that a bespoke guard's detection generalizes for free the moment
a default flips, while its PROSE does not, so the prose is copied to the new
door rather than left behind at the old one.
assignment is described by its VALUES, not by a key set (#14149): the
canonical assignments map's keys are the author's variable names, and with
no assignments wrapper the TOP-LEVEL config keys are (logic-nodes.ts), so
AssignmentConfigSchema below declares one key and an open catchall and puts
the contract on what a value may be. The form↔Zod ledger test still pins the
descriptor's free-form assignments map as the openness it is; that pin and
this contract describe the same surface from the two sides.
The create_record / update_record fields map carries the same value
contract since #19938 (FlowValueSlotSchema, the "value slots" section):
a field value is a CEL value envelope or a literal — a {token} template is
refused there since #19939 — and those maps are the expression ledger's
value-role slots, as are, since #19939, the three maps a node hands to a
callee, a screen's defaults.*, field defaultValue and recordId, and
the list a loop and a map iterate (FlowCollectionSlotSchema), and each
operand of the CRUD filter — a field's value, an operator's comparand, each
element of a list comparand — which a CEL value envelope computes before the
query while a query placeholder ({current_user_id}, {today}) stays the
query engine's (the "CRUD quartet" section below).
Deliberately absent:
decision/script/subflow/wait/connector_action— the descriptor-schemaless class (config-schemas.test.ts).waitandconnector_actionkeep their contracts in FlowNodeSchema's sibling blocks (waitEventConfig/connectorConfig); the other three publish executor-derived config contracts inschemaless-node-config.zod.ts(#4278) — separate from this module because they must NOT grow into descriptorconfigSchemas (the forms they describe stay hand-written in objectui, reconciled by a test there).
Source: packages/spec/src/automation/builtin-node-config.zod.ts
TypeScript Usage
import { AssignmentConfigSchema, AssignmentExpressionValueSchema, AssignmentValueSchema, CreateRecordConfigSchema, DeleteRecordConfigSchema, EndConfigSchema, FlowCollectionSlotSchema, FlowRecordFieldValueSchema, FlowValueSlotSchema, GetRecordConfigSchema, MapConfigSchema, SaveNoticeConfigSchema, ScreenConfigSchema, ScreenFieldConfigSchema, UpdateRecordConfigSchema } from '@objectstack/spec/automation';
import type { AssignmentConfig, AssignmentExpressionValue, AssignmentValue, CreateRecordConfig, DeleteRecordConfig, EndConfig, FlowCollectionSlot, FlowRecordFieldValue, FlowValueSlot, GetRecordConfig, MapConfig, SaveNoticeConfig, ScreenConfig, ScreenFieldConfig, UpdateRecordConfig } from '@objectstack/spec/automation';
// Validate data
const result = AssignmentConfigSchema.parse(data);AssignmentConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| assignments | Record<string, any> | optional | Variables to set: each key is a variable name, each value a CEL value envelope or a literal |
AssignmentExpressionValue
CEL value envelope { dialect: 'cel', source } — evaluated by the expression engine to the value the slot takes; the whole CEL stdlib (joinNonEmpty, …) is reachable
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| dialect | 'cel' | ✅ | |
| source | string | ✅ | |
| ast | any | optional | |
| meta | { rationale?: string; generatedBy?: string } | optional |
AssignmentValue
Value the variable takes: a CEL value envelope { dialect: 'cel', source } evaluated by the expression engine (the CEL stdlib such as joinNonEmpty is reachable), or a literal written as it is — a {…} template token in a string is refused (the template dialect is retired from value slots; a date macro is its CEL string form, isoDate(today()) / isoDatetime(now()))
CreateRecordConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| objectName | string | ✅ | Object to insert into |
| fields | Record<string, any> | optional | Field values to write on the new record: each key is a field name, each value a CEL value envelope, a text envelope (a sentence written in the organization's language) or a literal |
| outputVariable | string | optional | Flow variable bound to the created record — a name without a leading $ (the $ names are the flow engine's own), read as {{ name }} |
DeleteRecordConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| objectName | string | ✅ | Object to delete from |
| filter | Record<string, any> | optional | Field/value pairs identifying the record(s) to delete: each operand — a field's value, an operator's comparand ({"$ne": null}), a list comparand's element — is a CEL value envelope { dialect: 'cel', source } evaluated before the query (one that evaluates to null refuses the node), a query placeholder such as {current_user_id} or {today} the query engine resolves, or a literal; a flow {…} template token is refused |
| multi | boolean | optional | Declare bulk intent: delete every row the filter matches (default false — a predicate delete without it is refused by the engine) |
EndConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| outcome | Enum<'completed' | 'refused'> | optional (default: "completed") | How the run ends when it reaches this node. completed (the default) is the ordinary terminal. refused is a first-class refusal: the run records refused — distinct from failed, a refusal is a successful evaluation that says no — carries the rendered message, is never resumed, and a runner shows the message with Close only: no Submit, no completion toast. |
| message | string | optional | Why the run was refused, as a template rendered at run time exactly like a screen description — {{ }} holes over the flow's variables ({{ record.name }}), so the text names the record. Required when outcome is refused; refused when it is completed — a completion renders nothing, so the key would be a silent no-op. |
FlowCollectionSlot
The list the node iterates: a CEL value envelope { dialect: 'cel', source } evaluated in the run's scope to a list (anything else, null included, fails the node), or an inline array of the items, iterated as written — a string is refused, a {…} template token or a variable's bare name alike
Union Options
This schema accepts one of the following structures:
Option 1
Type: any[]
Option 2
CEL value envelope { dialect: 'cel', source } — evaluated by the expression engine to the value the slot takes; the whole CEL stdlib (joinNonEmpty, …) is reachable
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| dialect | 'cel' | ✅ | |
| source | string | ✅ | |
| ast | any | optional | |
| meta | { rationale?: string; generatedBy?: string } | optional |
FlowRecordFieldValue
A field value: a CEL value envelope { dialect: 'cel', source } evaluated to the value written, a text envelope { dialect: 'template', source } — a sentence for people to read, written in the organization's language (its translation picked at flows.<flow>.records.<node_id>.fields.<field>, then its {{ }} holes filled; the authored text when none is held) — or a literal written as it is (a bare string is never translated; a {…} template token in it is refused)
FlowValueSlot
A value: a CEL value envelope { dialect: 'cel', source } evaluated by the expression engine (the CEL stdlib such as joinNonEmpty is reachable), or a literal written as it is — a {…} template token in a string is refused (the template dialect is retired from value slots; a date macro is its CEL string form, isoDate(today()) / isoDatetime(now()))
GetRecordConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| objectName | string | ✅ | Object to query |
| filter | Record<string, any> | optional | Field/value pairs to match: each operand — a field's value, an operator's comparand ({"$ne": null}), a list comparand's element — is a CEL value envelope { dialect: 'cel', source } evaluated before the query (one that evaluates to null refuses the node), a query placeholder such as {current_user_id} or {today} the query engine resolves, or a literal; a flow {…} template token is refused |
| fields | string[] | optional | Field projection — only these fields are read; omit it to read all. An empty list or a blank name is refused |
| limit | integer | optional | Max records to return — a positive integer; >1 switches to a multi-record query |
| outputVariable | string | optional | Flow variable the result is bound to — a name without a leading $ (the $ names are the flow engine's own), read as {{ name }} |
MapConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| collection | any[] | { dialect: 'cel'; source: string; ast?: any; meta?: object } | ✅ | The list the node iterates: a CEL value envelope { dialect: 'cel', source } evaluated in the run's scope to a list (anything else, null included, fails the node), or an inline array of the items, iterated as written — a string is refused, a {…} template token or a variable's bare name alike |
| flowName | string | ✅ | Subflow run for each item — it may pause (e.g. an approval) |
| iteratorVariable | string | optional (default: "item") | Variable holding the current item — a name without a leading $ (the $ names are the flow engine's own), read as {{ name }} |
| indexVariable | string | optional | Optional variable holding the current index — a name without a leading $ (the $ names are the flow engine's own) |
| itemObject | string | optional | When items are records, the object they belong to (exposes each item as the child's record) |
| input | Record<string, any> | optional | Params passed to each item's subflow, keyed by its input variables: each value a CEL value envelope { dialect: 'cel', source } evaluated per item (the item variable is in scope), or a literal written as it is — a {…} template token is refused |
| outputVariable | string | optional | Each item's subflow output, collected in order — bound to a name without a leading $ (the $ names are the flow engine's own), read as {{ name }}. An item whose run was cancelled keeps its slot as the closed marker { $status: 'cancelled', $itemRunId }: never an output, and not counted as a run |
SaveNoticeConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| message | string | ✅ | The sentence the person who made the triggering write reads, answered as the create/update notice — a template rendered at run time like an end refusal message: {{ }} holes over the flow's variables (Sent {{ record.name }} for approval). Translated through flows.<flow>.notices.<node_id>.message in the writer's locale. One notice per write: a later notice on the same write replaces it. |
ScreenConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| title | string | optional | Heading shown above the screen — a template rendered per run with {{ }} holes over the flow's variables ({{ record.name }}); falls back to the node label when it renders nothing |
| description | string | optional | Body text shown under the heading — a template rendered per run with {{ }} holes ({{ record.name }}) |
| fields | { name: string; label?: string; type?: string; required?: boolean; … }[] | optional | Input fields collected on this screen |
| waitForInput | boolean | optional | Pause to show the screen even with no fields; false forces a server pass-through |
| objectName | string | optional | Render this object's full create/edit form instead of a flat field list |
| idVariable | string | optional | Object form only: variable bound to the saved record's id — a name without a leading $ (the $ names are the flow engine's own), read as {{ name }} |
| mode | Enum<'create' | 'edit'> | optional (default: "create") | Object form only: create (default) or edit; 'edit' needs a recordId to name its target |
| recordId | string | { dialect: 'cel'; source: string; ast?: any; meta?: object } | optional | Object form only: id of the record to edit (required for mode: 'edit' to be useful) — a string, or a CEL value envelope { dialect: 'cel', source } evaluated when the screen is served to the id, a non-blank string (anything else, null included, fails the run at the screen); a {…} template token is refused |
| defaults | Record<string, any> | optional | Object form only: prefilled values keyed by the object's field names — each a CEL value envelope { dialect: 'cel', source } evaluated when the screen is served (the client receives the value, never the envelope), or a literal written as it is; a {…} template token is refused |
Nested Shape: ScreenConfig.fields[number]
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | Field name (the flow variable the value binds to) — a name without a leading $ (the $ names are the flow engine's own), read as {{ name }} |
| label | string | optional | Display label |
| type | string | optional | Input type — an open widget hint (text, number, select, …); number, currency and percent take a finite number on resume (a numeric string is refused); text, textarea, email, url and phone take a string on resume (any other JSON type is refused, never coerced); file renders the platform upload widget and the screen resumes with the uploaded file's id, which a later node writes into a file field; record_link shows the reference record whose id defaultValue evaluates to, by its display name, as a link to its record page, and takes no input |
| required | boolean | optional | Whether a value is required to submit |
| options | { value: any; label: string }[] | optional | Choices for a select-style field; option values must stay distinct when read as text |
| defaultValue | any | optional | Prefilled value: a CEL value envelope { dialect: 'cel', source } evaluated when the screen is served (the client receives the value, never the envelope), or a literal written as it is — a {…} template token is refused |
| placeholder | string | optional | Input placeholder text |
| visibleWhen | string | optional | CEL predicate controlling visibility, evaluated client-side |
| min | number | optional | Minimum accepted value (numeric fields); enforced on resume |
| max | number | optional | Maximum accepted value (numeric fields); enforced on resume |
| inlineHelpText | string | optional | Help text displayed below the field |
| reference | string | optional | Target object name (snake_case) whose records a type: 'lookup' field picks from, or that a type: 'record_link' field's record belongs to; REQUIRED when type is lookup or record_link |
ScreenFieldConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | Field name (the flow variable the value binds to) — a name without a leading $ (the $ names are the flow engine's own), read as {{ name }} |
| label | string | optional | Display label |
| type | string | optional | Input type — an open widget hint (text, number, select, …); number, currency and percent take a finite number on resume (a numeric string is refused); text, textarea, email, url and phone take a string on resume (any other JSON type is refused, never coerced); file renders the platform upload widget and the screen resumes with the uploaded file's id, which a later node writes into a file field; record_link shows the reference record whose id defaultValue evaluates to, by its display name, as a link to its record page, and takes no input |
| required | boolean | optional | Whether a value is required to submit |
| options | { value: any; label: string }[] | optional | Choices for a select-style field; option values must stay distinct when read as text |
| defaultValue | any | optional | Prefilled value: a CEL value envelope { dialect: 'cel', source } evaluated when the screen is served (the client receives the value, never the envelope), or a literal written as it is — a {…} template token is refused |
| placeholder | string | optional | Input placeholder text |
| visibleWhen | string | optional | CEL predicate controlling visibility, evaluated client-side |
| min | number | optional | Minimum accepted value (numeric fields); enforced on resume |
| max | number | optional | Maximum accepted value (numeric fields); enforced on resume |
| inlineHelpText | string | optional | Help text displayed below the field |
| reference | string | optional | Target object name (snake_case) whose records a type: 'lookup' field picks from, or that a type: 'record_link' field's record belongs to; REQUIRED when type is lookup or record_link |
Nested Shape: ScreenFieldConfig.options[number]
| Property | Type | Required | Description |
|---|---|---|---|
| value | any | ✅ | Stored value; it also addresses the option as text (its label translation key), so it must stay distinct from its siblings as text |
| label | string | ✅ | Display label |
UpdateRecordConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| objectName | string | ✅ | Object to update |
| filter | Record<string, any> | optional | Field/value pairs identifying the record(s) to update: each operand — a field's value, an operator's comparand ({"$ne": null}), a list comparand's element — is a CEL value envelope { dialect: 'cel', source } evaluated before the query (one that evaluates to null refuses the node), a query placeholder such as {current_user_id} or {today} the query engine resolves, or a literal; a flow {…} template token is refused |
| fields | Record<string, any> | optional | Field values to write: each key is a field name, each value a CEL value envelope, a text envelope (a sentence written in the organization's language) or a literal |
| multi | boolean | optional | Declare bulk intent: update every row the filter matches (default false — a predicate update without it is refused by the engine) |
Assignment Rule
Assignment Rule schemas of the ObjectStack Automation Protocol: AssignmentRule and 3 more — each property with its type, default and a TypeScript example.
Flow Function
The contract for a named handler function a script node invokes — contributed by defineStack({ functions }) and resolved by name at execute time.