Spaces method and path for this operation:
post /s/{space_id}/api/workflows
Refer to Spaces for more information.
Create multiple workflows in a single request. Optionally overwrite existing workflows.
[Required authorization] Route required privileges: workflowsManagement:create AND workflowsManagement:update.
POST
/api/workflows
curl
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" }
]
}'
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" }
]
}
Request example
Example request for creating multiple workflows at once
{
"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"
}
]
}
Response examples (200)
Example response after creating multiple workflows
{
"total": 2,
"created": [
{
"id": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Example definition"
},
{
"id": "workflow-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"name": "Second workflow"
}
],
"failures": []
}