Search.../

listWorkflows( )

Retrieves a list of the site's workflows info.

Description

The listWorkflows() function returns a Promise that resolves to a list containing information about the site's workflows.

Use the options parameter to specify which workflows to retrieve and in which order to retrieve them. Workflows can be sorted based on their "name".

If no limit parameter is passed, the first 100 workflows are returned. Sort order defaults to by "name" ascending.

This function is not a universal function and runs only on the backend.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function listWorkflows(options: ListWorkflowsOptions): Promise<ListWorkflowsResponse>

listWorkflows Parameters

NAME
TYPE
DESCRIPTION
options
Optional
ListWorkflowsOptions

Options to use when retrieving a list of workflows.

Returns

Return Type:

Promise<
ListWorkflowsResponse
>
NAME
TYPE
DESCRIPTION
pagination
PaginationResponse

Metadata for the page of results.

workflows
Array<
WorkflowInfo
>

Retrieved list of workflows.

Was this helpful?

listWorkflows example

Copy Code
1import { workflows } from 'wix-workflows.v2';
2
3 async function listWorkflows(options) {
4 try {
5 const result = await workflows.listWorkflows(options);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13