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>"
}
]
}Workflows
Update Workflow (PATCH)
PATCH
/
rest
/
workflows
/
{workflow_id_or_name}
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>"
}
]
}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_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
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.
Response
Workflow version created successfully
Response after creating or patching a workflow.
Was this page helpful?

