trickroom / Docs
Sign in

SDK reference · Resources

client.flows

client.flows.{ list, get, create, update, run, runs, archive }

A flow is a task you define once, with named inputs, steps and the integrations it uses, then run for any user. Each save makes a new version; a run names the version it expects.

list

list(): Promise<Page>

The application's flows that aren't archived.

Returns Promise<Page>

get

get(id: string): Promise<Resource>

A flow's current version and definition.

Parameters

idstring
The flow's ID.

Returns Promise<Resource>

create

create(input: FlowInput): Promise<Resource>

Creates a flow at version 1.

Parameters

input.namestring
Shown in the dashboard.
input.definitionFlowDefinition
Inputs, steps, output and plugins.

Returns Promise<Resource>

update

update(id: string, input: FlowInput & { version: number }): Promise<Resource>

Saves a new version. version must be the one you last read, or the call fails with flow_changed.

Parameters

idstring
The flow's ID.
input.versionnumber
The version you edited.

Returns Promise<Resource>

run

run(id: string, input: { user_id: string; version: number; inputs?: Record<string, string>; connection_ids?: string[] }, key: string): Promise<Job>

Runs a flow as a job for one user.

Parameters

idstring
The flow's ID.
input.user_idstring
Who it runs for.
input.versionnumber
The version to run.
input.inputsRecord<string, string>optional
A value for every input the flow defines.
input.connection_idsstring[]optional
One account for each integration the flow uses.
keystring
An idempotency key. Retrying with the same key and input returns the first result instead of acting twice.

Returns Promise<Job>

Example · TypeScript
const job = await client.flows.run(
  flow.id,
  { user_id: user.id, version: flow.version, inputs: { week_of: "2026-09-28" } },
  "digest-2026-09-28",
);

runs

runs(id: string): Promise<Page>

The flow's latest 50 runs.

Parameters

idstring
The flow's ID.

Returns Promise<Page>

archive

archive(id: string): Promise<Resource>

Hides the flow; past runs keep their version.

Parameters

idstring
The flow's ID.

Returns Promise<Resource>