Flow

Flow execution

How workers run flows in a WebAssembly sandbox, and the limits each run gets.

Flows are untrusted code. A worker runs a flow's script, one JavaScript module, in flow-sandbox: QuickJS compiled to WebAssembly, run by wasmtime. Each run gets a fresh instance, so nothing carries over from one run to the next.

Note: no flow runs for now. Deploys no longer build a script from a flow's code, and a run is refused until Flow's runtime settles how a flow's workflows run.

Warning: runs share the worker's process, so a bug in wasmtime or in the sandbox's host functions is the main escape path.

Isolation

  • Filesystem — A run sees only its own script, in a private read-only directory. It can read no host file and write none.
  • Processes — There are none to start: no child_process, no Bun.spawn.
  • Environment — A run sees none of the worker's environment, only placeholders for the integrations it declares.
  • Credentials — A flow's integration actions are calls the worker answers through Nango, so the flow never holds a token, the Nango secret key or a connection id.

Network

A run reaches the network only through fetch(), which the worker makes for it. It reaches the hosts in FLOW_EGRESS_ALLOWLIST, and nothing when that is empty (the default):

  • api.example.com, *.example.com, * (any public host), 1.2.3.4 or 10.0.0.0/8;
  • a bare entry opens ports 80 and 443; add :port or :* for others (db.example.com:5432, [::1]:8080 for IPv6);
  • a hostname that resolves to a loopback, private, link-local or metadata address is refused unless an IP or CIDR entry covers that address, and the address checked is the one dialled, redirects included.

Limits

LimitEnv var (worker)Default
Runs at a timeFLOW_CONCURRENCYone per core but one
Run timeFLOW_MAX_RUN_TIME1h
Memory—512 MiB
Output—10 MB stdout and stderr

FLOW_MAX_RUN_TIME is a Go duration. It caps a run's wall time, waits included, and its CPU time. A run past it ends with exit code 124. Past the memory cap, the flow gets a JavaScript out of memory error.