@flowget/sdk
v0.1.2
Published
Thin Temporal-client wrapper for the Flowget customer-side workflow interaction surface — submit, cancel, signal, query, subscribe, getResult, and idempotent schedule reconcile — with structured errors and a bring-your-own-worker privacy boundary.
Maintainers
Readme
@flowget/sdk
A thin Temporal-client wrapper for the Flowget customer-side workflow
interaction surface. Build a client, then submit workflows and cancel,
signal, query, subscribe to, or fetch the result of a run — plus
idempotent Temporal Schedule reconcile via client.schedules. Errors are
surfaced as structured FlowgetSdkError subclasses; Temporal-internal error
classes never cross the SDK boundary.
Install
npm i @flowget/sdkIt has peer dependencies on @flowget/types and @flowget/codec — install
them alongside it.
Usage
import { createClient } from "@flowget/sdk";
import type { StateEvent } from "@flowget/sdk";
const client = await createClient({
temporal: { address: "localhost:7233", namespace: "default" },
});
const handle = await client.submit({
workflow: graph,
input: { orderId: "ord_123" },
});
console.log(handle.executionId);
const result = await handle.result;
// Observe the run's lifecycle as an async iterable of StateEvents.
for await (const event of client.subscribe(handle.executionId)) {
// handle each event: StateEvent
}⚠️ 0.x is unstable
The surface is unstable until v1 — breaking changes ship as minor bumps. Pin
exact versions in consumers ("@flowget/sdk": "0.1.0", not "^0.1.0").
Links
- Full documentation: https://docs.flowget.io
- Security policy: SECURITY.md
- License: FSL-1.1-ALv2 (see LICENSE)
