Skip to main content
PATCH
Partially update a Workflow by creating a new version from an existing base version. Use this endpoint when you want to change only selected nodes or version metadata without resending the complete workflow graph.

Behavior Notes

  • If base_version is omitted, PromptLayer patches from the latest version.
  • nodes are merged by name: unmentioned nodes are preserved, object values add or update nodes, and null removes a node.
  • Node configuration is deep-merged, while dependencies, required_input_variables, and edges are replaced when provided.
  • release_labels are moved or attached to the newly created version.

Authorizations

X-API-KEY
string
header
required

Path Parameters

workflow_id_or_name
string
required

The ID or name of the workflow to update.

Body

application/json

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 | null

The version number to base changes on. Defaults to the latest version.

commit_message
string | null

A message describing the changes.

nodes
object | null

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 | null

If provided, replaces the input variables entirely.

edges
object[] | null

If provided, replaces edges entirely. If omitted, existing edges are copied except edges that reference removed nodes.

release_labels
string[] | null

Labels to move or attach to the newly created workflow version.

Response

Workflow version created successfully

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.

external_ids
ExternalId · object[]
required

External ID mappings for the workflow.

base_version
integer | null

The base version this was created from (PATCH only).

release_labels
string[] | null

Labels attached to this version.

nodes
object[]

Summary of nodes in the workflow.

required_input_variables
object

Required input variables for the workflow.