Bulk create workflows
Base URL
https://{kibana_url}
POST
/api/workflows
POST
/s/{space_id} /api/workflows
Auth
Create multiple workflows in a single request. Optionally overwrite existing workflows.
Privileges
workflowsManagement:create
and
workflowsManagement:update
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.
overwrite
boolean · default: false
Whether to overwrite existing workflows.
dryRun
boolean · default: false
When true, performs a preflight conflict check only. Returns the subset of the supplied workflow IDs that already exist (including soft-deleted tombstones and cross-space documents) without writing anything. The response body is { existingIds: string[] } instead of the normal { created, failed } shape.
A required header to protect against CSRF attacks
{
}
workflows
object [] · max items: 500
required
−
Hide 2 properties
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
Bulk create workflows request
2 languages
Request
Console
1 / 2 languages
‹
›
1
2
3
4
5
6
7
POST kbn://api/workflows?overwrite=false
{
"workflows": [
{ "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" },
{ "id": "workflow-b2c3d4e5-f6a7-8901-bcde-f12345678901", "yaml": "name: Second workflow\nenabled: false\ndescription: Another workflow\ntriggers:\n - type: manual\nsteps:\n - name: log_step\n type: console\n with:\n message: \"Hello from second workflow\"\n" }
]
}
1
2
3
4
5
6
7
8
9
10
11
curl \
-X POST "${KIBANA_URL}/api/workflows?overwrite=false" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"workflows": [
{ "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" },
{ "id": "workflow-b2c3d4e5-f6a7-8901-bcde-f12345678901", "yaml": "name: Second workflow\nenabled: false\ndescription: Another workflow\ntriggers:\n - type: manual\nsteps:\n - name: log_step\n type: console\n with:\n message: \"Hello from second workflow\"\n" }
]
}'
Request
Console
1 / 2 languages
‹
›
Example request for creating multiple workflows at once
Show more
1
2
3
4
5
6
7
8
9
10
11
12
POST kbn:/api/workflows
{
"workflows": [
{
"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"
},
{
"id": "workflow-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"yaml": "name: Second workflow\nenabled: false\ndescription: Another workflow\ntriggers:\n - type: manual\nsteps:\n - name: log_step\n type: console\n with:\n message: \u0022Hello from second workflow\u0022\n"
}
]
}
Generated from the API spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
curl \
-X POST "${KIBANA_URL}/api/workflows" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"workflows": [
{
"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"
},
{
"id": "workflow-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"yaml": "name: Second workflow\nenabled: false\ndescription: Another workflow\ntriggers:\n - type: manual\nsteps:\n - name: log_step\n type: console\n with:\n message: \u0022Hello from second workflow\u0022\n"
}
]
}'
Generated from the API spec
Response
Example response after creating multiple workflows
Show more
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"created": [
{
"id": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Example definition"
},
{
"id": "workflow-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"name": "Second workflow"
}
],
"failures": [],
"total": 2
}