Test a workflow step
Base URL
https://{kibana_url}
POST
/api/workflows/step/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 single step from a workflow definition in test mode.
Privileges
workflowsManagement:execute
Expand all
A required header to protect against CSRF attacks
{
}
contextOverride
map string to object
required
Context overrides for the step execution.
executionContext
map string to object
Execution context for the step execution.
stepId
string
required
ID of the step to test.
workflowId
string
ID of the workflow containing the step.
workflowYaml
string
required
YAML definition of the workflow containing the step.
200
Indicates a successful response
application/json
Thank you for your feedback.
Base URL
https://{kibana_url}
Examples
Example
2 languages
Test step request
2 languages
Request
Console
1 / 2 languages
‹
›
1
2
3
4
5
6
7
POST kbn://api/workflows/step/test
{
"stepId": "hello_world_step",
"workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"workflowYaml": "name: Example definition\nenabled: true\ntriggers:\n - type: manual\ninputs:\n - name: message\n type: string\n default: \"hello world\"\nsteps:\n - name: hello_world_step\n type: console\n with:\n message: \"{{ inputs.message }}\"",
"contextOverride": { "inputs": { "message": "override message" } }
}
1
2
3
4
5
6
7
8
9
10
11
curl \
-X POST "${KIBANA_URL}/api/workflows/step/test" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"stepId": "hello_world_step",
"workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"workflowYaml": "name: Example definition\nenabled: true\ntriggers:\n - type: manual\ninputs:\n - name: message\n type: string\n default: \"hello world\"\nsteps:\n - name: hello_world_step\n type: console\n with:\n message: \"{{ inputs.message }}\"",
"contextOverride": { "inputs": { "message": "override message" } }
}'
Request
Console
1 / 2 languages
‹
›
Example request to test a single workflow step
Show more
1
2
3
4
5
6
7
8
9
10
11
POST kbn:/api/workflows/step/test
{
"contextOverride": {
"inputs": {
"message": "override message"
}
},
"stepId": "hello_world_step",
"workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"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
12
13
14
15
curl \
-X POST "${KIBANA_URL}/api/workflows/step/test" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"contextOverride": {
"inputs": {
"message": "override message"
}
},
"stepId": "hello_world_step",
"workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"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 step test execution ID
Show more
1
2
3
{
"workflowExecutionId": "step-test-exec-a1b2c3d4"
}