Skip to main content
Ask your AI

walkerOS runtime

runneros runs a prebuilt walkerOS flow artifact. It ships in the npm package @walkeros/runner and is the entrypoint of the walkeros/flow Docker image. It never builds a flow: you build with walkeros bundle, then start the result.

walkeros bundle flow.json -o dist/
runneros start dist/flow.mjs

The runtime is a separate tool from the CLI, with its own name and capabilities. It cannot bundle, because it has no esbuild, no package manager and no registry access. Hand it a local flow config and it refuses with BUNDLE must be a prebuilt artifact (.mjs, .js, .cjs, .tar.gz, .tgz), got flow.json.

Build, run, orchestrate​

Getting a flow into production has three stages, and each one is kept to what it needs:

StageHasMust not have
Build (walkeros bundle)Registry access, esbuild, @vercel/nft, a Node toolchainProduction secrets or production traffic
Run (runneros start)The artifact, its runtime secrets, the portA package manager, registry egress, a bundler
Orchestrate (you, your CI, or the walkerOS app)The decision of what runs whereThe ability to execute the artifact

Build values that a web flow bakes into its public bundle are declared in the config under config.bundle.env and resolved at build time, see build-time values. Runtime secrets for a server flow reach the running process through its environment.

The artifact​

walkeros bundle produces two shapes, depending on the flow's platform:

PlatformArtifactRuns where
serverA directory: dist/flow.mjs, dist/package.json and dist/node_modules/ (only the files @vercel/nft traced)runneros start
webA single file: dist/walker.jsThe browser, served by any static host

A server flow always travels as the whole directory. Copying flow.mjs alone drops node_modules/, and a flow with external step packages then fails to resolve its imports. To ship the directory as one file, bundle to an archive with walkeros bundle flow.json -o flow.tar.gz.

Quick start​

Build, then run the directory in the image:

npx @walkeros/cli bundle flow.json -o dist/

docker run --rm -p 8080:8080 \
  -v "$PWD/dist:/app/flow:ro" \
  walkeros/flow:<version>

Or without Docker:

npx --package=@walkeros/runner runneros start dist/flow.mjs

Check it is up:

curl http://localhost:8080/ready

Image tags​

Every walkeros/flow tag is the npm version of the @walkeros/runner it contains: walkeros/flow:<version> runs @walkeros/runner@<version>. Version tags are immutable. latest, <major> and <major>.<minor> move only on stable releases.

Tags before 4.7.0 run an older entrypoint without runneros. Pin a version that ships runneros, ideally the same version as the @walkeros/cli that built the artifact, and check it with:

docker run --rm walkeros/flow:<version> runneros --version

The image is published for linux/amd64 only. On an arm64 host, Docker runs it under emulation (--platform linux/amd64).

Canonical Dockerfile​

Build and run in two stages. The build stage has npm and the registry; the runtime stage has neither:

ARG WALKEROS_VERSION

FROM node:24-alpine AS builder
ARG WALKEROS_VERSION
WORKDIR /build
RUN npm init -y && npm install --save-dev @walkeros/cli@${WALKEROS_VERSION}
COPY flow.json ./
RUN npx walkeros bundle flow.json -o dist/

FROM walkeros/flow:${WALKEROS_VERSION}
COPY --from=builder /build/dist/ /app/flow/
docker build --build-arg WALKEROS_VERSION=<version> -t my-flow .
docker run --rm -p 8080:8080 my-flow
  • COPY --from=builder /build/dist/ /app/flow/ copies the whole directory, so the traced node_modules/ comes along.
  • The image already sets BUNDLE=/app/flow/flow.mjs, PORT=8080 and CMD ["runneros", "start"], so the Dockerfile needs no command and no BUNDLE.
  • One WALKEROS_VERSION pins both the CLI that builds and the runtime that runs.

What runneros start accepts​

runneros start [artifact] takes the artifact as an argument, or from BUNDLE when there is none, or flow.mjs in the working directory when there is neither.

