ONEWEB6.0Docs

Reference: Flows, Connections and expressions

42 min readDeveloper guides

Audience: a developer who knows JS/TS, SQL, HTTP and Docker but is new to ONEWEB 6.0. This is a lookup page, not a tutorial. Read a section when you need the exact field, env var name, refusal text or operator.

Sources: kernel-schemas/{connection,flow,policy,decision}.schema.json; kernel-poc/src/{connection-env,flow-trigger,flow-soap,flow-rest,flow-file,flow-script,resilience,compile-expr,compile-feel,gen-flow,gen-camel,gen-api}.js; kernel-poc/src/tools/{flow,connection,decision}.js; CLAUDE.md; docs/part-5-integration-hub.md, docs/part-9-reference.md.

How to read the labels. "checked against compile-expr.js" or "checked against compile-feel.js" means I imported that pure module and ran the example. "(not run)" means the text is quoted from source only. "(not verified)" means I could not confirm it from source.

Siblings: dev-1-getting-started.md · dev-2-recipes.md · dev-3-services-directory.md · dev-4-api-and-mcp.md · this page · dev-6-refusals-troubleshooting.md

Contents

  • Part A, Connections: D5.1 to D5.4
  • Part B, Flows: D5.5 to D5.12
  • Part C, Expressions: D5.13 to D5.19

Part A. Connections

D5.1 What a Connection is, and the rules that apply to every kind#

A Connection (kind is one of database, http, soap, amqp, kafka, smtp, objectStore, sftp, vector, custom) names an external system. It never holds a credential. It holds *Ref fields (an environment variable name or a vault-style path) and secretRef fields (a vault path).

Three rules shape everything below:

  1. A *Ref field IS the env var name. http.baseUrlRef: "CREDIT_BUREAU_BASE_URL" means the runtime reads CREDIT_BUREAU_BASE_URL. assertEnvName refuses anything that is not ^[A-Z_][A-Z0-9_]*$ (for example the env:x.url or jndi: binding strings that the 5.0 importer produces) with the message "<name>" is not an environment variable name.
  2. A secretRef is transformed, not used literally. secretEnvVar upper-cases it and turns every run of non-alphanumerics into _, trimming the edges. "vault:credit-bureau/api-key" becomes VAULT_CREDIT_BUREAU_API_KEY.
  3. A Connection is runtime-neutral, its resolved value is not. The Node app reads one postgres:// URL with credentials inside. The Hub worker (Camel on Quarkus) needs a JDBC URL with no credentials plus two separate names for user and password. connection-env.js is the ONLY place a name is minted; hub-config.js decides which value goes in each name for an environment. Never type a Connection value into a worker's compose file. Change the Connection or the Workspace Environment and regenerate (generate:camel, generate:hub-env; see dev-3-services-directory.md).
flowchart LR A["Connection artifact<br/>Ref fields and secretRef"] --> B["connection-env.js<br/>mints the env var names"] B --> C["nextjs names<br/>for a database: one URL, one secret"] B --> D["camel-quarkus names<br/>for a database: JDBC URL, user, password"] E["Workspace Environment<br/>and OpenBao secrets"] --> F["hub-config.js<br/>decides the values for both"] F --> C F --> D C --> G["Generated app env"] D --> H["Hub worker env"]
A Connection resolved per runtime

What the tools refuse for every kind (tools/connection.js, connection_create and connection_set_config):

  • A kind with no config block: <where>: kind "<kind>" needs a "<key>" config block. vector is the exception; it has no config block in the schema and the check returns early.
  • http or soap with an auth.type other than none and no secretRef: <where>: auth.type "<type>" needs a secretRef — credentials never live in the artifact itself.
  • Bad http.defaultHeaders (D5.6, "Header rules").

The schema's allOf only requires the config block for database, http, sftp and amqp; the tool layer requires it for every kind.

Which runtime reads which kind

kind In-app (Next.js, gen-flow.js) Hub (Camel, gen-camel.js)
http yes yes
database yes (postgres live; five more structural) postgres only
objectStore yes (s3, minio) yes (s3, minio)
smtp yes yes (no tls: true)
soap no yes
amqp no yes
kafka no yes
sftp no yes (file triggers)
custom, vector no no

connectionEnvNames throws for an unsupported pair, for example <id>: an amqp Connection has no in-app convention — queues run on the Integration Hub only, and for custom/vector it throws <id>: kind "<kind>" has no environment convention — supported: http, database, smtp, soap, objectStore, sftp, amqp, kafka.

D5.2 database#

