---
title: "Patch Workflow"
method: PATCH
path: "/rest/workflows/{workflow_id_or_name}"
tags: ["workflow"]
---

# Patch Workflow

`PATCH /rest/workflows/{workflow_id_or_name}`

## Path parameters

- `workflow_id_or_name` string, required

## Request body

- PatchWorkflow — Request body for partially updating a workflow. The server fetches base_version (latest if omitted), merges node updates, and creates a new version.
  - `base_version` integer, nullable — The version number to base changes on. Defaults to the latest version.
  - `commit_message` string, nullable — A message describing the changes.
  - `nodes` object, nullable — Node updates keyed by node name. Provide an object to add/update a node, or null to remove a node. Node configuration is deep-merged; dependencies are replaced.
  - `required_input_variables` object, nullable — If provided, replaces the input variables entirely.
  - `edges` Edge[], nullable — If provided, replaces edges entirely. If omitted, existing edges are copied except edges that reference removed nodes.
    - `source_node_name` string, required — The source node name.
    - `target_node_name` string, required — The target node name.
    - `is_and` boolean, required — Whether multiple conditionals use AND logic (true) or OR logic (false).
    - `conditionals` EdgeConditional[], required — At least one conditional.
      - `position` integer, required — Order of evaluation.
      - `operator` '=' | '!=' | '<' | '>' | '<=' | '>=' | 'in' | 'not_in' | 'is_null' | 'is_not_null', required — Comparison operator.
      - `left_config` object, required — Left side of comparison. Can be static_value or source.
      - `right_config` object, required — Right side of comparison. Can be static_value or source.
  - `release_labels` string[], nullable — Labels to move or attach to the newly created workflow version.

## Response `201`

Workflow version created successfully

- CreateWorkflowResponse — Response after creating or patching a workflow.
  - `success` boolean, required — Indicates if the request was successful.
  - `workflow_id` integer, required — The ID of the workflow.
  - `workflow_name` string, required — The name of the workflow.
  - `workflow_version_id` integer, required — The ID of the created workflow version.
  - `version_number` integer, required — The version number.
  - `base_version` integer, nullable — The base version this was created from (PATCH only).
  - `release_labels` string[], nullable — Labels attached to this version.
  - `nodes` object[] — Summary of nodes in the workflow.
    - `id` string
    - `name` string
    - `node_type` string
    - `is_output_node` boolean
  - `required_input_variables` object — Required input variables for the workflow.
  - `external_ids` ExternalId[], required — External ID mappings for the workflow.
    - `source` string, required — The external system or namespace that owns the ID.
    - `external_id` string, required — The identifier for this entity in the external system.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized - missing or invalid API key.
- `404` — Not found - requested resource does not exist or is not accessible.
- `422` — Validation error - request parameters or body are invalid.

---

[API](https://skmtc.dev/promptlayer/apis/promptlayer-api.md) · [All operations](https://skmtc.dev/promptlayer/apis/promptlayer-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/promptlayer/promptlayer-api/revisions/a23093a0a506/schema)
