---
title: "Make small changes to one Hive automation: add a step, connect two steps, change one setting, move or remove a step. Hive applies them all or none, and saves nothing while anything is wrong. It saves a DRAFT; going live is a separate step a person approves in Hive."
method: POST
path: "/api/v1/tools/patch_flow"
---

# Make small changes to one Hive automation: add a step, connect two steps, change one setting, move or remove a step. Hive applies them all or none, and saves nothing while anything is wrong. It saves a DRAFT; going live is a separate step a person approves in Hive.

`POST /api/v1/tools/patch_flow`

## Request

- Base URL: `https://hivepublish.com`
- URL: `https://hivepublish.com/api/v1/tools/patch_flow`
- Auth: HTTP bearer

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `flowId` string, required: The Hive automation to change.
  - `ops` object[], required: The changes to make, in order. Hive applies them all or none.
    - `op` 'add_node' | 'remove_node' | 'set_node_config' | 'connect' | 'disconnect' | 'move_node' | 'toggle_optional_step' | 'set_flow_settings', required: Which change this is.
    - `node` object
      - `id` string: An id for the new step. Hive names one when this is left out.
      - `kind` 'trigger' | 'message' | 'public_reply' | 'collect_data' | 'action' | 'condition' | 'delay' | 'handoff' | 'random_split' | 'ai_step', required: What kind of step this is. Read describe_flow_nodes first.
      - `label` string: The words shown on the step.
      - `config` object, required: The settings for this kind of step, exactly as describe_flow_nodes lists them.
      - `position` object
        - `x` integer: Across.
        - `y` integer: Down.
    - `nodeId` string: The step this change is about.
    - `config` object: Replaces every setting on the step.
    - `patch` object: Changes only the settings named here and leaves the rest alone.
    - `label` string: New words for the step.
    - `from` string: The step a connection leaves.
    - `to` string: The step a connection arrives at.
    - `fromHandle` string: Which output of the step the connection leaves by. Hive uses the step’s usual next output when this is left out.
    - `position` object
      - `x` integer: Across.
      - `y` integer: Down.
    - `enabled` boolean: Switch an optional step on or off.
    - `settings` object: For set_flow_settings: goals, timezone, quietHours, frequencyCap or purpose.
  - `expectedRevision` integer, required: The revision read_flow_document returned.
  - `expectedDraftVersionId` string, required: The draftVersionId read_flow_document returned.

## Response `200`

Tool result

- ToolResult
  - `data` unknown, required
  - `meta` object, required
    - `tool` string
    - `workspaceId` string, uuid

## Other responses

- `400`: Invalid input
- `401`: Missing or invalid credential
- `403`: Missing workspace scope, role permission, or plan entitlement
- `409`: Idempotency conflict, replay, or request still in progress
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/hivepublish/apis/hive-developer-api.md) · [All operations](https://skmtc.dev/hivepublish/apis/hive-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hivepublish/apis/hive-developer-api/revisions/b440c763583e?raw)
