ObjectStackObjectStack

Schemaless Node Config — Automation Protocol

Config contracts for the descriptor-schemaless builtins whose designer form lives ONLY in objectui's hand-written FLOW_NODE_CONFIG table — script.

Config contracts for the descriptor-schemaless builtins whose designer form lives ONLY in objectui's hand-written FLOW_NODE_CONFIG table — script, subflow and decision (#4278).

Why these nodes publish no descriptor configSchema — and still need this

config-schemas.test.ts in service-automation pins the schemaless class with each member's reason: decision's virtual Target column is derived from the out-edges, subflow carries a top-level timeoutMs — a published partial schema would DROP those editors (the #4210 connector_action incident). So the Studio form for these types is objectui's hand-written group, and until #4278 nothing reconciled that hand-written table against the executors: script's form offered an outputVariables key nothing reads, two actionType options that fail every run, a no-op default — and could not author the function/inputs/outputVariable path that works.

script's own reason for staying schemaless was that its form switched on actionType. #4343 retired that switch, so the node is now three flat keys and could graduate to a published descriptor configSchema the way map did — a follow-up, deliberately not folded into the retirement.

These schemas are the machine-readable half of that reconciliation. They are written from the executors (service-automation/builtin/screen-nodes.ts for script, subflow-node.ts, logic-nodes.ts for decision), not from any form, and objectui's flow-node-config reconciliation test compares its hand-written key sets against them — the same bidirectional ledger the descriptor-schema'd builtins get from builtin-node-form-zod-ledger.test.ts, carried across the repo seam by the @objectstack/spec dependency objectui already has.

wait and connector_action — the other two schemaless members — need no entry here: their contracts are the spec-structured sibling blocks on FlowNodeSchema (waitEventConfig / connectorConfig), which the same objectui test reconciles directly.

What these schemas are wired to

script and subflow are parsed at execute time since #4343, through the same parseNodeConfig() seam #4277 gave the flat builtins (service-automation's parse-config.ts): a config that fails its contract refuses the node as a GUARD — wrong metadata, so a rerun cannot help and no fault edge may route it (#3863).

script could not be parsed while its legal key set depended on actionType; #4343 removed that dependence instead of modelling it. Converging the node to its one real path — call a registered function — left a flat three-key contract a flat parse fits exactly, and the five keys the other branches read became retiredKey tombstones.

The two halves reach different audiences, which is why they shipped together:

  • the tombstones teach whoever authors the key — tsc types it never, and a direct parse raises the prescription. They do NOT reach a stored flow: FlowNodeSchema.config is z.record(z.unknown()), so no load-path parse ever descends into a node's config;
  • the execute-time parse is what a stored flow meets. registerFlow canonicalizes data at rest through the retired conversion too (#3903), so a stored actionType: 'email' node arrives here stripped of the keys nothing read — and then refuses, naming the function it does not have, instead of logging a line and reporting success as it used to.

decision is parsed at registration, for one key (#15429): the automation engine's registerFlow runs every decision node's config through DecisionConfigSchema and refuses the flow on any issue rooted at mode — a value outside the closed pair, or a mode beside a non-empty conditions list — with this schema's own sentence, and os validate reports the same issues as flow-decision-mode-invalid, so the two doors cannot disagree. A decision may carry no conditions at all when it branches purely on edge predicates; its executor reads conditions and nothing else, and the engine's traversal reads mode. Its strictness (unknown keys) still binds at authoring, in the published JSON Schema and in the objectui reconciliation test, which is what #4278 was actually about (a form authoring keys nothing reads).

Undeclared aliases are NOT part of these contracts: subflow's historical flow spelling graduated into the ADR-0087 D2 conversion flow-node-subflow-flow-alias (the map.flow path), which left the load path at 18 (#23487) and rewrites only stored flows, so an authored flow meets SUBFLOW_KEY_GUIDANCE and the executor only ever sees flowName.

Unknown keys — closed as of #4001 批 9, and this class had NO other door

The descriptor-schema'd builtins have a registration-time key gate: registerFlow() walks each node's config against the descriptor's configSchema and hard-rejects what it does not declare (#4277). These three node types are exempt from that walk — by construction, since it derives the declared set from a configSchema they publish none of (validateNodeConfigKeys' schemaless exemption). So until now the entire script / subflow / decision config surface had exactly zero unknown-key enforcement at any layer: the execute-time parse #4343 added checks types and requiredness, and Zod's default .strip deleted everything else in silence.

That is the #4001 asymmetry in its purest form — a guard was written for the door in front of its author, and the class it structurally could not cover is precisely the class with no second door. Closing these shapes is therefore not a duplicate check for script and subflow; it is their first one.

decision's strictness binds at authoring (tsc), in the published JSON Schema, and in objectui's reconciliation — not at run time, where the registration reader judges mode alone (#15429). It is closed anyway, because the campaign's whole finding is that a shape left open accretes a test, a form and a fixture that assert the openness, and then closing it is a migration instead of an edit.

Source: packages/spec/src/automation/schemaless-node-config.zod.ts

TypeScript Usage

import { DecisionConditionSchema, DecisionConfigSchema, ScriptConfigSchema, SubflowConfigSchema } from '@objectstack/spec/automation';
import type { DecisionCondition, DecisionConfig, ScriptConfig, SubflowConfig } from '@objectstack/spec/automation';

// Validate data
const result = DecisionConditionSchema.parse(data);

DecisionCondition

Properties

PropertyTypeRequiredDescription
labelstring✅Branch label; the winning branch resumes down the out-edge with this label (no match → the out-edge marked isDefault, or one labelled 'default')
expressionstring✅Bare CEL predicate deciding this branch

DecisionConfig

Properties

PropertyTypeRequiredDescription
conditions{ label: string; expression: string }[]optionalOrdered decision branches (first true expression wins; omit to branch purely on edge conditions)
modeEnum<'exclusive' | 'inclusive'>optionalDeclares how many out-edges an edge-branched decision takes when more than one out-edge condition holds: 'exclusive' = only the first, in the order the edges are declared (what an omitted mode means; the siblings after it are not evaluated and record a skipped step); 'inclusive' = every one that holds, one after another. When none holds the isDefault edge runs either way. Refused beside a non-empty conditions list, which is first-match on its own: delete mode there, or move the branches onto the out-edges, delete conditions, and keep mode. Authored sources written while every true branch ran keep that behaviour through the os migrate meta --from 17 conversion, which writes mode: inclusive onto every edge-branched decision with two or more conditioned out-edges; a flow stored in sys_metadata is not rewritten and takes the first-match reading on upgrade (os migrate meta --stored lists those decisions).

Nested Shape: DecisionConfig.conditions[number]

PropertyTypeRequiredDescription
labelstring✅Branch label; the winning branch resumes down the out-edge with this label (no match → the out-edge marked isDefault, or one labelled 'default')
expressionstring✅Bare CEL predicate deciding this branch

ScriptConfig

Properties

PropertyTypeRequiredDescription
functionstring✅Registered function to call (defineStack({ functions })). Contractually pure — it returns a value a later declarative node persists
inputsRecord<string, any>optionalInputs 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
outputVariablestringoptionalFlow 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 }}

SubflowConfig

Properties

PropertyTypeRequiredDescription
flowNamestring✅Flow invoked as this step (it may pause — approval / screen / wait)
inputRecord<string, any>optionalValues passed to the subflow's input variables: each value a CEL value envelope { dialect: 'cel', source } evaluated in the parent's scope, or a literal written as it is — a {…} template token is refused. A value handed over, null included, wins over the child variable's defaultValue
outputVariablestringoptionalParent flow variable the subflow's output is bound to — a name without a leading $ (the $ names are the flow engine's own), read as {{ name }}

On this page