Skip to main content

Grammar

Generated

Generated from noetl/server@5cf0712da626 (orchestrate-core 0.1.0). Do not edit: change the Rust types and regenerate. Machine-readable copies live on noetl.ai.

Playbook​

NoETL playbook grammar (noetl.io/v2), generated from the Rust authoring types in noetl-orchestrate-core 0.1.0. Permissive like the parser (unknown keys are not rejected); tool.kind is closed to the kinds this server accepts. Semantic rules (a start step, unique step names, existing next targets) are enforced by the server's validator, not by this schema.

FieldTypeRequiredDescription
apiVersionstringyesAPI version (noetl.io/v2).
kindstringyesResource kind (Playbook).
metadataMetadatayesMetadata (name, path, labels).
workflowlist of StepyesWorkflow steps.
keychainlist of KeychainDef (optional)Keychain definitions for credentials and tokens.
varsobjectTop-level variables (canonical format).
workbooklist of WorkbookTask (optional)Reusable tasks.
workloadanyGlobal workflow variables.

Step​

Workflow step with canonical format control flow. Canonical step structure: - step: name (unique identifier) - desc: description - spec: step behavior (next_mode, timeout, on_error) - when: transition enable guard (evaluated by server on input token) - loop: optional loop wrapper with spec.mode - tool: ordered pipeline (list of labeled tasks) OR single tool shorthand - next: outgoing arcs with optional when conditions for routing

FieldTypeRequiredDescription
stepstringyesStep name (unique identifier).
toolToolDefinitionyesTool configuration - single tool or pipeline.
argsobjectInput arguments for this step.
descstringStep description.
loopLoop (optional)Loop configuration with spec.mode.
nextNextSpec (optional)Next step(s) with optional when conditions for routing.
setobjectStep-level set: mutations — template expressions rendered against the producing step's completion context, then applied via scope-prefix stripping (ctx.x → x) exactly like arc-level set:. Mirrors Python's step-level set: in noetl/core/dsl/engine/executor/transitions.py.
specStepSpec (optional)Step behavior configuration.
varsobjectVariables to extract from step result.
whenstringTransition enable guard (canonical format). Jinja2 expression evaluated by server before step runs.

ToolDefinition​

Tool definition - can be single tool or pipeline.

One of: ToolSpec | list of PipelineItem

ToolSpec​

Tool specification with tool.kind pattern. All execution-specific fields live under tool.

