Reference
fx The complete fx surface — every call a flow can make, its signature, and the effect it records.
fx is the second argument of every do — the single door to the world. This page is the whole surface; each entry notes the effect it records , which is what feeds the Manifest, caching, and capability checks.
flow ({
do : async ( input , fx ) => {
// everything below, on this one object
},
});
Signature Records Returns fx.store(sqlDecl).select().from(t)…readrows (where · orderBy · limit · offset chainable) fx.store(sqlDecl).insert(t).values(v)writePromise<void>fx.store(sqlDecl).update(t).set(v).where(…)writePromise<void>fx.store(sqlDecl).delete(t).where(…)writePromise<void>fx.store(sqlDecl).findById(t, id)readrow | undefined fx.store(kv).get / set(key, value, ttl?) / delete / list(prefix?)read / write per op fx.store(files).put / get / delete / list(prefix?)read / write per op fx.store(index).upsert / search(vector, topK?) / deleteread / write per op
See Store for the query-builder surface.
Signature Records Notes fx.emit(signal, payload?)emitWith the postgres driver, joins your transaction
Signature Records Returns / notes fx.call(flow, input?)callThe callee's out — runs through the same pipeline fx.step(name, fn)— Durable step: replays from the journal, never re-runs fx.fail(code, data, opts?)— Typed failure value (opts.message overrides)
Signature Records Notes fx.send(template, { to?, data?, via? })sendvia orders the fallback chain; dry runs record would have fired
Signature Records Returns fx.ask(prompt, input?, { via? })askObject validated against the prompt's out fx.run(agent, input?)askAgent result fx.stream(model, { prompt?, data? })askAsyncIterable<string> of chunksfx.search(embed, query, { topK? })readMatches from the index/embed
AI calls are nondeterministic: journaling is forced on and auto-cache disabled around them.
Signature Records Returns / notes fx.vault(contract)readCleartext, inside this flow only — registered with the redactor at boot
Signature Notes fx.clock.now()Epoch-ms, injectable — the only legal "now" fx.clock.sleep(label, duration)Durable sleep in durable flows; immediate otherwise
Durations: "200ms" · "30s" · "2m" · "1h" · "7d".
Signature Notes fx.cache.get(key)Value or undefined fx.cache.set(key, value, ttl?)Optional TTL string fx.cache.getOrSet(key, ttl, produce)Read-through; writes invalidate by effect
Helper Status Body fx.json.ok(value, { meta? })200 { data, meta?, error: null }fx.json.create(value)201 { data, error: null }fx.json.empty()204 no body fx.json.with(data, meta)200 paginated envelope
Returning a plain value instead answers 200 with { data: value, error: null } — the helpers exist for status and meta control.
Signature Notes fx.log.debug/info/warn/error(msg, data?)Redacting — secrets print as *** fx.t(key, params?)Localized message from the i18n config fx.id()UUID — the only legal id generator
Property Shape fx.auth{ userId: string | null, scopes: Set<string>, verified?: boolean }fx.operator{ id: string | null } — Console planefx.tenant{ id: string | null } — active tenant
Every option in oke.config.ts — drivers per environment, images, i18n, tenancy, privacy, db sync, topology, ports, and console.
Every environment variable OKE reads — connection URLs, driver overrides, secrets, and CLI flags, grouped by what they configure.