Test a workflow
Base URL
https://{kibana_url}
POST
/api/workflows/test
POST
/s/{space_id} /api/workflows/test
Auth
Stack
9.4+
The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.
Availability
Generally available since 9.4
This functionality is generally available and ready for production usage.
Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.
This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Execute a workflow in test mode without requiring it to be saved or enabled. Provide either a workflow ID to test a saved workflow, a YAML definition to test an unsaved draft, or both to test a modified version of an existing workflow.
Privileges
workflowsManagement:execute
Expand all
space_id
string
optional
An identifier for the space. If space_id is not provided in the URL, the default space is used. Refer to Spaces for more information.
A required header to protect against CSRF attacks
{
}
inputs
map string to object
required
Key-value inputs for the test execution.
workflowId
string
ID of an existing workflow to test.
workflowYaml
string
YAML definition to test.
200
Indicates a successful response
application/json
Thank you for your feedback.
Base URL
https://{kibana_url}
Examples
Example
2 languages
Test workflow by id request
2 languages
Test workflow by yaml request
2 languages
Request
Console
1 / 2 languages
‹
›
1
2
3
4
5
POST kbn://api/workflows/test
{
"workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"inputs": { "message": "test message" }
}
1
2
3
4
5
6
7
8
9
curl \
-X POST "${KIBANA_URL}/api/workflows/test" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"inputs": { "message": "test message" }
}'
Request
Console
1 / 2 languages
‹
›
Example request to test a saved workflow by its ID
Show more
1
2
3
4
5
6
7
POST kbn:/api/workflows/test
{
"inputs": {
"message": "test message"
},
"workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Generated from the API spec
1
2
3
4
5
6
7
8
9
10
11
curl \
-X POST "${KIBANA_URL}/api/workflows/test" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"inputs": {
"message": "test message"
},
"workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}'
Generated from the API spec
Response
Example response returning the test execution ID
Show more
1
2
3
{
"workflowExecutionId": "test-exec-a1b2c3d4-e5f6"
}
Request
Console
1 / 2 languages
‹
›
Example request to test an unsaved workflow YAML draft
Show more
1
2
3
4
5
6
7
POST kbn:/api/workflows/test
{
"inputs": {
"message": "test message"
},
"workflowYaml": "name: Example definition\nenabled: true\ndescription: This is a workflow example\ntriggers:\n - type: manual\ninputs:\n - name: message\n type: string\n default: \u0022hello world\u0022\nsteps:\n - name: hello_world_step\n type: console\n with:\n message: \u0022{{ inputs.message }}\u0022\n"
}
Generated from the API spec
1
2
3
4
5
6
7
8
9
10
11
curl \
-X POST "${KIBANA_URL}/api/workflows/test" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"inputs": {
"message": "test message"
},
"workflowYaml": "name: Example definition\nenabled: true\ndescription: This is a workflow example\ntriggers:\n - type: manual\ninputs:\n - name: message\n type: string\n default: \u0022hello world\u0022\nsteps:\n - name: hello_world_step\n type: console\n with:\n message: \u0022{{ inputs.message }}\u0022\n"
}'
Generated from the API spec
Response
Example response returning the test execution ID
Show more
1
2
3
{
"workflowExecutionId": "test-exec-a1b2c3d4-e5f6"
}