ONEWEB6.0Docs

Part 5 — Integration Hub

8 min readDocumentation
Audiencebuilders, operators, developers.
Sources this page was written from

INTEGRATION-HUB-ROADMAP.md, kernel-poc/src/ (gen-camel.js, gen-flow.js, flow-*.js, hub-*.js, run-trace.js, failed-items*.js, secret-broker.js), CLAUDE.md gotchas. Use cases: UC-1 to UC-7 in use-cases.md.

5.1 Flow model and step types#

A Flow is a trigger plus a graph of steps over declared variables. Variables are typed; flag a variable sensitive or it will be recorded in run history if declared as a scalar (a sensitive variable and an undeclared one are masked as ***).

A Flow starts at its trigger, runs its steps over the declared variables, and (for an exposed route) answers its caller.

flowchart LR T["Trigger<br/>invoke, webhook, schedule, queue,<br/>event, file, fileBasket"] --> S1["Step<br/>rest, soap, database, file,<br/>decision, render, notify, publish"] S1 --> S2["Next step<br/>script, map, router, subFlow"] S2 --> R["Reply (respond step) or end"] V[("Declared variables<br/>typed, sensitive or not")] -.->|"read and written by"| S1 V -.-> S2
Anatomy of a Flow

The same Flow artifact is compiled twice, once for each runtime. Neither output is derived from the other.

