---
title: "Test a workflow"
method: POST
path: "/api/workflows/test"
tags: ["workflows"]
---

# Test a workflow

`POST /api/workflows/test`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/workflows/test</span></div>

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

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 AND workflowsManagement:read.

## Headers

- `kbn-xsrf` string, required

## Request body

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

## Response `200`

Indicates a successful response

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
