Search.../

getPhase( )

Retrieves a phase by ID.

Description

The getPhase() function returns a Promise that resolves to the phase with the specified ID.

This function requires you to specify the ID of a phase. 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.

Admin Method

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

Syntax

function getPhase(_id: string): Promise<GetPhaseResponse>

getPhase Parameters

NAME
TYPE
DESCRIPTION
_id
string

ID of the phase to retrieve.

Returns

Return Type:

Promise<
GetPhaseResponse
>
NAME
TYPE
DESCRIPTION
phase
Phase

Requested phase.

Was this helpful?

getPhase example

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