---
type: api
title: Bulk create workflows
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-post-workflows
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-post-workflows
products:
  - Kibana
---

# Bulk create workflows

Availability:

- Server: `https://{kibana_url}`

## Paths

- `POST` `/api/workflows`
- `POST` `/s/{space_id}/api/workflows`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/authentication#apikeyauth)

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Create multiple workflows in a single request. Optionally overwrite existing workflows.<br/><br/>[Required authorization] Route required privileges: workflowsManagement:create AND workflowsManagement:update.

## Query String Parameters

- `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.

## Request Body

`application/json`

- `workflows` ([] object · max: 500) — required
  - `id` (string · min: 3 · max: 255 · pattern: ^[a-z0-9]([a-z0-9-]*[a-z0-9])?$) — optional
  - `yaml` (string · max: 1048576) — required

## Response

Indicates a successful response

## Code Examples

#### Console

```console
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" }
  ]
}
```

#### curl

```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" }
    ]
  }'
```

## Response Examples

#### Bulk create workflows response

Example response after creating multiple workflows

```json
{
  "created": [
    {
      "id": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Example definition"
    },
    {
      "id": "workflow-b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "name": "Second workflow"
    }
  ],
  "failures": [],
  "total": 2
}
```

