curl --request POST \
--url https://api.promptlayer.com/rest/workflows \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "greeting-workflow",
"commit_message": "Initial version",
"nodes": [
{
"name": "greeting",
"node_type": "VARIABLE",
"is_output_node": true,
"configuration": {
"value": {
"type": "string",
"value": "Hello, World!"
}
},
"dependencies": []
}
],
"release_labels": [
"production"
]
}
'{
"success": true,
"workflow_id": 123,
"workflow_name": "greeting-workflow",
"workflow_version_id": 456,
"version_number": 1,
"base_version": null,
"release_labels": [
"production"
],
"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>"
}{
"message": "<string>",
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Workflow
curl --request POST \
--url https://api.promptlayer.com/rest/workflows \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "greeting-workflow",
"commit_message": "Initial version",
"nodes": [
{
"name": "greeting",
"node_type": "VARIABLE",
"is_output_node": true,
"configuration": {
"value": {
"type": "string",
"value": "Hello, World!"
}
},
"dependencies": []
}
],
"release_labels": [
"production"
]
}
'{
"success": true,
"workflow_id": 123,
"workflow_name": "greeting-workflow",
"workflow_version_id": 456,
"version_number": 1,
"base_version": null,
"release_labels": [
"production"
],
"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>"
}{
"message": "<string>",
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Behavior Notes
- To create a new workflow, pass
name; to create a new version, passworkflow_idorworkflow_name. - Workflow nodes use the same building blocks as evaluation columns. See Node & Column Types.
- Conditional edge and workflow authoring concepts are covered in Workflows.
Related
Authorizations
Body
Request body for creating a new workflow or a new version of an existing workflow. Use name for a new workflow, or workflow_id/workflow_name to version an existing workflow.
Complete list of workflow nodes. At least one node must be marked is_output_node=true.
Show child attributes
Show child attributes
The name for a new workflow. If not provided, a name will be auto-generated.
1 - 255The ID of an existing workflow to create a new version for.
The name of an existing workflow to create a new version for.
The folder ID to place the workflow in.
A message describing the changes in this version.
A mapping of variable names to their types.
Show child attributes
Show child attributes
Conditional edges between nodes.
Show child attributes
Show child attributes
Labels to attach to this version.
Identifiers from other systems.
Show child attributes
Show child attributes
Response
Workflow 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?

