curl --request POST \
--url https://api.promptlayer.com/workflows/{workflow_name}/run \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"input_variables": {
"user_message": "I need help with billing"
},
"metadata": {
"environment": "production"
},
"return_all_outputs": false
}
'{
"success": true,
"message": "Workflow execution started",
"warning": null,
"workflow_version_execution_id": 98765
}Workflows
Run Workflow
POST
/
workflows
/
{workflow_name}
/
run
curl --request POST \
--url https://api.promptlayer.com/workflows/{workflow_name}/run \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"input_variables": {
"user_message": "I need help with billing"
},
"metadata": {
"environment": "production"
},
"return_all_outputs": false
}
'{
"success": true,
"message": "Workflow execution started",
"warning": null,
"workflow_version_execution_id": 98765
}Initiate an execution of a Workflow by name. You can run the latest version, choose a version by label or version number, pass input variables and metadata, and optionally receive results asynchronously with a callback URL.
Behavior Notes
workflow_label_nameandworkflow_version_numberidentify a specific version; omit both to run the latest version.- When
callback_urlis provided, the API accepts the run immediately and posts results to your callback when execution finishes. - Use Get Workflow Version Execution Results to poll for execution output.
Related
Body
application/json
Parameters to run a workflow by label, version number, or latest version. workflow_label_name and workflow_version_number are mutually exclusive.
Response
Workflow execution created successfully
Response after initiating a workflow execution.
Was this page helpful?

