---
type: api
title: Run a workflow
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-post-workflows-workflow-id-run
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-post-workflows-workflow-id-run
products:
  - Kibana
---

# Run a workflow

Availability: 9.4+

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

## Paths

- `POST` `/api/workflows/workflow/{id}/run`
- `POST` `/s/{space_id}/api/workflows/workflow/{id}/run`

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

#### Path Parameters

- `id` (string · max: 255)
  Workflow ID

## Description

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

Execute a workflow by its ID with the provided inputs. The workflow must be enabled and have a valid definition. Returns an execution ID that can be used to monitor progress.<br/><br/>[Required authorization] Route required privileges: workflowsManagement:execute.

## Request Body

`application/json`

- `inputs` (map string to object) — required
  Key-value inputs for the workflow execution.
- `metadata` (map string to object) — optional
  Optional metadata for the execution.

## Response

Indicates a successful response

## Code Examples

#### Console

```console
POST kbn://api/workflows/workflow/{id}/run
{
  "inputs": {
    "message": "hello from the API"
  }
}
```

#### curl

```curl
curl \
  -X POST "${KIBANA_URL}/api/workflows/workflow/{id}/run" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": {
      "message": "hello from the API"
    }
  }'
```

## Response Examples

#### Run workflow response

Example response returning the execution ID

```json
{
  "workflowExecutionId": "exec-a1b2c3d4-e5f6-7890"
}
```

