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.

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.

Method Declaration
Copy
function updateWorkflowFields(
  workflowId: string,
  workflowInfo: UpdateWorkflowRequest,
): Promise<void>;
Method Parameters
workflowIdstringRequired

ID of the workflow to update.


workflowInfoUpdateWorkflowRequestRequired

Workflow information to update.

Update a workflow
JavaScript
import { Permissions, webMethod } from "wix-web-module"; import { workflows } from "wix-crm-backend"; /* Sample workflowId value: "c6dea502-1dd0-405f-906f-dcb9776e37e8" * * Sample workflowInfo value: * { * "name": "New name" * } */ export const myUpdateWorkflowFunction = webMethod( Permissions.Anyone, async (workflowId, workflowInfo) => { try { const updatedWorkflow = await workflows.updateWorkflowFields( workflowId, workflowInfo, ); console.log("Success! Updated workflow:", updatedWorkflow); return updatedWorkflow; } catch (error) { console.error(error); } }, ); // Returns a promise that resolves to void.
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?