Skip to content

The open alternative to Salesforce, designed for AI.

docs: clarify that the app key-value store is persistent (Postgres-backed) (#25160)

martmull799cfcbac031
diff --git a/packages/twenty-docs/developers/extend/apps/logic/key-value-store.mdx b/packages/twenty-docs/developers/extend/apps/logic/key-value-store.mdx
index 893219f4c53..77a080d3011 100644
--- a/packages/twenty-docs/developers/extend/apps/logic/key-value-store.mdx
+++ b/packages/twenty-docs/developers/extend/apps/logic/key-value-store.mdx
@@ -8,6 +8,8 @@ Logic functions run sandboxed in short-lived Node.js processes — once a run fi
Every application gets its own isolated namespace: entries are keyed by the authenticated app, so your keys can never collide with — or be read by — another application.
+The store is **persistent**: entries are stored in the instance's PostgreSQL database — not in an in-memory cache like Redis — so they survive server restarts, deployments, and app updates, and stay around until you delete them. This makes it reliable for durable state like sync cursors or per-user configuration, not just short-lived caches. Values are stored as plain JSON without application-level encryption, so don't put secrets in it — keep API keys and other credentials in secret [application or server variables](/developers/extend/apps/config/application), which are encrypted at rest.
+
```text
┌─────────────────┐ kv.set(key, value) ┌──────────────────────────┐
│ Logic function │ ─────────────────────▶ │ Application KV store │
@@ -96,7 +98,7 @@ export default defineLogicFunction({
- **Namespacing.** Prefix keys to keep different concerns apart — `sync-cursor:linear`, `cache:exchange-rate:USD:EUR`, `lock:nightly-report`.
- **Expiry (TTL).** The store has no built-in expiration. Store a timestamp inside the value (as in the cache example) and check it on read, or clear stale keys from a [cron-triggered function](/developers/extend/apps/logic/logic-functions).
- **What to store.** Any JSON-serializable value — numbers, strings, arrays, objects. Keep entries small; this is for coordination and caching, not large blobs or files. For files, use a `FILES` field and [`uploadFile`](/developers/extend/apps/logic/logic-functions#uploading-files).
-- **Visibility.** Entries live in the instance database, not as workspace records — they never show up in the workspace UI, aren't part of your app's data model, and need no role or object permissions.
+- **Visibility.** Entries live in the instance's Postgres database, not as workspace records — they never show up in the workspace UI, aren't part of your app's data model, and need no role or object permissions.
## Alternative: a queryable store object