InputExampleNotes
Local file/app/flow/flow.mjs (the image default).mjs, .js or .cjs. Imported in place, nothing is written
Local archive/app/flow.tar.gz.tar.gz or .tgz holding flow.mjs at its root
URLhttps://cdn.example.com/flow.tar.gzA presigned URL works. Gzip content is extracted as an archive, anything else is written as flow.mjs, so point a server flow at its archive
Stdincat flow.mjs | docker run -i ... walkeros/flow:<version>Read only when the given path does not exist. An empty stdin is ignored. Stdin carries one file and no node_modules/, so a server flow built by walkeros bundle fails to start with Cannot find package '@walkeros/collector'

A fetched, extracted or piped artifact is written to /app/flow/ when that directory exists (in the image it does). Outside a container it goes to a private folder under the system temp directory, one per runtime process, and nothing is written to the temp directory itself. The folder is removed at a clean exit and left behind by a killed process. The archive carries every package its flow imports. A package it lacks is resolved from the folder's parent folders (Node's module resolution), up to the temp directory's node_modules/, so on a shared host build complete archives. A local path with any other extension, a .json flow config above all, is refused before anything loads. Content from a URL or stdin is checked only by what it is written as: a flow config delivered that way is written as flow.mjs and then fails to import with a syntax error. Either way nothing is bundled.

At start the runtime prints Instance <id>, a random 16-character hex id that the heartbeat carries too. Recent errors are persisted to errors-<port>.jsonl in the cache folder. That folder is the instance's own: do not share it between instances, for example on one volume, since instances that listen on the same port would write the same file.

Options​

FlagEnvironment fallbackDescription
[artifact]BUNDLEArtifact path or URL
-p, --port <number>PORTPort to listen on (default 8080)
--env-file <path>noneLoad a dotenv file first. Existing variables win; a group- or other-readable file is refused
--jsonnoneJSON output
-v, --verbosenoneVerbose output
-s, --silentnoneSuppress output

Environment variables​

VariableDefaultDescription
BUNDLE/app/flow/flow.mjs in the imageArtifact path or URL
PORT8080Port for the health server and the flow's HTTP handler. A source's own port setting has no effect under the runtime, and nothing logs that
WALKEROS_CREDENTIALnoneThe runner's credential (wos_cred_...), shown once when you pair a runner in the app. It names the app and the deployment, so no other variable is needed. Read once at start and removed from the environment. Unset, the runtime calls no app
WALKEROS_HEARTBEAT_INTERVAL60Seconds between heartbeats. Values below 10, or not a number, are clamped to 10
WALKEROS_CACHE_DIR$XDG_CACHE_HOME/walkeros, else ~/.cache/walkerosWhere the runtime persists recent errors between restarts. CACHE_DIR is read as a fallback
NODE_OPTIONS--max-old-space-size=384 --no-warnings in the imageHeap cap sized for a 512 MB container. Raise it with the container's memory, and keep --no-warnings: the runtime logs Node's process warnings itself

The credential comes from the environment only, or from the --env-file you name. The runtime reads no config file and no CLI login.

Connecting to the walkerOS app​

A flow runs on its own with no account. One variable connects it to the app: the runner's credential. On the flow part's Self-hosted tab in the app, click Pair a runner and confirm with your passkey or a code. The auth host then shows the credential once. Set it as WALKEROS_CREDENTIAL in your shell and pass it on:

docker run --rm -p 8080:8080 \
  -v "$PWD/dist:/app/flow:ro" \
  -e WALKEROS_CREDENTIAL \
  walkeros/flow:<version>

Keep the credential in your platform's secret store and hand it to the container as WALKEROS_CREDENTIAL, never in the image or a committed file. In Docker Compose, from a .env file next to the compose file:

services:
  flow:
    image: walkeros/flow:<version>
    ports: ['8080:8080']
    volumes: ['./dist:/app/flow:ro']
    environment:
      WALKEROS_CREDENTIAL: ${WALKEROS_CREDENTIAL}

On Cloud Run, from Secret Manager:

