Skip to main content

Update Workflow

POST 

/workflow/update

Updates an existing workflow definition. Send workflow.workflowId plus only the fields to change; omitted fields keep their saved value. workflow.stages and workflow.actions replace the saved lists when sent, so send every stage or action, typically edited from /workflow/get. Setting a stage’s aiConfig.flagRecordings to true flags recordings made at a location with an account in that stage and ignores AI classification (aiConfig.enabled) for that stage; omitted or false is off. To change some actions only, send them in changedActions instead: each replaces the saved action with the same actionId. Set dryRun to validate and see changes (each changed field with its before and after) without saving; the response always includes changes. isMigrated cannot be changed here. Requires the workflow:manage permission on the company or on one of the teams the workflow is visible to; changing visibleTo on a versioned workflow requires company-wide permission. Use /workflow/add to create a new workflow.

Checkpoints and pre-actions:

  • actions[].checkpoints (legacy): { [stageId]: { behavior: "always" | "ask" | "never" } }. Before the action, the account passes through these stages as stage-only history entries; nobody is credited for them.
  • actions[].hooks.pre: [{ type: "action", actionId, behavior: "always" | "ask" }]. The listed actions are recorded just before this one, each with its own conditions checked and its own stats credited to the user. The app runs "always" pre-actions automatically and offers "ask" ones.
  • To migrate an action, for each checkpoint stage in stage order with behavior "always" or "ask", add a pre-action with the same behavior whose actionId is the action that moves accounts into that stage (its toStageId), then remove checkpoints. A "never" checkpoint has no pre-action. Preview with dryRun first.
  • isMigrated: whether the company's legacy setup (account statuses, dispositions, event outcomes) has been fully migrated to this workflow. It says nothing about checkpoints or pre-actions.
  • migrationMappings: [{ sourceStage, targetId }], mapping a legacy account status, disposition, event outcome, or metric ID to the stage or action that replaced it. Imports, CRM syncs, plans, programs, and reports still read it, so keep it.

Request​

Responses​

Success