Skip to content

FlowsResource

Defined in: src/resources/flows.ts:62

Flows management API exposed as client.flows.

new FlowsResource(request, getDefaultBusinessAccountId): FlowsResource

Defined in: src/resources/flows.ts:66

RequestFn

BusinessAccountIdAccessor

FlowsResource

create(payload, businessAccountId?): Promise<CreateFlowResponse>

Defined in: src/resources/flows.ts:77

Creates a Flow on a business account. New Flows start in DRAFT. Validates that name is non-empty and categories is a non-empty array before sending. Supply flowJson to seed the definition, publish: true to publish immediately, or cloneFlowId to clone an existing Flow.

CreateFlowPayload

string

Promise<CreateFlowResponse>


delete(flowId): Promise<SuccessResponse>

Defined in: src/resources/flows.ts:203

Deletes a Flow. Only Flows in DRAFT status can be deleted.

string

Promise<SuccessResponse>


deprecate(flowId): Promise<SuccessResponse>

Defined in: src/resources/flows.ts:193

Deprecates a published Flow. Deprecation is irreversible.

string

Promise<SuccessResponse>


get(flowId, fields?): Promise<Flow>

Defined in: src/resources/flows.ts:113

Reads a single Flow by its id. Pass fields to request specific Graph fields; when omitted no field selection is sent.

string

string[]

Promise<Flow>


getPreview(flowId, options?): Promise<FlowPreview>

Defined in: src/resources/flows.ts:225

Reads a Flow’s short-lived preview URL. Pass invalidate: true to force a fresh URL instead of a cached one.

string

GetPreviewOptions

Promise<FlowPreview>


list(options?): Promise<FlowList>

Defined in: src/resources/flows.ts:101

Lists the Flows on a business account. Pass fields to request specific Graph fields; when omitted no field selection is sent.

ListFlowsOptions

Promise<FlowList>


listAssets(flowId): Promise<FlowAssetList>

Defined in: src/resources/flows.ts:213

Lists the assets (e.g. the Flow JSON) attached to a Flow.

string

Promise<FlowAssetList>


publish(flowId): Promise<SuccessResponse>

Defined in: src/resources/flows.ts:183

Publishes a Flow, moving it from DRAFT to PUBLISHED.

string

Promise<SuccessResponse>


update(flowId, payload): Promise<SuccessResponse>

Defined in: src/resources/flows.ts:126

Updates a Flow’s metadata. At least one of name, categories, endpointUri, or applicationId must be provided. To change the Flow’s JSON definition use FlowsResource.updateJson instead.

string

UpdateFlowPayload

Promise<SuccessResponse>


updateJson(flowId, file, options?): Promise<UpdateFlowJsonResponse>

Defined in: src/resources/flows.ts:157

Uploads a Flow JSON definition as a multipart asset. Accepts a Blob, raw Uint8Array bytes, or a JSON string; all are sent as an application/json file part named flow.json (override via options.name). Uploading JSON reverts a published Flow to DRAFT.

string

FlowJsonInput

UpdateFlowJsonOptions

Promise<UpdateFlowJsonResponse>

Independent open-source project. Not affiliated with, endorsed by or sponsored by Meta or WhatsApp. Released under the MIT licence. Source on GitHub.