---
type: api
title: Test a workflow
description: Execute a workflow in test mode without requiring it to be saved or enabled. Provide either a workflow ID to test a saved workflow, a YAML definition to test an unsaved draft, or both to test a modified version of an existing workflow.<br/><br/>[Required authorization] Route required privileges: workflowsManagement:execute.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-post-workflows-test
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-post-workflows-test
products:
  - Kibana
---

# Test a workflow

Availability: 9.4+

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

## Paths

- `POST` `/api/workflows/test`

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

## Description

Execute a workflow in test mode without requiring it to be saved or enabled. Provide either a workflow ID to test a saved workflow, a YAML definition to test an unsaved draft, or both to test a modified version of an existing workflow.<br/><br/>[Required authorization] Route required privileges: workflowsManagement:execute.

## Request Body

`application/json`

- `inputs` (map string to object) — required
  Key-value inputs for the test execution.
- `workflowId` (string) — optional
  ID of an existing workflow to test.
- `workflowYaml` (string) — optional
  YAML definition to test.

## Response

Indicates a successful response

## Code Examples

#### Console

```console
POST kbn://api/workflows/test
{
  "workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "inputs": { "message": "test message" }
}
```

#### curl

```curl
curl \
  -X POST "${KIBANA_URL}/api/workflows/test" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
    "workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "inputs": { "message": "test message" }
  }'
```

## Response Examples

#### Test workflow response

Example response returning the test execution ID

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

