updateWorkflowFields( )
Deprecated. This function is being discontinued in the upcoming months. We are working to provide alternatives, and we'll provide timely updates before implementing any changes. We understand that this transition might present challenges, and we appreciate your patience and understanding.
Description
Updates an existing workflow.
The updateWorkflowFields()
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.
Syntax
function updateWorkflowFields(workflowId: string, workflowInfo: UpdateWorkflowRequest): Promise<void>
updateWorkflowFields Parameters
NAME
TYPE
DESCRIPTION
ID of the workflow to update.
Workflow information to update.
Returns
Fulfilled - When the workflow has been updated.
Return Type:
Was this helpful?
Update a workflow
1import { Permissions, webMethod } from 'wix-web-module';2import { workflows } from 'wix-crm-backend';34/* Sample workflowId value: "c6dea502-1dd0-405f-906f-dcb9776e37e8"5 *6 * Sample workflowInfo value:7 * {8 * "name": "New name"9 * }10 */1112export const myUpdateWorkflowFunction = webMethod(Permissions.Anyone, async (workflowId, workflowInfo) => {13 try {14 const updatedWorkflow = await workflows.updateWorkflowFields(workflowId, workflowInfo);1516 console.log('Success! Updated workflow:', updatedWorkflow);17 return updatedWorkflow;18 } catch (error) {19 console.error(error);20 }21});2223// Returns a promise that resolves to void.