State

Cache

A first-class durable key/value store for relays, flows, and webhook workflows. Register named caches once, then access them with `khotanCache(ctx, "name")` or `khotanData.cache("name")` for snapshots, cursors, and idempotency markers.

cache
source
snapshot
cache
reuse
workflow

Install

$ npx khotan add cache
import { cache } from "@/khotan/caches/cache";
export const cin7ProductsSnapshotCache = cache({
name: "cin7-products-snapshot",
scope: {
plug: "cin7",
resource: "products",
flow: "cin7-to-pollinate-products-relay",
},
ttl: "6h",
});

Documentation

See the full integration guide — schema, generated files, helper API, and configuration — in the Cache docs.