patch_workflow
Apply ordered patch operations to GoHighLevel workflows to insert, update, delete, move, or rewire steps and triggers; abort all changes if any operation fails.
Instructions
Apply an ordered list of patch operations to a workflow with deterministic server-side pointer rewiring. Ops: insert_after / update_step / delete_step / move / rewire_step (plus add_trigger / update_trigger / remove_trigger). Param roles — step_id = the SUBJECT the op acts on (update_step/delete_step/move/rewire_step); after_step_id = the ANCHOR to position after (insert_after/move); next = the target pointer for rewire_step (a step ID or null to terminate); trigger_id = the subject trigger. insert_after also accepts step_id as an alias for after_step_id. rewire_step overwrites a non-branched step scalar next in place (no splice, no reorder) — it does NOT validate for cycles or orphaned downstream steps; the caller owns flow correctness. All-or-nothing: any op failure aborts before any GHL write. Detects external workflow changes via the version field. Use after read_workflow_outline + read_workflow_step. For whole-workflow rewrites or branched-step splices, fall back to update_workflow. For field meanings, allowed values and worked examples for every step type, use the GHL Workflow Docs MCP.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operations | Yes | Ordered list of patch operations | |
| workflowId | Yes | Workflow ID (from list_workflows) |