FlowPrime guides

Storage: keep your product's files, on FlowPrime's disk or your own bucket

Storage holds the files your product's users upload: photos, documents, exports. Files live in spaces (a folder with its own quota and its own upload keys), and each space lives on one provider: FlowPrime's built-in disk, or a bucket you bring (S3, MinIO, Cloudflare R2, Azure Blob). You set it up through MCP tools; your product then uploads and downloads over REST with a space key.

Storage is not a database. It keeps files; your product's records (users' orders, jobs, applications, permissions) belong in a database you run next to FlowPrime, with the file ids stored there. FlowPrime has no database: a managed Postgres such as Neon or Supabase is the usual pairing (check their current free limits). See platform_guide topic=pilot.

What you can do

Capability How Status
List the providers in the workspace's pool storage_list_providers live
Add your own bucket (s3, minio, r2, azure) storage_create_provider live
Remove a provider storage_delete_provider live
Create, rename, resize a space storage_create_space, storage_update_space live
Delete an empty space storage_delete_space live
Mint, list and revoke space keys storage_mint_space_key, storage_list_space_keys, storage_revoke_space_key live
Upload, list, download, delete files REST /v1/files with a space key live
Time-limited download link REST GET /v1/files/{id}/url live
Direct browser-to-bucket upload REST POST /v1/files/upload-url then POST /v1/files/confirm live (own bucket providers only)
Move a space, or everything, to another provider storage_move_files, storage_get_move live
Usage by product, collection, space, provider storage_get_usage live
Change a provider's credentials or quota dashboard (Developers > Files > Where files live) dashboard

Before you start

Step by step

Give your product a space and upload a file

  1. storage_create_space slug=photos name="Customer photos" quotaBytes=0 (0 = unlimited). Omit providerKey to use where the default space lives, or pass "builtin" or a provider id.
  2. storage_mint_space_key slug=photos name=photos-app scopes=read,write,delete. The answer is the ONLY time the full ffs_... key is shown: store it as a server secret now.
  3. Upload from your backend:
    curl -s https://{org}.storage.fastflow.tech/v1/files \
      -H "X-Api-Key: ffs_..." \
      -F [email protected] -F product=myapp -F collection=avatars
    
    The answer carries the file id, size, space and url (/v1/files/{id}/content). The same upload from Node (18+):
    const form = new FormData();
    form.append("file", new Blob([bytes], { type: "image/jpeg" }), "cat.jpg");
    form.append("product", "myapp");
    form.append("collection", "avatars");
    const res = await fetch(`https://${org}.storage.fastflow.tech/v1/files`, {
      method: "POST", headers: { "X-Api-Key": process.env.STORAGE_KEY }, body: form });
    const file = await res.json();   // keep file.id in your database
    
  4. Download: GET /v1/files/{id}/content with the same header. Metadata: GET /v1/files/{id}. List: GET /v1/files/?collection=avatars&limit=100 (at most 1,000, with cursor). Delete: DELETE /v1/files/{id} (needs the delete scope).
  5. storage_get_usage to see the file counted under the space.

Bring your own bucket (example: Cloudflare R2)

  1. Create an R2 API token scoped to one bucket, for this purpose only. The secret travels through this conversation; revoke the token at the provider if it ever leaks.
  2. storage_create_provider label=r2-main type=r2 bucket=<bucket> region=auto endpoint=https://<account-id>.r2.cloudflarestorage.com accessKey=... secretKey=.... For Azure pass the connection string as credentials instead of the key pair. type=local is refused: the built-in disk already exists.
  3. Point new spaces at it with providerKey=<provider id>, or pass setDefault=true to move the default space onto it.

Move files off the built-in disk

  1. storage_move_files fromProvider=builtin toProvider=<provider id> moves every space that lives on the disk. To move one space only, pass space=<slug> and toProvider.
  2. It runs in the background and answers a move id. Poll storage_get_move moveId=<id> until state is done or failed; failed and skipped files are listed with the reason.
  3. File ids never change, so stored references keep working. Signed links handed out before the move stop working.

Let a browser upload straight to your bucket

  1. Backend: POST /v1/files/upload-url with {"fileName":"cat.jpg","sizeBytes":123456,"contentType":"image/jpeg","product":"myapp","collection":"avatars"} and the space key. The answer has uploadUrl, fileId and expiresAt (15 minutes).
  2. Browser: PUT the bytes to uploadUrl.
  3. Backend: POST /v1/files/confirm with {"fileId":"..."}. A file that was never confirmed does not exist.
  4. On the built-in disk this answers 501: upload through POST /v1/files instead.

Things that trip agents up

Reference

Where to go next