brain/wiki/data-storage-observability/key-value-store.md
A persistent, project-scoped key-value store that piece steps read/write during flow execution. Backend-only, no UI. Values are arbitrary JSON (jsonb). Available in CE, EE, Cloud.
(projectId, key) unique, value is any JSON. store-entry.service.ts: upsert, getOne, delete.STORE_KEY_MAX_LENGTH), serialized value ≤ 512 KB (STORE_VALUE_MAX_SIZE).storage.get / storage.put / storage.delete./v1/store-entries (POST upsert, GET, DELETE) require securityAccess.engine() — only the worker/engine can call them.projectId comes from the engine principal token, not the request body; callers send only key/value. This gives multi-tenant isolation for free.(projectId, key) unique constraint.object-sizeof > 512 KB → HTTP 413) happens in the controller before the DB.value is nullable; a piece can store null/undefined. Values run through sanitizeObjectForPostgresql before storage.Entry point: storeEntryModule, registered in packages/server/api/src/app/app.ts.
packages/server/api/src/app/store-entry/ — the whole server slice: module, controller, service, TypeORM entitypackages/core/shared/src/lib/core/store-entry/ — StoreEntry type, the two limit constants, and the request DTOspackages/server/engine/src/lib/piece-context/store.ts — engine side that actually calls /v1/store-entries, builds the scoped key, maps errorspackages/server/api/test/integration/cloud/store-entry/ — controller integration testspackages/server/api/src/app/app.ts — where the module gets registeredPaths verified 2026-07-17.