Skip to main content

Files on your workers

By default, files your steps write on a self-hosted worker (File Storage, Convert to File, CSV and transform nodes, large HTTP responses) are stored in Blokkio, in the storage of the job's project, and count toward your plan's storage. Turn on Keep files on your workers for a pool and they stay on your own servers instead. We recommend it for pools that handle files you'd rather not send to Blokkio.

What changes:

  • Files written by steps on the pool go to a storage volume on your workers. Blokkio stores only the file's id, name, size, type, project and where it is (the pool and the volume's id). No file content is ever uploaded to Blokkio from the pool, not even as a fallback: a step that can't store the file on the worker fails with a clear message.
  • These files don't count toward your plan's storage. The Files page lists them with Stored on <pool> and leaves them out of the storage bar.
  • Downloads and previews on the Files page are streamed on demand from an online worker of the pool, over the connection the worker already keeps to Blokkio (with the same short-lived private links as other files). Nothing is kept in Blokkio on the way. While no worker of the pool is online the file shows offline, and opening it says "Available when a worker in <pool> is online."
  • Deleting a file (on the Files page, with a File step's Delete, or by deleting the workflow or project it belongs to) deletes it on the workers' storage too. If no worker is online, Blokkio keeps trying until one confirms. A pool can't be deleted while its storage still holds files.

Turn it on:

  1. Mount a volume on each worker of the pool and set Worker__Storage__Root to it. The worker image has /data/files ready for this:

    docker run -d --name blokkio-worker --restart unless-stopped \
    -e Worker__ApiUrl=https://api.blokkio.com \
    -e Worker__ApiKey=bkw_xxxxxxxxxxxxxxxxxxxxxxxx \
    -e Worker__Storage__Root=/data/files \
    -v blokkio-worker-files:/data/files \
    ghcr.io/blokkio/worker:1.6.0

    The Portainer stack and the setups shown under Add worker already include the volume.

  2. Under Settings → Workers, switch on Keep files on your workers for the pool. Changing it is recorded in the audit log. Files stored before you switch it on stay where they are.

Several workers in one pool need one shared volume (NFS or similar), so that a file one worker wrote can be read by another. Each worker reports the id of its volume (kept in .blokkio-storage-id at the volume's root; workers on the same volume report the same id). Settings → Workers and the editor's pre-flight check warn when a pool's online workers don't share storage, or when none of them has a volume. Back the volume up like any other data: deleting it deletes the files.

Boundaries:

  • Files that arrive at Blokkio stay in Blokkio storage and count toward the plan: webhook and form uploads, email attachments and other trigger files. A step on the pool can copy them to the worker (File Storage → Upload with the file as input), then you can delete the original.
  • Steps that run on Blokkio's hosted workers can't read files kept on your workers. That includes Send Email attachments, and every step when the project (or environment) runs on hosted workers. The step fails with "“<file>” is kept on your own workers (worker pool “<pool>”), so a step running on Blokkio's hosted workers can't read it.", and the pre-flight check warns about Send Email attachments before you run. A worker of another pool can't read them either. The file is never copied to Blokkio to make it work.
  • Run data still passes through Blokkio. Step inputs and outputs (a file's reference, or a file's content once a step loads it into its output) go through Blokkio like any other run. A Loop over a large file kept on your workers isn't supported: Blokkio drives such loops and can't read the file.
  • Existing files in Blokkio storage aren't moved to your workers.

Security: every request is checked against the file's workspace, project and pool. A worker only serves files of its own pool, with a one-use link that expires within a minute, and never more bytes than the file has. On the volume, files are stored at <root>/<workspace id>/<project id>/<file id>: paths are built from ids only, never from a file name, so nothing can reach outside the storage directory. Files on the volume are not encrypted by Blokkio; use disk encryption on the host if you need it.

Volumes in practice​

  • One worker: a named Docker volume (worker_files in the stacks) or a host folder is enough.

  • Several workers in one pool: give them one shared volume, for example an NFS export. In Compose / Portainer:

    volumes:
    worker_files:
    driver_opts:
    type: nfs
    o: addr=nas.local,rw,nfsvers=4
    device: ":/export/blokkio-files"

    In Kubernetes, mount a ReadWriteMany volume at /data/files through the chart's extraEnv and your own volume settings.

  • Backups: back the volume up like any other data. The files are laid out by ids (<workspace id>/<project id>/<file id>), and .blokkio-storage-id at its root identifies the volume: restore it together with the files, or Blokkio sees a different volume.