FlowsResource
Defined in: src/resources/flows.ts:62
Flows management API exposed as client.flows.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FlowsResource(
request,getDefaultBusinessAccountId):FlowsResource
Defined in: src/resources/flows.ts:66
Parameters
Section titled “Parameters”request
Section titled “request”RequestFn
getDefaultBusinessAccountId
Section titled “getDefaultBusinessAccountId”BusinessAccountIdAccessor
Returns
Section titled “Returns”FlowsResource
Methods
Section titled “Methods”create()
Section titled “create()”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.
Parameters
Section titled “Parameters”payload
Section titled “payload”businessAccountId?
Section titled “businessAccountId?”string
Returns
Section titled “Returns”Promise<CreateFlowResponse>
delete()
Section titled “delete()”delete(
flowId):Promise<SuccessResponse>
Defined in: src/resources/flows.ts:203
Deletes a Flow. Only Flows in DRAFT status can be deleted.
Parameters
Section titled “Parameters”flowId
Section titled “flowId”string
Returns
Section titled “Returns”Promise<SuccessResponse>
deprecate()
Section titled “deprecate()”deprecate(
flowId):Promise<SuccessResponse>
Defined in: src/resources/flows.ts:193
Deprecates a published Flow. Deprecation is irreversible.
Parameters
Section titled “Parameters”flowId
Section titled “flowId”string
Returns
Section titled “Returns”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.
Parameters
Section titled “Parameters”flowId
Section titled “flowId”string
fields?
Section titled “fields?”string[]
Returns
Section titled “Returns”Promise<Flow>
getPreview()
Section titled “getPreview()”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.
Parameters
Section titled “Parameters”flowId
Section titled “flowId”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<FlowPreview>
list()
Section titled “list()”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.
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Promise<FlowList>
listAssets()
Section titled “listAssets()”listAssets(
flowId):Promise<FlowAssetList>
Defined in: src/resources/flows.ts:213
Lists the assets (e.g. the Flow JSON) attached to a Flow.
Parameters
Section titled “Parameters”flowId
Section titled “flowId”string
Returns
Section titled “Returns”Promise<FlowAssetList>
publish()
Section titled “publish()”publish(
flowId):Promise<SuccessResponse>
Defined in: src/resources/flows.ts:183
Publishes a Flow, moving it from DRAFT to PUBLISHED.
Parameters
Section titled “Parameters”flowId
Section titled “flowId”string
Returns
Section titled “Returns”Promise<SuccessResponse>
update()
Section titled “update()”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.
Parameters
Section titled “Parameters”flowId
Section titled “flowId”string
payload
Section titled “payload”Returns
Section titled “Returns”Promise<SuccessResponse>
updateJson()
Section titled “updateJson()”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.
Parameters
Section titled “Parameters”flowId
Section titled “flowId”string
options?
Section titled “options?”Returns
Section titled “Returns”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.