listPhases( )
Retrieves a list of a workflow's phases.
Description
The listPhases()
function returns a Promise that resolves to a list containing information about the specified workflow's phases.
Use the options
parameter to specify which phases to retrieve and in which order to retrieve them. Phases can be sorted based on their "id"
, "name"
, and "position"
. If no limit
parameter is passed, the first 50 cards are returned. Sort order defaults to by "position"
ascending.
This function requires you to specify the ID of a workflow. To learn about retrieving IDs in the Workflows APIs, see Retrieving IDs.
This function is not a universal function and runs only on the backend.
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function listPhases(workflowId: string, options: ListPhasesOptions): Promise<ListPhasesResponse>
listPhases Parameters
NAME
TYPE
DESCRIPTION
ID of the workflow whose phases will be listed.
Options to use when retrieving the list of workflow phases.
Returns
Return Type:
NAME
TYPE
DESCRIPTION
Metadata for the page of results.
List of phases.
Was this helpful?
listPhases example
1import { phases } from 'wix-workflows.v2';23 async function listPhases(workflowId, options) {4 try {5 const result = await phases.listPhases(workflowId, options);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13