flowchart TB F["Flow IR"] --> G1["gen-flow.js"] F --> G2["gen-camel.js"] G1 --> A["Generated Next.js app<br/>in-process trampoline"] G2 --> C["Camel YAML routes<br/>plus worker config"] C --> H["Hub worker<br/>Camel and Quarkus"] A --> P["verify-camel-parity.js<br/>same input to both, compare status and body"] H --> P
One Flow, two runtimes
Step Notes
rest Own headers (rest.headers) are sent by both runtimes. Credentials, Host, Content-Type, Camel* and {{ are refused by name. rest.contentType/accept are not sent by either runtime.
database Bound values only; the Hub scrubs result headers.
file {connectionRef (object store), key XOR keyFrom, bodyFrom (write)}.
soap Envelope is built from fields (io.mappings), reply read by xpath over local names. Hub only. wsSecurity refused by name. An effect for replay.
decision, render Hub reaches them through the generated app's sidecar, so there is one FEEL/template implementation.
notify Sends through an SMTP Connection; with no Connection it is a labelled stub.
publish RabbitMQ queue or Kafka topic; Hub only.
subFlow In-app only; the target needs expose, and a target with a policy must name callers in expose.subFlowCallers.
script / map A script reads and writes variables.x.

5.2 Triggers#

Trigger Runs on Key rules
webhook / expose App and Hub Route comes from expose; a webhook without expose is refused. trigger.webhook is deprecated.
schedule Hub An app has no scheduler.
queue Hub RabbitMQ (amqp Connection) only. At-least-once. Failures land in <q>.dlq.
event Hub Kafka only; topic, consumer group and a filter compiled through the one expression parser. Auto-commit gives a named at-least-once gap.
file Hub MinIO or SFTP. Inbox/done/failed folders; content never recorded; read up to 1 MiB into a variable only when mapped.
fileBasket Hub A correlated group of files, one run per group; key pattern with exactly one capture group; completeness by count or timeout.

flow-trigger.js holds every rule once; the tools read it when you write a trigger and the compilers read it when they compile.

On an object store (MinIO) a file trigger moves each object itself in route-level hooks, because the S3 consumer cannot be trusted to move files; on SFTP the consumer's own move does it. Either way, a file that finishes goes to the done folder and one that fails goes to failedFolder.

flowchart LR I["Inbox"] --> R["Run the flow"] R -->|"run completes"| D["Done folder"] R -->|"run fails"| X["Failed folder"] X -.->|"move back to run again<br/>(failed_item_replay or by hand)"| I
Where a file goes

A file run is not replayed: the refusal says to move the file from failed/ back to the inbox.

5.3 Connections per runtime#

A Connection is runtime-neutral; its resolved value is not (postgres:// vs jdbc:postgresql://, split vs joined credentials, driver flags). Translation happens in one place:

  • connection-env.js names the environment variables per runtime (nextjs, camel-quarkus).
  • hub-config.js derives values from the Workspace Environment (services per network view, Connection bindings, identity) plus secrets from the vault.
  • generate-hub-env.js writes the worker's hub.env; verify-hub-config.js checks every runtime.

Never type a Connection or issuer value into a worker's compose file; change the Connection or the Environment and regenerate.

To change a value, change the Connection or the Environment and regenerate.

One kind of value cannot travel as an environment variable at all.

5.4 Resilience#

resilience.circuitBreaker is compiled by both runtimes. failureThreshold is a 0–1 rate; minimumCalls is required and is both window and minimum sample. On the Hub it uses MicroProfile Fault Tolerance; on the app it is hand-rolled with per-process state. An open circuit with no onFallback still fails the route. fallbackStep (jump to another node) is refused on both. No designer authors a breaker yet; tools and seeds only.

5.5 Hub deploy, apply and rollback#

Hub deployment is desired state, not a command with a flow list.

flowchart LR T["hub_deploy, hub_undeploy,<br/>hub_rollback"] --> E[("Workspace Environment<br/>runtime flow list, pinned seq")] E --> A["npm run hub:apply"] A --> B["Full path: staged build, swap,<br/>restart, wait for the routes"] B --> W{"Exactly the desired<br/>routes started?"} W -->|"yes"| OK["hub_applied recorded: ok"] W -->|"no"| RV{"Last good state<br/>provably on disk?"} RV -->|"yes"| RB["Reverted and recorded;<br/>desired state not applied"] RV -->|"no"| FL["Failed recorded,<br/>no revert attempted"]
Hub deploy as desired state
  1. hub_deploy / hub_undeploy / hub_rollback write the runtime's flow list on the Workspace Environment, pinned to a reviewed sequence with Policies/Connections locked. Same approval gate and residency check as other deploys.
  2. npm run hub:apply makes the worker match: staged build, swap, restart, wait for exactly the desired routes. Every attempt, failures included, is recorded as a hub_applied event.
  3. A failed start reverts to the last good state only when that state is provably on disk (hub.env.last-ok, secrets.last-ok/, jar build stamp).
  4. hub_deployments shows desired vs last applied. The pom's extension list is generated between markers.

Shared generated config is a fail-open surface: generate-camel.js refuses a leftover route it did not generate.

5.6 Run history and replay#

flowchart LR R["Flow run on the app or the Hub"] -->|"OpenTelemetry trace"| J[("Trace store<br/>Jaeger in the reference stack")] J --> Q["flow_runs, flow_run<br/>read-only"] Q --> P["flow_replay_plan<br/>hidden inputs, effect steps"] P --> RP["flow_replay<br/>refuses until supplied and acknowledged"] RP -->|"new run from the first step"| R
Run history and replay
  • A run is one OpenTelemetry trace in Jaeger, found by oneweb.flow.* / oneweb.step.* attributes. flow_runs / flow_run read it; a store that does not answer is refused, never "no runs".
  • Values recorded follow recordRule (*** for sensitive or undeclared).
  • Replay is a new run from the first step with the recorded inputs, against what is deployed now. flow_replay_plan lists hidden inputs and effect steps; flow_replay refuses until each is supplied and acknowledged. It is never a resume. A cron flow and a file run cannot be replayed.
  • Error text is recorded as the runtime wrote it; the reader scrubs credentials on display.

5.7 Failed items#

failed_items lists dead letters (<q>.dlq) and failed files (a trigger's failedFolder). Replay and delete (permanent, needs a reason) are confirmed actions in the Operations console, each recorded as failed_item_handled. Gaps: files are read with the Connection's own credential; listing a DLQ sets redelivered; one place lists its first 100.

flowchart TB Q["Queue message that failed"] --> DLQ["Dead letter queue<br/>q.dlq"] F["File that failed"] --> FF["Trigger failedFolder<br/>MinIO or SFTP"] DLQ --> L["failed_items<br/>read-only list"] FF --> L L --> RP["failed_item_replay"] L --> DEL["failed_item_delete<br/>permanent, needs a reason"]
Failed items

5.8 Secrets and the vault#

Action How
Mint an apiKey for a Policy policy_generate_key; written to the vault, never shown
Paste a partner's key secret_set (write-only)
Check what is set secret_status
Rotate with overlap npm run key:rotate -- <start, deploy, finish or abort>

OpenBao holds values at kv/oneweb/<workspace>/<env>/<KEY>. The Hub reads through the read-only hub-apply AppRole; the Workbench writes through kernel-secrets, which cannot read a value back. There is no silent fallback to a secrets file.

Values are written through the Workbench, not typed into artifacts.

Rotation is done with the key:rotate phases, never by hand.

5.9 Known limits#

  • Hub flows cannot call subFlow; app flows cannot publish, use event/schedule, or SOAP.
  • File triggers: at-least-once, SFTP is password or key auth with a pinned host key.
  • An unreachable SFTP consumer does not fail readiness; verify with verify:file-trigger.
  • Replay of a flow with effects needs every effect acknowledged.
  • TLS to the broker is not set up.