curl --request PATCH \
--url https://api.promptlayer.com/rest/workflows/{workflow_id_or_name} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"commit_message": "Updated prompt template version",
"nodes": {
"response_generator": {
"configuration": {
"template": {
"prompt_name": "response-v2",
"label": "production"
}
}
}
}
}
'{
"success": true,
"workflow_id": 123,
"workflow_name": "greeting-workflow",
"workflow_version_id": 456,
"version_number": 3,
"base_version": 2,
"release_labels": [
"staging"
],
"nodes": [
{
"id": "node-uuid",
"name": "greeting",
"node_type": "VARIABLE",
"is_output_node": true
}
],
"required_input_variables": {},
"external_ids": []
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Update Workflow (PATCH)
curl --request PATCH \
--url https://api.promptlayer.com/rest/workflows/{workflow_id_or_name} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"commit_message": "Updated prompt template version",
"nodes": {
"response_generator": {
"configuration": {
"template": {
"prompt_name": "response-v2",
"label": "production"
}
}
}
}
}
'{
"success": true,
"workflow_id": 123,
"workflow_name": "greeting-workflow",
"workflow_version_id": 456,
"version_number": 3,
"base_version": 2,
"release_labels": [
"staging"
],
"nodes": [
{
"id": "node-uuid",
"name": "greeting",
"node_type": "VARIABLE",
"is_output_node": true
}
],
"required_input_variables": {},
"external_ids": []
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Behavior Notes
- If
base_versionis omitted, PromptLayer patches from the latest version. nodesare merged by name: unmentioned nodes are preserved, object values add or update nodes, andnullremoves a node.- Node
configurationis deep-merged, whiledependencies,required_input_variables, andedgesare replaced when provided. release_labelsare moved or attached to the newly created version.
Related
Authorizations
Path Parameters
The ID or name of the workflow to update.
Body
Request body for partially updating a workflow. The server fetches base_version (latest if omitted), merges node updates, and creates a new version.
The version number to base changes on. Defaults to the latest version.
A message describing the changes.
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.
Show child attributes
Show child attributes
If provided, replaces the input variables entirely.
Show child attributes
Show child attributes
If provided, replaces edges entirely. If omitted, existing edges are copied except edges that reference removed nodes.
Show child attributes
Show child attributes
Labels to move or attach to the newly created workflow version.
Response
Workflow version created successfully
Response after creating or patching a workflow.
Indicates if the request was successful.
The ID of the workflow.
The name of the workflow.
The ID of the created workflow version.
The version number.
External ID mappings for the workflow.
Show child attributes
Show child attributes
The base version this was created from (PATCH only).
Labels attached to this version.
Summary of nodes in the workflow.
Show child attributes
Show child attributes
Required input variables for the workflow.
Show child attributes
Show child attributes
Was this page helpful?