gcloud run deploy walkeros-flow \
  --image registry.example.com/my-flow:1.0.0 \
  --set-secrets WALKEROS_CREDENTIAL=walkeros-credential:latest

A credential that is never used lapses after 7 days. Once connected it lasts until you revoke it on the Self-hosted tab, pair the part again, or the deployment ends. Pairing again ends the earlier credential when the new runner first connects, so the old runner keeps checking in until then. The tab shows when the credential last bought a token and from which address. A managed deployment gets its credential from the app, with nothing to paste.

When connected, the runtime:

  • Fetches secrets once at boot from GET /api/runner/secrets and sets them in the environment after the artifact is imported and before the flow starts, so $env.NAME references in a server flow resolve to them. It sets only the names the artifact reads through $secret or $env; other names are not set, and one INFO line names them. A reserved name (such as PATH, NODE_OPTIONS, PORT or any name starting with WALKEROS_, NODE_, NPM_, LD_ or DYLD_) stops the boot with secret-reserved, and a name that is already in the environment stops it with secret-in-env. Each refusal is named in the error. A fetch that fails for a reason other than authentication logs a warning and the flow starts. A name the flow reads only from code is not set.
  • Checks in at POST /api/runner/check-in every WALKEROS_HEARTBEAT_INTERVAL seconds with its instance ID, version, uptime, event counters, recent errors and log lines (secrets are redacted before they leave the process), and the release it runs. A failed check-in is logged and never stops the flow.
  • Fetches an artifact URL on the app's origin with its credential. The redirect to the storage carries no credential, and a URL on any other host is fetched without one.
  • Signs its flow's ingest writes when the credential belongs to a deployment. The flow's steps get a signer: the usage report signs each report when it names no token, and the ClickHouse destination signs each insert when its config sets settings.signed: true (see Signed inserts). Each request gets a fresh signature over its exact bytes, with the credential's key, and works without the auth server. The signer never signs a request to the app or its auth server, so no step obtains headers for them, and no step ever sees the credential. Under runneros remote the flow runs in a child process that holds no credential, and its supervisor signs each write.

The credential itself is never sent. With it the runtime buys a token that lasts 24 hours and works only together with the credential's key, and renews it every hour. It buys the first one at start, before the flow serves, and waits at most 2.5 seconds per attempt: when the token endpoint cannot be reached, the flow starts anyway. When the auth server cannot be reached, the runtime signs each request to the app with the credential's key instead and keeps serving; one ERROR line says so, and one more when a token is bought again. A credential that was replaced by a new pairing, revoked, or whose deployment ended buys no token. One ERROR line says so, The auth server refused this runner's credential (invalid_client: ...): (replaced, revoked or ended); a self-hosted runner is paired again on its Self-hosted tab. The runtime then signs instead, with its line, and the app refuses the signed requests with one more, The app refused this runner's signed request (HTTP 401). The flow keeps serving. A token the app refuses although the auth server had just issued it writes one ERROR line naming the resource the credential's tokens are for, and no end. When this machine's clock is further off the server's than the server allows, the line names how far.

The artifact itself never changes while the runtime runs. To ship a new version, bundle again and redeploy. To take new versions from the app with no redeploy, run runneros remote instead.

Every value the flow reads through $secret or $env is masked by exact value (6 characters or longer) as ***, whatever its source: the app, an --env-file or the container's environment. This covers the runtime's own lines, the flow's lines, the recent errors and log lines a heartbeat carries, and the --json error output. The runtime cannot tell a credential from config, so a config value of 6 or more characters set in the environment for an $env name (a region, a host, a table name such as events) shows as *** too. Defaults and shorter values are not masked. The pattern rules also catch values with a recognizable shape (known token prefixes, private keys, credential-named fields, long high-entropy strings).

The runtime prints text lines by default. A flow that sets collector.logger.format to json prints one JSON object per line instead, errors and warnings on stderr, which log collectors such as Cloud Run read as structured logs (see Logger). The lines before the flow loads, up to Health server listening on port <port>, print as text, because the runtime learns the format from the flow. Every start then logs the loaded flow as Flow: <name> release <release>. The flow's logger.level applies to the collector's lines, and --verbose still forces DEBUG.

