Search.../

updateWorkflow( )

Updates an existing workflow.

Description

The updateWorkflow() function returns a Promise that resolves when the workflow has been updated with the specified values.

Only the properties passed in the workflow object will be updated. All other properties will remain the same.

This function requires you to specify the ID of a workflow. To learn about retrieving IDs in the Workflow API, 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 updateWorkflow(_id: string, workflow: WorkflowInfo): Promise<void>

updateWorkflow Parameters

NAME
TYPE
DESCRIPTION
_id
string

ID of the workflow to update.

workflow
WorkflowInfo

Workflow info.

Returns

Return Type:

Promise<
void
>

Was this helpful?

updateWorkflow example

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