Field Required Notes
database.dialect no in schema enum postgres, mysql, mariadb, sqlserver, oracle, db2, tibero, db400
database.hostRef no env var name for the connection address. If absent the Connection id is run through secretEnvVar as a fallback name
database.schema no
database.secretRef no resolves to user:password (the app's own login)
database.readerSecretRef no Data Studio's read-only login
database.writerSecretRef no Data Studio's write login
database.revealerSecretRef no Data Studio's login for reading ONE sensitive field
database.poolHints no maxSize, timeout

Env var names

Runtime Role to name
nextjs url = the hostRef value (one postgres:// URL, credentials inside)
camel-quarkus jdbcUrl = <hostRef>_JDBC; user = <SECRET>_USER; password = <SECRET>_PASSWORD, where <SECRET> is secretEnvVar(secretRef). The user/password names exist only when secretRef is set

The JDBC name is mechanical (hostRef plus _JDBC), so it can be derived from the artifact. A Quarkus datasource bean is named from the Connection id (datasourceName: the id minus conn:).

Dialect support

  • In-app: DIALECT_DRIVERS has postgres (pg, live), and mysql, mariadb, sqlserver, oracle, db2 (structural only). Refused with <id>: database.dialect "<d>" has no generated connector — supported: ... (tibero refused by name — no confidently-citable Node.js driver). db400 is not in the table, so it is refused the same way.
  • Hub: hub-config.js throws <id>: dialect "<d>" has no per-runtime translation — postgres only; the other dialects are structural in the compilers and have never run here.

Tool refusals (each login must be its own):

  • database.readerSecretRef must not be the app's secretRef — Data Studio's reader login is its own, least-privilege (provision-data-reader.js).
  • writerSecretRef equal to secretRef or to readerSecretRef is refused.
  • revealerSecretRef equal to secretRef, readerSecretRef or writerSecretRef is refused.

D5.3 http, soap, smtp#

http#

Field Notes
http.baseUrlRef env var name holding the FULL base URL including scheme. The Hub throws http.baseUrlRef is required — nothing names the base URL if missing
http.auth.type enum none, basic, apiKey, bearer, oauth2ClientCredentials, signature
http.auth.secretRef required (by the tool) for any type but none
http.auth.apiKeyHeader required for apiKey: <id>: auth.type "apiKey" needs auth.apiKeyHeader
http.auth.oauth2 tokenUrlRef, scopes[] (stored; no runtime resolves them, see below)
http.defaultHeaders {name: text}. Both runtimes send them before the auth header
http.tls verify (default true; the schema says deploy gates reject false for prod), caCertRef

Env var names, both runtimes: baseUrl = the baseUrlRef value; secret = secretEnvVar(auth.secretRef) when set. A basic secret is the single string user:password.

auth.type App Hub
none, apiKey, bearer yes yes
basic yes (Authorization: Basic base64(secret)) refused: auth.type "basic" has no Camel resolver in this spike — use "apiKey"/"bearer"/"none"
oauth2ClientCredentials, signature refused: auth.type "<t>" has no generated resolver yet — connection.schema.json does not carry enough fields to implement it without guessing a shape ... refused with the same "no Camel resolver" text

soap (Hub only)#

Field Notes
soap.endpointRef env var name holding the endpoint as a FULL URL (scheme included). In an environment the worker's value is derived from a service plus an optional basePath, never typed
soap.auth.type enum none, basic, wsSecurity
soap.auth.secretRef user:password, required for basic
soap.wsdlUrlRef documentation only; nothing reads the WSDL

Hub env names: endpoint, plus user/password only for basic. wsSecurity is refused by name (D5.9). A soap Connection used in the app throws a soap Connection has no in-app convention — a soap step runs on the Integration Hub only.

smtp#

Field Notes
smtp.endpointRef required. Env var holding host:port (not a URL, so nobody puts credentials in it)
smtp.fromAddress required, and must match an email shape. kind "smtp" needs smtp.fromAddress — the envelope sender. It belongs to the connection rather than to each message, so one flow cannot send as another address
smtp.secretRef user:password; omit for a server with no auth
smtp.tls implicit TLS (465); default false, which still allows STARTTLS on 587

Env names: endpoint; app secret; Hub user and password. On the Hub, smtp.tls: true is refused: smtp.tls is true, which has no proven Camel form yet (gen-flow.js sends secure:true; this route would send plaintext smtp://). A notify step sends only through an smtp Connection; without one it is a labelled stub.

D5.4 objectStore, sftp, amqp, kafka, custom, vector#

objectStore#

Field Notes
objectStore.provider enum s3, minio, gcs, azureBlob
endpointRef, bucket env var name for the endpoint; bucket name
secretRef accessKey:secretKey
readerSecretRef Data Studio's read-only key (GetObject + ListBucket)
writerSecretRef Data Studio's write key (PutObject + DeleteObject, cannot list or read)

Env names: endpoint; app secret; Hub accessKey = <SECRET>_ACCESS_KEY, secretKey = <SECRET>_SECRET_KEY. Only s3 and minio have a connector on either runtime: objectStore.provider "<p>" has no generated connector — supported: s3, minio ... (app) and ... has no Camel connector — supported: s3, minio (same set as gen-flow.js) (Hub). Tool refusals: readerSecretRef must differ from secretRef; writerSecretRef must differ from both.

sftp (Hub only, used by file and fileBasket triggers)#

Field Required Notes
sftp.endpointRef yes env var holding host:port
sftp.secretRef yes user:password (password auth) or user:passphrase (privateKey auth, passphrase may be empty)
sftp.hostKeyRef yes resolves to the server's PUBLIC host key. Strict host-key checking, no fallback file, never trust-on-first-use
sftp.authType no password (default) or privateKey
sftp.privateKeyRef when privateKey the client's PEM private key

Hub env names: endpoint, user, password (the password, or the key's passphrase), hostKey. For privateKey auth there is also privateKeyFile, which is NOT an env var: it is the literal container path /secrets/<connection-slug>.pem (HUB_SECRETS_DIR plus secretFileName). A PEM key has newlines and env_file cannot carry them, so hub-apply.js writes it to a gitignored secrets/ directory that the worker bind-mounts read-only.

Tool refusals:

  • kind "sftp" needs sftp.<endpointRef|secretRef|hostKeyRef> (the host key one adds — the server's public host key; an unidentified server is never trusted on first use).
  • sftp.authType "privateKey" needs sftp.privateKeyRef.
  • sftp.privateKeyRef is set but authType is "password" — it would never be read; set authType to "privateKey".

PGP content encryption is not built (the schema says Phase 2).

amqp (RabbitMQ, Hub only)#

Required: amqp.endpointRef (host:port) and amqp.secretRef (user:password). Optional: vhost (default /), operatorSecretRef (the Kernel's own least-privilege login for failed-items tools).

Hub env names: endpoint, user, password. Tool refusals: kind "amqp" needs amqp.<k>; amqp.operatorSecretRef must not be the worker's secretRef — the Kernel's operator login is its own, least-privilege. No TLS to the broker yet.

kafka (Hub only)#

Required: kafka.bootstrapServersRef (host:port[,host:port...]). Optional: securityProtocol (PLAINTEXT default, SASL_SSL, SASL_PLAINTEXT), saslMechanism (PLAIN, SCRAM-SHA-256, SCRAM-SHA-512), secretRef (user:password).

Hub env names: endpoint, plus user/password when secretRef is set. Tool refusals:

  • kafka.securityProtocol "<p>" needs kafka.saslMechanism (for any non-PLAINTEXT).
  • kafka.securityProtocol "<p>" needs kafka.secretRef.
  • kafka.saslMechanism is set but securityProtocol is PLAINTEXT — SASL needs SASL_SSL or SASL_PLAINTEXT.

custom and vector#

custom takes connectorPackRef, config, secretRef and the tool requires a custom block, but no compiler has a resolver for it. vector has no config block. Neither can be used by a step on either runtime (no environment convention).

healthCheck (enabled, intervalSeconds, path) exists on every kind in the schema. I did not find a compiler or runtime that reads it (not verified).


Part B. Flows

D5.5 The Flow model#

A Flow artifact is {trigger, variables, steps, edges, expose, runtime, layout}; steps and edges are required. It compiles through two renderers of one spec:

  • gen-flow.js makes a Next.js route plus a trampoline (one switch case per step, running in-process in the generated app).
  • gen-camel.js makes Camel YAML routes for the standalone Integration Hub worker.

They must agree. Parity is proved by execution (verify-camel-parity.js POSTs the same input to both and compares), never by diffing output.

flowchart LR F["Flow artifact<br/>trigger, variables, steps, edges"] --> A["gen-flow.js<br/>in-app trampoline"] F --> B["gen-camel.js<br/>Camel YAML routes"] A --> C["Generated Next.js app"] B --> D["Integration Hub worker"] C --> E["Steps: rest, map, router, respond, database, notify, file, decision, render, subFlow<br/>Triggers: invoke, webhook via expose"] D --> G["Steps: rest, soap, map, router, respond, database, notify, file, decision, render, publish, script<br/>Triggers: also schedule, event, queue, file, fileBasket"]
One Flow, two runtimes

runtime.engine is java (schema default) or node. gen-flow.js refuses anything but an explicit node: <flow>: runtime.engine is "java (the schema default)" — this generator only emits Node.js execution. Set runtime.engine: "node" explicitly .... The Workbench "+ New" sets node for new flows.

Graph rules (both compilers, same words): exactly one step with no incoming edge (exactly one step with no incoming edge is required (the flow's entry point), found N); a respond step is terminal (respond step "<id>" has outgoing edges — it is terminal); a router needs exactly one isDefault edge with no condition (router "<id>" needs exactly one isDefault outgoing edge (found N), ... default edge must not carry a condition), every other edge needs a condition (... has neither a condition nor isDefault); any other step needs exactly one outgoing edge (non-router steps need exactly 1). Camel adds router "<id>" has only its default edge — a router needs at least one conditioned edge.

Variables {name, type, isList, schema, isInput, isOutput, sensitive, scope}:

  • type enum: string, number, decimal, boolean, date, object, json.
  • scope is flow (default) or message.
  • A variable name must be ONE identifier (letters, digits, _, not starting with a digit, not true/false/null/in), because router conditions read it as an expression root. flow_add_variable refuses otherwise: variable "<n>" could never be referenced — a name is ONE identifier ....
  • isInput variables are seeded from the HTTP body/query, queue message or Kafka message. isOutput marks what a caller (a process service task) reads back.
  • sensitive: true means the value is never recorded in run history; both runtimes write ***. flow_set_variable replaces the whole entry but keeps sensitive unless you pass it.

D5.6 Triggers#

trigger.kind is invoke, webhook, schedule, event, file, fileBasket, queue. An HTTP entry point (invoke or webhook) is ALWAYS expose; the trigger says who calls, not where.

kind Config fields App Hub Rule module and refusals
invoke none yes (via expose, or called by a page or process) yes (via expose) none
webhook none; trigger.webhook is deprecated needs expose needs expose refuseWebhookWithoutExpose (below). The tool refuses a stored-new trigger.webhook: trigger.webhook is deprecated and never compiled — a webhook flow's route is its \expose` (flow_set_expose: path, method, policyRef). Pass trigger { kind: "webhook" } alone`
schedule schedule.cron, schedule.timezone not run yes tool: a schedule trigger needs schedule.cron. Camel: trigger.kind "schedule" needs trigger.schedule.cron; trigger.schedule.cron "<c>" has N fields — the cron component takes five to seven (minute-first; ...); trigger.schedule.timezone is not compiled ... (leave it unset)
event connectionRef (kafka), topic, groupId, filter not run yes eventTriggerProblems
queue connectionRef (amqp), queue, prefetch (1 to 1000) not run yes queueTriggerProblems
file connectionRef, folder, pattern, doneFolder, failedFolder, pollSeconds (1 to 3600, default 10), charset (utf-8 or tis-620), into {name,size,content} not run yes fileTriggerProblems
fileBasket connectionRef, folder, doneFolder, failedFolder, keyPattern, completeness {kind: count or timeout, expected}, cutoffMinutes (1 to 10080), pollSeconds, into {key, files} not run yes fileBasketProblems, keyPatternProblems

A queue, event, file or fileBasket trigger plus expose on the same flow is refused by the Hub: <flow>: a <kind> trigger AND expose <METHOD> <path> — one Hub route has one entry point, and compiling either would silently drop the other. Split it ....

File trigger refusals (fileTriggerProblems; copied):

  • trigger.file.<connectionRef|folder|doneFolder|failedFolder> is required
  • trigger.file.<k> "<v>" may hold only letters, digits and . _ - /
  • trigger.file.pattern "<p>" may hold only letters, digits, . _ - and the wildcards * ?
  • trigger.file.charset "<c>" must be one of utf-8, tis-620
  • trigger.file.connectionRef <ref> does not exist / is kind "<k>" — a file trigger reads an objectStore or sftp Connection
  • <ref> is provider "<p>" — a file trigger reads s3 or minio
  • trigger.file.pattern is SFTP only — the object-store consumer has no name filter ... Use a dedicated inbox prefix instead
  • Folder shape: must be an object-store prefix: no leading "/", ending in "/" (or must be relative to the SFTP login directory: ...)
  • trigger.file.<done|failed>Folder "<f>" is the inbox "<in>" or inside it — a moved file would arrive again
  • trigger.file.doneFolder and failedFolder are both "<f>" — a completed file and a failed one would be indistinguishable
  • trigger.file.into.<k> names "<n>", which is not a declared isInput variable — declare it (flow_add_variable) rather than have the trigger invent it, and a type mismatch (name and content are string; size is number or decimal).

fileBasket refusals (selected, flow-trigger.js):

  • trigger.fileBasket.keyPattern "<p>" has N capture groups — exactly one, whose text is the basket key
  • ... uses lookaround or a named group — only plain groups, and (?: ) for one that must not capture
  • trigger.fileBasket.completeness must be { kind: "count", expected: N } or { kind: "timeout" }
  • trigger.fileBasket.completeness.expected is required for count — a whole number from 1 to 1000
  • trigger.fileBasket.completeness.expected is for count only — a timeout basket is released after the cutoff of silence, whatever arrived
  • trigger.fileBasket.cutoffMinutes must be a whole number of minutes from 1 to 10080 (a week)
  • trigger.fileBasket.into.files names "<n>", ... the members are a LIST of objects {name, size}: declare it as an object variable with isList
  • the same folder, inbox and done/failed rules as file.

queue / event refusals: trigger.queue.connectionRef <ref> is kind "<k>" — this connection must be amqp; trigger.event.connectionRef ... must be kafka; a queue or topic name must match ^[A-Za-z0-9._-]+$ and must not end in .dlq: trigger.queue.queue "<q>" ends in .dlq — reserved for dead-letter destinations, which the DLQ slice reads; trigger.queue.prefetch N must be a whole number from 1 to 1000; trigger.event.filter is not a valid expression: <message>.

D5.7 Steps: the full table#

step.type enum: rest, soap, database, script, map, router, subFlow, file, notify, respond, decision, render, publish. Every step has id, type, name, optional io {inputs, outputs, mappings} and optional resilience.

SUPPORTED in gen-flow.js is rest, map, router, respond, database, notify, file, decision, render, subFlow. SUPPORTED_CAMEL in gen-camel.js is rest, soap, map, router, respond, database, notify, file, decision, render, publish, script.

Step Fields App Hub Notes and refusals
rest rest.connectionRef, url, method (GET, POST, PUT, PATCH, DELETE), headers, contentType, accept; io.mappings yes yes POST/PUT/PATCH mappings build a JSON body; GET/DELETE mappings build a query string. {name} in url is substituted from a variable. contentType and accept are sent by neither runtime. Headers: D5.9
soap soap.connectionRef, operation, namespace, elementForm, soapAction, version (1.1 default, 1.2), response[]; request is io.mappings no yes soapStepProblems, D5.9. App refuses: <flow>: <ids> call a SOAP service, which runs on the Integration Hub only today — the generated app has no SOAP compiler. Deploy this flow to a Hub runtime (hub_deploy) instead of generating it in the app
database database.connectionRef, operation (select, insert, update, delete), command, mapping[] yes yes, postgres only command uses positional $1, $2; mapping[N-1].from binds $N. Hub: step "<id>" command uses $N but database.mapping has no entry for it (K mapping(s)). Values are always bound, never concatenated
script script.lang, handler, source, outputs[] no yes only javascript compiles (sandboxed GraalJS on the Hub). scriptStepProblems: script step "<id>" needs script.lang ("javascript" — "java"/"ts" are 5.0-import-only); ... declares lang "<l>" — only "javascript" compiles today ...; needs script.source; declares outputs the flow never declared as variables: <names>. The app lists script as unsupported: not executable yet: <id> (script) — executable step types today: rest, map, router, .... A script reads and writes variables.x (a bare input name is a ReferenceError)
map map.mappings[{from,to}], map.transforms[{target,expression}] yes yes tool: a "map" step needs map.mappings (at least one). transforms is in the schema; whether either compiler reads it is not verified
router none; branches live on outgoing edges[].condition and one isDefault yes yes conditions are expressions (D5.15). The Hub compiles them to Camel Simple, the app to JS
subFlow subFlow.flowRef, pin yes no Hub: not executable on Camel yet: <id> (subFlow) .... App: refuses a pin (pins <target> to "<pin>", but a subFlow runs the target's generated module, compiled from its CURRENT spec), an io block, self-call, cycles, a target with no expose, and a protected target that does not name the caller in expose.subFlowCallers
file file.direction (read or write), file.config {connectionRef, key XOR keyFrom, bodyFrom}, format yes yes fileStepProblems, D5.9. objectStore Connection only (s3, minio). format is read by neither runtime
notify notify.templateRef (a Content artifact), notify.config {connectionRef, to XOR toFrom} yes yes tool: a "notify" step needs notify.templateRef; with a Connection it must be smtp and name exactly one of to / toFrom; a recipient with no Connection is refused (names a recipient but no connectionRef, so nothing would be sent). No Connection means a labelled stub. A letter with an unfilled {{...}} placeholder is not sent
respond respond.status (number), respond.bodyFrom yes yes tool: a "respond" step needs respond.status (a number). Without bodyFrom it sends all variables as JSON
decision decision.decisionRef yes yes (via sidecar) tool: a "decision" step needs decision.decisionRef. The Hub calls the generated app's own sidecar so there is one FEEL implementation, not a Java port
render render.contentRef yes yes (via sidecar) tool: a "render" step needs render.contentRef. Same sidecar idea for the template engine
publish publish.connectionRef (amqp or kafka), queue (queue name on amqp, topic name on kafka), fields[] no yes publishStepProblems, D5.9. App: <flow>: <ids> publish to a queue, which runs on the Integration Hub only — the generated app has no broker client. Deploy this flow to a Hub runtime (hub_deploy) instead of generating it in the app

D5.8 Resilience#

Common to every step: resilience {timeout, retry {max, backoff, interval}, circuitBreaker}.

  • timeout: shorthand Nms|Ns|Nm|Nh. App: an AbortController per call. Hub: an endpoint option (http connect plus response timeout; SQL query timeout in whole seconds, rounded up).
  • retry.backoff: none, fixed, exponential. Delays are 200 ms fixed, doubling for exponential, none for none. On the Hub, retry.interval overrides the base delay; the app does not read it. Camel redelivery is route-scoped, so steps with DIFFERENT retry policies in one flow are refused: steps <ids> declare different retry policies — Camel redelivery is route-scoped, so one route cannot honour both.
  • circuitBreaker {enabled, failureThreshold, minimumCalls, resetAfter, fallbackStep}, compiled by both runtimes. Rule: resilience.js circuitBreakerProblems, which uses these exact messages:
    • step "<id>" enables a circuit breaker but has no resilience.circuitBreaker.minimumCalls (a positive integer — how many of the most recent calls the failure rate is computed over; refused rather than defaulted, since a rate over fewer calls than this means nothing)
    • ... failureThreshold must be a rate between 0 (exclusive) and 1 (inclusive), e.g. 0.5 for "half the recent calls failed" — got <v>
    • ... resetAfter is missing or not a supported shorthand duration (Nms|Ns|Nm|Nh) ...
    • ... names resilience.circuitBreaker.fallbackStep ("<s>") — not compiled on either runtime (onFallback can only run inline steps, not jump to another node in the graph); drop it, an open circuit fails the same way an exhausted retry does
    • failureThreshold is a RATE (0 to 1), not a count. On the Hub it is MicroProfile Fault Tolerance (Camel's failureRatio is an integer percentage); the app hand-rolls a sliding window of the last minimumCalls outcomes with per-process state, not shared across instances. No designer authors a breaker; tools and seeds only.

D5.9 Rule modules and their refusals#

These are "decided once" rules. The tool layer reads them when you write the step; the compilers read the same function when they compile, so a variable removed later cannot compile quietly.

flow-soap.js, soapStepProblems#

  • a soap step needs a soap block (connectionRef, operation, namespace, elementForm); soap.<k> is required.

  • soap.wsdlUrl is not read — the address is the Connection's (soap.endpointRef), and the WSDL is documentation, not input (also for soap.endpoint).

  • soap.operation "<o>" must be an XML local name: letters, digits, _ and - (it is the request's root element).

  • soap.namespace "<n>" must be a URI with a scheme and no quote, backslash, <, >, & or space; soap.elementForm "<e>" must be qualified or unqualified; soap.version "<v>" must be one of 1.1, 1.2.

  • Connection checks: soap.connectionRef <ref> is kind "<k>" — a soap step needs a "soap"-kind Connection; <ref> has no soap.endpointRef — nothing names the endpoint; <ref> uses wsSecurity, which this step does not compile — it needs the WS-* stack (CXF), not the plain HTTP call this step makes. Use none or basic; <ref> has soap.auth.type "basic" but no secretRef.

  • Request mappings: request mapping to "<p>" must be dotted XML local names ...; two request mappings write the element "<p>" — a value is one element, a LIST variable is how an element repeats; request mapping from "<p>" names "<root>", which is not a declared variable; ... a reply is not a source here — map it into a declared variable first, then send that variable; the mappings into "<k>" are not together — "<to>" reopens an element another mapping closed; write them side by side, in the schema's order.

  • Response: response to "<v>" names a variable that is not declared — declare it (flow_add_variable) rather than have the step invent it; two response entries write the variable "<v>".

  • Behaviour: the envelope is built from io.mappings in the order written (it must match the WSDL schema's order); every value is XML-escaped; a control character or a structured value fails the step; a Fault or non-2xx FAILS the step; an element missing from the reply leaves the variable unset. The step posts with the plain http component, not CXF. It is an EFFECT for replay.

flow-rest.js, restHeaderProblems and connectionHeaderProblems#

Same rule for a step's rest.headers and a Connection's http.defaultHeaders. Messages:

  • <where>: “<n>” is not a header name — letters, digits and - (e.g. X-Request-Source)
  • the header “<n>” is set twice (header names ignore case)
  • the header “<n>” cannot be set on a step — <reason>, reasons by header: authorization, proxy-authorization, cookie are "a credential — give the Connection its auth instead"; host, content-length, transfer-encoding, connection are set by the HTTP client; content-type is "set by the step's request data — a body is JSON".
  • the header “<n>” is one the Hub's runtime reads itself — choose another name (any Camel* or org.apache.camel*)
  • the header “<n>” is the Connection's API key — the Connection sets it
  • the header “<n>” holds a line break — a header value is one line
  • the header “<n>” holds "{{" — the Hub reads {{…}} as one of its own settings; a secret belongs in the Connection

Order of precedence at call time: Connection default headers, then the auth header, then (app: merged over; Hub: constant setHeader after) the step's own.

flow-file.js, fileStepProblems#

  • file step "<id>" needs file.direction "read" or "write"
  • ... needs file.config.connectionRef — an objectStore Connection (the bucket it reads and writes); connectionRef <ref> does not exist; ... is kind "<k>" — a file step needs an "objectStore"-kind connection
  • ... needs the object's name: file.config.key (a fixed name) or file.config.keyFrom (the variable holding it); ... names the object both ways — file.config.key and file.config.keyFrom; keep one
  • file.config.keyFrom “<v>” is not a variable path (e.g. applicationId or applicant.id)
  • Writing: writes, so it needs file.config.bodyFrom — the variable whose value is written; file.config.bodyFrom “<v>” is not a variable path (e.g. letter or resp.body).
  • A read puts the object's content in resp.

flow-trigger.js, publishStepProblems#

  • a publish step needs publish (connectionRef, queue, fields)
  • publish.connectionRef <ref> is kind "<k>" — a publish step's connection must be amqp or kafka
  • publish.fields must name at least one declared variable — the message is the JSON object of those variables
  • publish.fields names "<f>", not declared on this flow — declare them (flow_add_variable) rather than send undeclared data; publish.fields names a variable twice; publish.fields "<f>" must be plain identifiers (letters, digits, _) — each is a JSON field name
  • publish.queue "<q>" ends in .dlq — reserved ... and the charset rule.

flow-script.js, resilience.js#

Covered in D5.7 and D5.8.

D5.10 Policies, expose and io.mappings#

expose {path, method, contractRef, policyRef, subFlowCallers[]} publishes the flow as an HTTP endpoint. policyRef must resolve to a real Policy artifact (flow_set_expose: policyRef <id> does not exist). contractRef is accepted but not validated. subFlowCallers is the list of flows allowed to run THIS flow as an in-process subFlow, which skips this flow's own policy; each must exist, never the flow itself, no duplicates (the generated call re-checks it at run time).

Policy {auth {type, mtls, tokenTtl, scopes[]}}. auth.type is none, apiKey, oauth2ClientCredentials or mtls. Tools: policy_create, policy_set_auth, policy_generate_key (mints the key into the vault; it never shows it).

Policy type App route Hub route
none open open
apiKey header x-api-key must equal env var <POLICY_ID>_API_KEY (policyApiKeyEnvVar); unset means 503, never open. During a key rotation <...>_API_KEY_PREVIOUS is accepted too same header and variable; the route does not start without it. Does NOT accept _PREVIOUS yet (key:rotate refuses a Hub-served policy)
oauth2ClientCredentials Bearer JWT from OW_JWT_ISSUER (signature, iss, expiry); 401 without one; 403 if ANY policy scope is missing (all are required); 503 if no issuer Quarkus HTTP permission on the path. More than one scope is refused: <policy> requires N scopes (...), but a Quarkus roles-allowed permission admits a token holding ANY ONE of them — weaker than the policy ... Refused rather than compiled weaker.
mtls as the TYPE refused: declares auth.type "mtls", which a generated route cannot check — mtls as the TYPE needs client certificates at the gateway (D7). Refused rather than generated open refused: ... which has no Camel form here — mtls as the TYPE needs client certificates at the gateway (D7), not something a route can check

auth.mtls: true alongside apiKey or oauth2 is named in the route header but NOT enforced on either runtime. Audience is not checked on either runtime. An unresolved policyRef is refused (expose.policyRef <id> was not resolved ... an endpoint declared protected must not generate open). The policy schema itself says it is "NOT ENFORCED" by a gateway because no gateway exists; the compilers enforce the subset above.

A BPM engine service task can present only an API key. A flow served under oauth2 or mTLS gets a second apiKey-protected engine door (flow_create_engine_door).

io.mappings on a step is the request mapping for that step: for rest it builds the body or query string; for soap it is the request envelope (to is a dotted element path, from a declared variable). Paths are plain dotted names. A path root must be a declared variable or resp (the previous step's reply).

D5.11 Run history and replay#

Run history. A run is one OpenTelemetry trace; run-trace.js finds runs by oneweb.flow.* / oneweb.step.* attributes, never by span name, because the runtimes differ. Read it with the read-only flow_runs / flow_run tools (see dev-4-api-and-mcp.md). A store that does not answer is refused, never reported as "no runs". What a value records is recordRule(variable): mask (***) if sensitive or undeclared, list ([list]) for a list, object ({object}) for object/json, otherwise the capped scalar. Both compilers apply it at compile time. The error text a runtime throws is stored as written (Camel's names the endpoint), though the reader scrubs credentials when it displays it.

D5.12 Parity caveats at a glance#

  • subFlow: app only. publish, soap, script, and the schedule, event, queue, file, fileBasket triggers: Hub only.
  • basic HTTP auth: app only. smtp.tls: true: app only. Non-postgres databases: app only, and structural.
  • oauth2 policy with two or more scopes: the app requires all; the Hub refuses the policy.
  • Hub-side, apiKey rotation overlap (_PREVIOUS) is not supported.
  • rest.contentType/rest.accept, file.format: stored, sent or read by neither runtime.
  • trigger.webhook: deprecated; the route is expose's.
  • decision and render on the Hub need the generated app's sidecar to be attached (HUB_SIDECAR_BASE_URL, HUB_SIDECAR_KEY); see dev-6-refusals-troubleshooting.md if decision or render steps fail on the Hub.
  • A flow that only the Hub can run must not stop an app from generating; gen-flow.js refuses it per flow, by name, and its Connection is not collected.
  • Existing docs and CLAUDE.md disagree with source in places; see the end of this page.

Part C. Expressions

D5.13 Which language where#

flowchart TB Q["What are you writing?"] --> A{"A Decision table cell,<br/>tree node test or expression source?"} A -->|"yes"| F["FEEL<br/>compile-feel.js"] A -->|"no"| B["CEL-style<br/>compile-expr.js"] B --> C["Flow router condition: JS in the app,<br/>Camel Simple on the Hub<br/>Event filter: Camel Simple on the Hub"] B --> D["Page or Form expression:<br/>JS in the generated page or form"] B --> E["Entity row filter:<br/>parameterised SQL WHERE"] B --> G["Process sequence-flow condition:<br/>JUEL for the BPM engine"] B --> H["Workspace binding condition:<br/>JS in kernel-authz.js"]
Which language where

The source of that table is the compileExpression* call sites (gen-flow.js, gen-nextjs.js, gen-form.js, gen-work-portal.js, gen-process-deploy.js, kernel-authz.js, tools/entity.js, gen-api.js) and tools/decision.js. I did not read every call site's exact role names; the column of roots below is from the code.

D5.14 CEL-style grammar (compile-expr.js)#

Tokens. Strings in 'single' or "double" quotes, with NO escape processing (a string cannot contain its own quote character). Numbers are digits with at most one .. Identifiers are [A-Za-z_][A-Za-z0-9_.]* (dots are part of the identifier, so a.b.c is one token and is a dotted path). Keywords: true, false, null, in.

Operators, loosest binding first: ||; &&; == != < <= > >= in; + -; * / %; then unary ! and -; parentheses; and the ternary c ? a : b (loosest of all, right-associative).

Functions (the only allow-list): size, has, startsWith, endsWith, contains, matches, round.

  • round(x) or round(x, n) rounds half AWAY from zero; n MUST be a whole-number literal from 0 to 6 (round()'s decimals must be a whole-number literal from 0 to 6, e.g. round(x, 2)).
  • matches(a, b) builds new RegExp(b), which is NOT anchored despite an old comment saying so.
  • Any other name: unknown function 'foo' — allowed: size, has, startsWith, endsWith, contains, matches, round.

Not in the language. There are no list or array literals (country in ['TH','SG'] throws unexpected character '['). in takes a path or value on the right: an array variable (membership) or a string (substring). There are no string escapes, assignments, statements, loops or function definitions. (All checked against compile-expr.js.)

Semantics of the JS target. ==/!= are JavaScript loose equality. A dotted path is optional-chained (a?.b), so missing data is undefined, never a throw. size(x) is x?.length ?? 0. has(x) is not undefined and not null.

Roots. Identifier roots are an allow-list, per caller:

Caller Roots
Page (PAGE_EXPR_ROOTS) state, vars, results, payload, item
compileExpression default state, item, props, point
Page visible and disabledWhen in gen-nextjs.js state, item
Flow edge condition, event filter the flow's declared variable names (app: mapped to ctx.vars.<name>)
Form / Work Portal visible, formula, condition, validation fields
Process sequence-flow condition (JUEL) the process's declared variable names
Entity row filter (SQL) the entity's own columns, claims.<name>, dep.<name>
Workspace binding condition environment, context

An unknown root is refused: unknown identifier 'zzz' — allowed roots: state, item, props, point checked against compile-expr.js. A dotted path with an empty segment or a non-identifier segment is refused: malformed path 'a..b' — empty segment.

D5.15 Emitters: what each target accepts#

All emitters share one parser and one AST (lit, path, not, neg, group, bin, tern, call).

flowchart LR S["CEL-style source text"] --> P["compile-expr.js<br/>one parser"] P --> T["AST"] T --> J["JavaScript<br/>compileExpression"] T --> V["Direct value<br/>evaluateExpression"] T --> Q["SQL with bind parameters"] T --> E["JUEL for the BPM engine"] T --> C["Camel Simple for the Hub"] X["FEEL source text"] --> Y["compile-feel.js<br/>separate parser"] --> Z["FEEL evaluator"]
The expression pipeline
Target Entry point Accepts Refuses (message)
JavaScript compileExpression(src, {roots, map}) everything none beyond grammar
Direct value evaluateExpression(src, context, {roots}) everything, evaluated now (no source text reaches eval or Function) none
SQL compileExpressionToSql(src, {columns, quote, claims, dep}) literals (bound), columns, claims.x, dep.x, comparisons, && || !, + - * / %, in, ternary, has, startsWith, endsWith, contains, round size, matches: function 'size' has no portable SQL form — not usable in a row filter; a column that does not exist: unknown column '<c>' in row filter — declared columns: ...; a dotted non-claims path: 'a.b' is not a column of this entity — row filters read its own columns, claims.* and dep.*
JUEL compileExpressionToEl(src, {roots}) comparisons, boolean ops, arithmetic, ternary, literals in: 'in' has no JUEL form — not usable in a flow condition; every function: function 'size' has no JUEL form — not usable in a flow condition
Camel Simple compileExpressionToCamelSimple(src, {roots}) comparisons, && ||, arithmetic, contains, matches in: 'in' has no verified Camel Simple form — not usable in a route condition; ternary: ternary has no Camel Simple form — express it as router edges instead; size, has, startsWith, endsWith, round: function '<f>' has no Camel Simple form — not usable in a route condition

SQL details: every VALUE (literal or claim) is a bind parameter $1, $2... in expression order. x == null is rewritten to IS NULL (and != to IS NOT NULL) because = NULL is never true. in becomes = ANY($n), startsWith(a, b) becomes a LIKE b || '%', and an absent claim or dependency binds NULL. A row filter that cannot be expressed in SQL is refused outright rather than evaluated in the app after the rows are fetched.

Camel Simple details: a Flow variable is a Camel variable, so loanAmount becomes ${variable.loanAmount} and applicant.age becomes ${variable.applicant.age}. String quotes inside a literal are doubled ('').

D5.16 CEL-style worked example#

A row filter (entity columns ownerId, status):

ownerId == claims.sub && status != 'closed'

compiles to checked against compile-expr.js, claim unset so it binds NULL:

JSON
{"sql":"\"ownerId\" = $1 AND \"status\" <> $2","params":[null,"closed"]}

Rounding is stable: round(fields.a, 2) with a = 1.005 gives 1.01 (checked against compile-expr.js; Math.round(x*100)/100 would give 1).

D5.17 FEEL grammar (compile-feel.js)#

FEEL is a separate, deliberately smaller grammar because DMN mandates it. There are two entry grammars over one tokenizer.

Full expressions (logic.expression.source, tree node test):

  • Literals: "str", 'str', numbers, true, false, null. No string escapes.
  • Identifiers: flat names only ([A-Za-z_][A-Za-z0-9_]*), matching a Decision's declared inputs[].name. No dots, no multi-word names, no backticks.
  • Operators, loosest first: or; and; = != < <= > >=; + -; * /; unary not and -; parentheses.
  • Conditional: if <c> then <a> else <b>. There is no ?:.
  • Equality is =, not == (a == 1 throws unexpected '=' in FEEL expression, checked against compile-feel.js).
  • Functions of any kind are not supported (year(d) throws unexpected trailing '(' in FEEL expression, checked against compile-feel.js). Also absent: contexts, for/some/every, filters, date and time arithmetic, open-ended intervals.
  • A name with no supplied value throws: no value for 'x' — values supplied: ... Give 'x' a value, or check its spelling against the decision's inputs.

Null semantics (DMN 1.3, "D-33"):

  • + - * / accept numbers only (and + of two strings concatenates). Null, a type mix, divide by zero or overflow gives null.
  • < <= > >= accept two numbers or two strings; anything else is null, and null satisfies nothing.
  • and/or/not are three-valued: false wins and, true wins or, otherwise null.
  • if takes then only when the condition is exactly true; null goes to else.
  • = and != stay strict (no coercion), so != false catches the string "true".

Unary tests (decision-table cells, logic.table.rules[].when[<inputName>]). A cell is a comma-separated list of tests with OR semantics:

Cell Meaning
> 2000000, <= 50, = "x", != "x" comparison against ONE literal
"TH", 5, true, null bare literal means equals
"TH","SG" either
- wildcard, legal only alone (not in a list)
[50..70], (50..70], ]50..70[, [1..5) interval; [/] closed, ( or an outward ]/[ open; both bounds same type (number or string); lower above upper is refused
not("TH","SG") negation of the whole cell; must be the entire cell; a missing value matches it; not(-) refused

Open-ended intervals are refused ([5..] throws expected a number or string as the interval's upper bound, found ']'), as is [70..50] (interval lower bound 70 is above its upper bound 50). A cell that has a bare x > 5 is refused (unexpected 'x' in unary test). All checked against compile-feel.js.

A unary-test evaluation against a missing or differently-typed value follows the same rule: ordering comparisons give null and match nothing (< 50 against null is false); an interval does not contain a null or wrongly typed value.

Input type check. checkDecisionInputs refuses a value of the wrong declared type rather than comparing it: '<n>' is declared <type> but was given <description> — refused rather than compared, since a value of the wrong type matches no rule and falls through to the table's default. Fix the value where it is produced. Input type is string, number, boolean, date, enum.

D5.18 Decisions: logic kinds and hit policies#

decision.schema.json has inputs, outputs, logic, challenger, monitoring, requires, tests, flow. logic.kind is table, expression or tree.

  • table: {hitPolicy, rules[]}. A rule is {id?, when {input: unaryTest}, then {output: value}, annotation, enabled, effectiveFrom, effectiveTo}. enabled absent means enabled (only an explicit false disables). effectiveFrom is inclusive, effectiveTo exclusive (half-open), absent means always. A disabled rule never fires however its window reads. Evaluation takes an explicit asOf so a past decision can be replayed at the time it was made.
  • expression: {lang, source}. lang is feel (default) or cel in the schema. decision_set_expression writes lang: "feel", and decision_evaluate runs the source through evalFeel. Whether any code path evaluates lang: "cel" is not verified. An expression returns ONE value, so it is only evaluated when the Decision has exactly one output.
  • tree: nodes are branches {test, onTrue, onFalse} or leaves {set}. test is a boolean FEEL expression. A test that evaluates to null is refused (tree node test '<t>' is null — an input it reads is missing, null or of the wrong type, so neither branch applies), and to a non-boolean (... evaluated to <v>, not a boolean). The result carries treePath (r, then .y for each yes and .n for each no).

Hit policies (evaluateDecisionTable):

hitPolicy Behaviour Error
first the first matching rule in row order (5.0's assignment policy) none
unique at most one rule may match hit policy 'unique' matched N rules — at most one should match: <ids>
any several may match if their then is deep-equal hit policy 'any' matched rules with different outputs — they must agree: <ids>
priority with 2+ matches, rank by each output's declared allowedValues order (first output is the primary key, ties go to the next, a full tie keeps the earlier rule; a value outside the order ranks last) hit policy 'priority' needs every output to declare a non-empty allowedValues order to rank by — missing on: <names>
collect returns an ARRAY of every match's then (un-aggregated) none

No match gives {outputs: {}, matchedRuleIds: []} (and an array for collect). An unknown policy throws unknown hit policy '<p>'.

D5.19 FEEL worked example#

Result: {"outputs":{"path":"senior"},"matchedRuleIds":["high"]}. The cell text is a JSON string, so the FEEL string "TH" is written "\"TH\"".

The same decision as a full expression (checked against compile-feel.js, returns "senior"):

if loanAmount > 1000000 and country = "TH" then "senior" else "standard"

Null handling, same module: debt + 1 with debt = null is null; a and b with a = false, b = null is false; 10 / 0 is null.


Disagreements between source and existing docs

  1. docs/part-9-reference.md section 9.3 says expression "Allowed roots" are PAGE_EXPR_ROOTS and that Camel Simple limits are "no unary not, startsWith, size, in, ternary in the flow condition builder's fixed shape". In source, PAGE_EXPR_ROOTS is only the page list; a flow condition's roots are the flow's declared variable names, forms use fields, row filters use columns/claims/dep. And the Camel Simple emitter DOES emit ! (it refuses in, ternary and the functions size, startsWith, endsWith, has, round); the "no unary not" fact comes from a CLAUDE.md gotcha, not from the emitter refusing it.
  2. docs/part-9-reference.md section 9.3 lists "mappings" under the CEL-style language's uses. I found no expression compile in io.mappings/fieldMap (they are plain dot paths).
  3. CLAUDE.md "Known gaps" says event "is still refused by gen-camel" and "No TLS to the broker, no event". gen-camel.js has eventTriggerEntry, eventTriggerProblems is wired in the tools, and the Hub trigger table in docs/part-5-integration-hub.md section 5.2 documents event. The CLAUDE.md sentence is out of date.
  4. CLAUDE.md "Known gaps" also says a publish step is refused by gen-flow by name, which is still true and matches gen-flow.js; but the same paragraph says the app has "no broker client, by design" and implies queue only, while publish now covers a Kafka topic too (publishStepProblems).
  5. compile-expr.js header claims matches is "Anchored", but emitCall emits an unanchored new RegExp(b).test(...). Treat matches as unanchored; write ^ and $ yourself.
  6. docs/part-5-integration-hub.md section 5.1 lists script only as "script / map: A script reads and writes variables.x". It does not say script is Hub-only (gen-flow.js lists it unsupported). Section 5.9 omits it from "Known limits" too.
  7. connection.schema.json http.auth.type enum offers basic, oauth2ClientCredentials and signature, but the Hub refuses basic and both runtimes refuse the other two. docs/part-5-integration-hub.md section 5.3 does not mention it.
  8. gen-flow.js and kernel-schemas/flow.schema.json state that script with lang: "java"/"ts" exists "for import fidelity only"; the Hub error message for an unsupported lang says only "javascript" compiles on the Hub while flow-script.js words it only "javascript" compiles today. Same fact, two texts; I quoted flow-script.js.

Back to dev-1-getting-started.md · dev-2-recipes.md · dev-4-api-and-mcp.md · dev-6-refusals-troubleshooting.md