Log lines print a path under the system temp directory as $TMPDIR/.... On Linux TMPDIR is often unset, so read such a path as the system temp directory (usually /tmp).

Secret fetch failures​

ResponseBehavior
401 or 403Fatal: the runtime exits. The app refused the credential: replaced, revoked or ended
404 (no secrets configured)Warning, the runtime continues
Any other errorWarning, the runtime continues without secrets

Timeouts, network errors, 429 and 5xx responses are retried a few times with bounded, jittered backoff before the behavior above applies, so a brief blip while the container starts does not fail the boot. The same applies to fetching an artifact from a URL.

Health checks​

The runtime serves two endpoints on PORT, independent of the flow's sources:

EndpointStatusBody
GET /healthAlways 200{"status":"ok"}
GET /ready200 once the flow's collector is constructed{"status":"ready"}
GET /ready503 while starting{"status":"not_ready"}
GET /ready503 after a sustained loop of uncaught errors{"status":"degraded","reason":"flow degraded, see the runtime log"}

Use /health for liveness and /ready for readiness. The image's HEALTHCHECK polls /ready every 30 seconds after a 30-second start period. A flow that fails to start logs Readiness failed: <reason>, and the runtime closes the port and exits with code 1, so probes get no answer.

Every other request goes to the flow's HTTP handler (for example the Express source's routes); before a flow is loaded, those answer 503. A flow whose sources have no HTTP handler, such as the fetch, AWS and GCP sources built for their own platforms, still reports ready, and every request answers 503 with {"error":"No flow loaded"}.

While a flow runs, the runtime measures the process that runs it every 10 seconds: its resident memory against the memory it may use (the container's limit, else the machine's memory), its CPU time and its event loop delay. A flow that sends Observe usage reports carries these numbers as its runtime rows, with no option to set. Under runneros remote they are the flow's child process, measured against the whole instance's memory; the supervisor's memory and CPU time are not counted.

Serving files​

The runtime has no static file mode. A server flow serves files the same way it handles events: the include field copies a folder next to the artifact, the fs store reads from it, and @walkeros/server-transformer-file answers matching requests:

{
  "version": 4,
  "include": ["./public"],
  "flows": {
    "default": {
      "config": { "platform": "server" },
      "stores": {
        "files": {
          "package": "@walkeros/server-store-fs",
          "config": { "settings": { "basePath": "./public" }, "file": true }
        }
      },
      "sources": {
        "http": {
          "package": "@walkeros/server-source-express",
          "config": {
            "settings": { "paths": ["/collect", "/static/*path"] },
            "ingest": {
              "map": {
                "method": { "key": "method" },
                "path": { "key": "path" }
              }
            }
          },
          "next": [
            {
              "match": {
                "key": "ingest.method",
                "operator": "eq",
                "value": "GET"
              },
              "next": "file"
            }
          ]
        }
      },
      "transformers": {
        "file": {
          "package": "@walkeros/server-transformer-file",
          "config": { "settings": { "prefix": "/static" } },
          "env": { "store": "$store.files" }
        }
      }
    }
  }
}

