Create a workflow
Base URL
https://{kibana_url}
POST
/api/workflows/workflow
POST
/s/{space_id} /api/workflows/workflow
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.
Create a new workflow from a YAML definition. The YAML is validated and parsed before the workflow is saved. An optional custom ID can be provided.
Privileges
workflowsManagement:create
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
{
}
id
string · min length: 3 · max length: 255 · pattern: ^[a-z0-9]([a-z0-9-]*[a-z0-9])?$
yaml
string · max length: 1048576
required
200
Indicates a successful response
application/json
Thank you for your feedback.
Base URL
https://{kibana_url}
Examples
Example
2 languages
Create workflow request
2 languages
Create workflow with id request
2 languages
Request
Console
1 / 2 languages
‹
›
1
2
3
4
POST kbn://api/workflows/workflow
{
"yaml": "name: Example definition\nenabled: true\ndescription: This is a workflow example\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 }}\"\n"
}
1
2
3
4
5
6
7
8
curl \
-X POST "${KIBANA_URL}/api/workflows/workflow" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"yaml": "name: Example definition\nenabled: true\ndescription: This is a workflow example\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 }}\"\n"
}'
Request
Console
1 / 2 languages
‹
›
Example request for creating a workflow from a YAML definition
Show more
1
2
3
4
POST kbn:/api/workflows/workflow
{
"yaml": "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
curl \
-X POST "${KIBANA_URL}/api/workflows/workflow" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"yaml": "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 created workflow
Show more
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
"createdAt": "2025-11-20T10:30:00.000Z",
"createdBy": "elastic",
"definition": {
"description": "This is a workflow example",
"enabled": true,
"inputs": [
{
"default": "hello world",
"name": "message",
"type": "string"
}
],
"name": "Example definition",
"steps": [
{
"name": "hello_world_step",
"type": "console",
"with": {
"message": "{{ inputs.message }}"
}
}
],
"triggers": [
{
"type": "manual"
}
]
},
"description": "This is a workflow example",
"enabled": true,
"id": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"lastUpdatedAt": "2025-11-20T10:30:00.000Z",
"lastUpdatedBy": "elastic",
"name": "Example definition",
"valid": true,
"yaml": "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"
}
Request
Console
1 / 2 languages
‹
›
Example request for creating a workflow with a custom ID
Show more
1
2
3
4
5
POST kbn:/api/workflows/workflow
{
"id": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"yaml": "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
curl \
-X POST "${KIBANA_URL}/api/workflows/workflow" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"id": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"yaml": "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 created workflow
Show more
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
"createdAt": "2025-11-20T10:30:00.000Z",
"createdBy": "elastic",
"definition": {
"description": "This is a workflow example",
"enabled": true,
"inputs": [
{
"default": "hello world",
"name": "message",
"type": "string"
}
],
"name": "Example definition",
"steps": [
{
"name": "hello_world_step",
"type": "console",
"with": {
"message": "{{ inputs.message }}"
}
}
],
"triggers": [
{
"type": "manual"
}
]
},
"description": "This is a workflow example",
"enabled": true,
"id": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"lastUpdatedAt": "2025-11-20T10:30:00.000Z",
"lastUpdatedBy": "elastic",
"name": "Example definition",
"valid": true,
"yaml": "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"
}