FieldTypeRequiredDescription
kindToolKindyesTool type. Authored, so flag-gated kinds are refused while their flag is off ([ToolKindGates]).
argsanyDefault arguments / inputs passed to the tool runtime. The canonical NoETL v10 playbook YAML writes this as input: at the step's tool: block. The Rust internal name stays args because that's what the noetl-tools registry's ToolConfig consumes (PythonTool, ShellTool, etc. expose this to user code as args / globals() / shell env). The serde alias means both forms decode into the same field; input: is the form playbooks should write, args: stays accepted for back-compat with existing fixtures. Without the alias, input: is silently dropped by serde, the worker's Python wrapper's globals().update(args) gets an empty dict, and any user code referencing the workload by name (e.g. print(f"hello {message}")) raises NameError. See noetl/ai-meta#56 for the e2e finding.
authanyAuthentication configuration.
codestringPython code (for python tool).
commandanyCommand for the tool runtime. Two shapes share this key and the type must accept both, so it is serde_json::Value (same treatment as args above): - Scalar string — shell / db tools (command: "echo hi", command: "SELECT 1"). The db tools accept it via a #[serde(alias = "command")] on their query field. - Array of strings — the container tool kind, K8s-Job style (command: ["/bin/sh", "-c"]), which the worker's ContainerConfig.command: Option<Vec<String>> consumes. Before noetl/ai-meta#81 this was Option<String>, which made the container tool impossible to execute: an array failed the ToolSpec deserialise server-side ("data did not match any variant of untagged enum ToolDefinition"), and a scalar cleared the server only to be rejected by the worker ("expected a sequence"). Carrying the raw Value lets the array pass through to the worker unchanged while scalars stay JSON strings for the shell / db consumers.
connectionstringConnection string or credential reference.
evallist of EvalEntry (optional)Tool-level flow control (canonical format). Evaluated after tool execution.
headersmap of string (optional)HTTP headers.
libsanyLibraries/dependencies.
methodstringHTTP method (for http tool).
output_selectanyOutput selection strategy (for result externalization).
paramsanyTool params. A raw Value, for the same reason command above is one. ⚠ This was Option<HashMap<String, Value>>, i.e. map-only, and a SEQUENCE of positional SQL parameters therefore failed the untagged ToolDefinition enum outright — data did not match any variant of untagged enum ToolDefinition, a 400 at POST /api/execute with no execution and no clue which field was at fault. Measured 2026-10-07: that rejected all 53 registered adiona/v1/* playbooks, which bind $1 positionally. The dispatcher has always wanted an array here. noetl-tools' tools/postgres.rs declares pub params: Vec<serde_json::Value> and binds it positionally; its own tests use "params": [42], and duckdb.rs uses [1, "hello"]. Only http.rs uses a map. So the map-only type contradicted the dispatcher for every SQL tool kind while matching it for exactly one. Carrying the raw Value lets both forms pass through unchanged. The server has no other reader of this field — it deserialises and re-serialises it for the worker — so widening it changes nothing else.
querystringQuery/SQL (for database tools).
urlstringURL (for http tool).

Other keys are accepted (the parser does not reject unknown keys).

PipelineItem​

One item in a pipeline. Untagged so serde tries each variant in declaration order and picks the first that decodes. Flat is tried first because the v10 dominant form has a top-level kind: field (a required field on ToolSpec); the nested label-as-key form has no kind: at the top level (the key IS the label), so it cleanly falls through to Nested. The serializer round-trips through the nested form so the wire shape downstream (worker's task_sequence consumer) stays unchanged.

One of: ToolSpec | map of ToolSpec

EvalEntry​

Eval entry - can be a condition or an else clause.

One of: EvalCondition | object

EvalCondition​

Eval condition for per-task flow control. Evaluated after each tool execution.

FieldTypeRequiredDescription
dostringyesAction to take: continue, retry, break, jump, fail
attemptsintegerRetry attempts (for do: retry).
backoffstringRetry backoff strategy: linear or exponential.
delaynumberRetry delay in seconds.
exprstringJinja2 expression to evaluate. Access outcome object: outcome.status, outcome.error, outcome.result
set_varsobjectVariables to set (step-scoped).
targetstringTarget step (for do: jump).

EvalElse​

Else clause for eval conditions.

FieldTypeRequiredDescription
dostringyesAction to take.
set_varsobjectVariables to set.

Loop​

Step-level loop configuration (canonical format).

FieldTypeRequiredDescription
iteratorstringyesVariable name for each item.
cursorCursorClaim (optional)Claim block for mode: cursor loops.
instringJinja expression for collection to iterate over. Required for sequential / parallel; absent for cursor (which claims work).
specLoopSpec (optional)Loop spec with mode (canonical format).

LoopSpec​

Loop runtime specification (canonical format).

FieldTypeRequiredDescription
frameFrameSpec (optional)Frame sizing/leasing policy (cursor mode only).
max_in_flightintegerMaximum concurrent iterations in parallel mode / frames in cursor mode.
modeLoopModeExecution mode: sequential, parallel, or cursor.

LoopMode​

Loop execution mode.

One of: sequential, parallel | "cursor"

FrameSpec​

Frame sizing / leasing policy for a mode: cursor loop. Only max_rows is load-bearing in the orchestrator-driven port (it caps each claim and is injected as __frame_max_rows into the claim render context). The lease/heartbeat/byte fields are accepted for playbook compatibility with the Python engine; stale-reclaim is handled by the playbook's own claim SQL (its reclaim_stale CTE), so they are advisory.

FieldTypeRequiredDescription
heartbeat_secondsnumber
lease_secondsnumber
max_bytesinteger
max_rowsintegerMax rows claimed per frame (the claim SQL's LIMIT {{ __frame_max_rows }}).
max_secondsnumber
processstringrow (default) binds iter.<name> to one row; frame is reserved.
row_concurrencyintegerRows of one frame to dispatch concurrently (1 = sequential within frame).

CursorClaim​

The claim block of a mode: cursor loop — a SQL tool that atomically leases a frame of work rows and returns them (its RETURNING columns become the per-row iter.<iterator> object).

FieldTypeRequiredDescription
claimstringyesThe claim SQL (atomic lease, e.g. ... FOR UPDATE SKIP LOCKED ... RETURNING ...).
authstringCredential alias for the claim tool.
kindstringTool kind running the claim (default postgres).

NextSpec​

Next step specification - supports multiple formats for compatibility. Variant order is load-bearing. #[serde(untagged)] tries variants top to bottom, and serde deserializes a YAML sequence into a struct positionally — so if Router (a struct) came first it would greedily eat the list form next: [{step: x}] into a NextRouter with spec taken from element 0 and arcs defaulting to [], silently dropping every target (and defeating the unknown-step validation in validate_next_refs). The sequence-shaped variants are therefore declared before the struct Router, which is reached only for the canonical map form { spec, arcs }.

One of: list of CanonicalNextTarget | list of string | string | NextRouter

NextRouter​

Canonical v10 next router format with spec and arcs.

FieldTypeRequiredDescription
arcslist of NextArcList of arcs (outgoing transitions).
specNextRouterSpec (optional)Router specification (mode: exclusive/inclusive).

NextRouterSpec​

Next router spec for v10 format.

FieldTypeRequiredDescription
modestringRouting mode: exclusive (first match) or inclusive (all matches).

NextArc​

Arc specification for v10 next router format. Canonical format: next.arcs[].when for conditional routing (Petri-net arcs).

FieldTypeRequiredDescription
stepstringyesTarget step name.
setobjectArc-level variable mutations to apply to execution context before dispatching the downstream step. Mirrors Python's set: on arcs. Scope-prefixed keys (ctx.x, iter.x, step.x) are stripped to the bare key; bare keys and unknown-scope dotted keys are written as-is. Values are Jinja2 templates rendered against the producing step's completion context before being applied. YAML key: set:. The legacy args: key is rejected by the Python reference parser and is NOT supported here.
whenstringTransition guard expression (Jinja2). Evaluated by server after step completion.

CanonicalNextTarget​

Legacy target for transition (deprecated, use NextArc).

FieldTypeRequiredDescription
stepstringyesTarget step name.
argsobjectArguments to pass to target step.
whenstringTransition guard expression (Jinja2).

StepSpec​

Step-level behavior configuration.

FieldTypeRequiredDescription
next_modestringNext evaluation mode: exclusive (first match) or inclusive (all matches).
on_errorstringError handling: fail, continue, or retry.
timeoutstringStep timeout (e.g., "30s", "5m").

Metadata​

Playbook metadata.

FieldTypeRequiredDescription
namestringyesPlaybook name (required).
descriptionstringDescription.
labelsmap of string (optional)Labels for filtering.
pathstringResource path.

Other keys are accepted (the parser does not reject unknown keys).

KeychainDef​

Keychain entry for credential/token definitions.

FieldTypeRequiredDescription
namestringyesKeychain entry name.
allowed_regionslist of stringSecrets Wallet Phase 6c — extra regions (besides the entry's own region) from which resolution is allowed when residency is strict or advisory. Empty by default.
authstringCredential alias used to authenticate to provider (e.g. a service account). On a provider that authenticates by ambient identity (GCP Workload Identity), this is unused.
auto_renewbooleanAuto-renew flag.
credentialstringCredential reference.
mapmap of string (optional)Output-key → secret-reference map. Each value is a secret-path template (rendered against the workload at resolution time); the resolved entry is the object { <key>: <secret-value>, ... } — the "auth object as a map" shape. Absent for single-value entries.
no_broker_fallbackbooleanSecrets Wallet Phase 6e — opt-out for the cross-region broker fallback. When true, a strict-mode residency denial bubbles up as ResidencyViolation even if a broker is configured for the entry's region — used for credentials whose policy says "this data physically cannot leave its home region, full stop." Default false (broker fallback honoured when registered).
providerstringSecret-source backend that resolves this entry: gcp (Google Secret Manager), aws, azure, vault, k8s. When set, the server-side keychain resolver fetches the value(s) from this provider on a cache miss (Secrets Wallet Phase 3b). None means the entry is supplied by other means (pre-registered credential, minted token).
regionstringSecrets Wallet Phase 6a — home region of this secret (e.g. us-east-1, europe-west4). When set, the resolver passes it to the chosen [crate::secrets::SecretProvider]: AWS uses it as the regional endpoint host; Azure / Vault use it for vault / cluster routing; GCP uses it as part of the resource id. None falls back to the server's NOETL_SERVER_REGION env. Per agents/rules/safety.md, the region is a routing hint, not a secret — public-safe.
residencyResidencySecrets Wallet Phase 6c — residency policy. Controls whether a server in a different region than this entry's region is allowed to resolve it. See [crate::secrets::residency::Residency].
scopestringScope type.
token_typestringToken type.

Other keys are accepted (the parser does not reject unknown keys).

Residency​

Residency policy for a [KeychainDef] — part of the playbook model, so it lives in the core with the rest of the types (noetl/ai-meta#108). The server's secrets::residency module re-exports this enum and holds the region-check logic (which needs server-only deps); the enum itself is pure data.

One of: "none" | "advisory" | "strict"

WorkbookTask​

Reusable task definition in workbook.

FieldTypeRequiredDescription
namestringyesTask name.
toolToolSpecyesTool configuration.
sinkanyOptional sink configuration.

ToolKind​

Supported tool kinds.

One of: http, postgres, duckdb, ducklake, python, workbook, playbook, playbooks, secrets, iterator, container, script, snowflake, transfer, snowflake_transfer, gcs, gateway, nats, shell, artifact, noop, task_sequence, rhai | "subscription" | "wasm"