The source only fills ingest.method and ingest.path when config.ingest maps them, so without that block the match never passes and the file transformer never runs. paths must cover the served files: the express source registers only /collect by default, and /static/*path is Express 5 wildcard syntax. file: true makes the fs store return the files byte-exact.

walkeros bundle copies public/ into dist/public/, and the canonical Dockerfile's COPY of the whole dist/ directory carries it into the image. Never include the output directory itself (include: ["./dist"] with output dist/ is refused as a circular copy), and never point the fs store at a directory that holds credentials. include applies to server builds only: a web build copies nothing and logs that it ignored include.

Web flows a server flow serves​

A server flow lists the web flows it serves in config.bundle.flows. Each key is a web flow of the same file. Each value is the path of that flow's file in the server's output folder: bare file names joined by /, such as casamoda/walker.js. It is never a $flow reference and never a public URL path. The file's routes stay in the server flow, as in the example above.

A remote runner fetches and replaces these files as the app releases them, see Served web files.

One walkeros bundle --flow <server> -o dist/ writes dist/flow.mjs and each listed web flow at its path. With a .tar.gz output, the archive packs the server files and exactly the listed paths. Without -o, and with a URL output, the CLI builds the server alone and logs Served flows left out (stdout): casamoda, venti (or (URL upload)) as a warning. walkeros validate checks the listing, see the validate codes.

A path inside flow.mjs, package.json or node_modules is refused. So are two paths that are equal or nest, compared without case. At build time, a path the output file or an include copy takes is refused too. --flow <server> checks the listing. A whole-file walkeros validate also checks each listed web flow.

A served file is the finished walker.js, the same as walkeros bundle --flow <web> writes. --release stamps the flow the command names. Each served flow keeps its own release, or the collector.release it authors.

{
  "version": 4,
  "include": ["./public"],
  "flows": {
    "casamoda": {
      "config": {
        "platform": "web",
        "settings": {
          "windowCollector": "casamoda"
        }
      },
      "destinations": {
        "probe": {
          "code": {
            "push": "$code:(event) => event.name"
          }
        }
      }
    },
    "venti": {
      "config": {
        "platform": "web",
        "settings": {
          "windowCollector": "venti"
        }
      },
      "destinations": {
        "probe": {
          "code": {
            "push": "$code:(event) => event.name"
          }
        }
      }
    },
    "server": {
      "config": {
        "platform": "server",
        "bundle": {
          "flows": {
            "casamoda": "casamoda/walker.js",
            "venti": "public/track.js"
          }
        }
      },
      "stores": {
        "casamoda": {
          "package": "@walkeros/server-store-fs",
          "config": {
            "settings": {
              "basePath": "./casamoda"
            },
            "file": true
          }
        },
        "public": {
          "package": "@walkeros/server-store-fs",
          "config": {
            "settings": {
              "basePath": "./public"
            },
            "file": true
          }
        }
      },
      "sources": {
        "http": {
          "package": "@walkeros/server-source-express",
          "config": {
            "settings": {
              "paths": ["/collect", "/walker.js", "/s/*path"]
            },
            "ingest": {
              "map": {
                "method": {
                  "key": "method"
                },
                "path": {
                  "key": "path"
                }
              }
            }
          },
          "next": {
            "one": [
              {
                "match": {
                  "and": [
                    {
                      "key": "ingest.method",
                      "operator": "eq",
                      "value": "GET"
                    },
                    {
                      "key": "ingest.path",
                      "operator": "eq",
                      "value": "/walker.js"
                    }
                  ]
                },
                "next": "casamodaFile"
              },
              {
                "match": {
                  "and": [
                    {
                      "key": "ingest.method",
                      "operator": "eq",
                      "value": "GET"
                    },
                    {
                      "key": "ingest.path",
                      "operator": "prefix",
                      "value": "/s/"
                    }
                  ]
                },
                "next": "publicFile"
              }
            ]
          }
        }
      },
      "transformers": {
        "casamodaFile": {
          "package": "@walkeros/server-transformer-file",
          "env": {
            "store": "$store.casamoda"
          }
        },
        "publicFile": {
          "package": "@walkeros/server-transformer-file",
          "config": {
            "settings": {
              "prefix": "/s"
            }
          },
          "env": {
            "store": "$store.public"
          }
        }
      }
    }
  }
}

A bundle.flows path and a relative basePath resolve against the same folder: the one the server bundle runs in. That is the output folder, the image's /app/flow, or the folder an archive extracts into. See File paths at runtime.

Point a store at a folder of its own for each web file, as casamoda does above. A store on the output root serves the server bundle and its include copies too. To serve several files through one store, give the file transformer a prefix, as publicFile does above: a request inside the prefix that the store does not find answers 404, and a request outside it passes on.

File paths at runtime​

Before loading a flow, the runtime changes its working directory to the artifact's directory. Relative paths in flow settings resolve against the artifact, not your project root: with the artifact at /app/flow/flow.mjs, "filePath": "./data.json" reads /app/flow/data.json. Use include to put such files next to the artifact. In the example above, a file the fs store does not find there gets the express source's default answer, 200 with a 1x1 GIF, and the log shows invalid event rejected at ERROR.

Constraints​

  • Filesystem. An archive, URL or stdin input writes to /app/flow/, so those inputs need that directory writable. A read-only root filesystem, the usual ECS and Kubernetes hardening, works only with a local .mjs artifact already in place (for example the canonical Dockerfile, or a read-only mount); an archive there fails with Archive did not contain flow.mjs after extraction to /app/flow. A connected runtime persists recent errors to its cache directory (default ~/.cache/walkeros), which also needs to be writable; the image's /app/cache is writable by the runtime user, so on a read-only root filesystem set WALKEROS_CACHE_DIR=/app/cache and mount a volume there. Without a writable cache directory, recent errors are not persisted across restarts, and the flow still runs.
  • Architecture. The image is linux/amd64 only.
  • Signals. The image runs under tini and shuts the flow down on SIGTERM. The shutdown drains within 8 seconds and exits 1 when events were lost or a destination did not close cleanly. Set the platform's grace period to at least 10 seconds.
  • In-memory default store. A state operation that names no store uses the collector's in-memory __cache store, which lives inside one process. Anything relying on it across events (state, deduplication, a rate limiter on the default store) is correct only on a single instance. Managed deployments scale up to five instances; point such steps at a store shared by every instance.
  • User. The image runs as walker (UID 1001). node_modules/ in the image is read-only for that user; under /app, only /app/flow and /app/cache are writable.

Kubernetes​

apiVersion: apps/v1
kind: Deployment
metadata:
  name: walkeros-flow
spec:
  replicas: 1
  selector:
    matchLabels:
      app: walkeros-flow
  template:
    metadata:
      labels:
        app: walkeros-flow
    spec:
      containers:
        - name: flow
          image: registry.example.com/my-flow:1.0.0 # built from the canonical Dockerfile
          ports:
            - containerPort: 8080
          env:
            - name: WALKEROS_CACHE_DIR
              value: /app/cache
            - name: WALKEROS_CREDENTIAL
              valueFrom:
                secretKeyRef: { name: walkeros-credential, key: credential }
          livenessProbe:
            httpGet: { path: /health, port: 8080 }
            periodSeconds: 30
          readinessProbe:
            httpGet: { path: /ready, port: 8080 }
            periodSeconds: 10
          resources:
            requests: { memory: 256Mi, cpu: 250m }
            limits: { memory: 512Mi, cpu: 500m }

Keep replicas: 1 for a flow that relies on the in-memory default store (see Constraints).

Troubleshooting​

BUNDLE must be a prebuilt artifact: the runtime was given a flow config. Build it first with walkeros bundle and start the output.

Flow artifact not found: /app/flow/flow.mjs: nothing was copied or mounted at the artifact path. Copy the whole dist/ directory to /app/flow/.

Cannot find package at startup: only flow.mjs was copied, piped or fetched. A server artifact is the directory, including node_modules/, or its archive.

does not provide an export named 'default' at startup: a step's package has no default export (the AWS and GCP sources, for example). Name the export in the step's import.

WALKEROS_CREDENTIAL is not a walkerOS credential: the variable holds something other than the credential the app showed. Check that it holds the whole wos_cred_... value, or pair the runner again.

Exits with a 401 or 403 on secrets, or The auth server refused this runner's credential: the credential was replaced by a newer pairing, revoked, or its deployment ended. Pair the runner again on its Self-hosted tab. When the line also says how far this clock is off, set the machine's clock first.

Next steps​

  • CLI: build, validate and simulate flows
  • Deploy: the build-then-run path end to end
  • Observe: report a running flow's counters and issues
  • Bundled mode: the flow.json format
💡 Need implementation support?
elbwalker offers hands-on support: setup review, measurement planning, destination mapping, and live troubleshooting. Book a 2-hour session (€399)