---
type: api
title: Test a workflow step
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-step-test
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-post-workflows-step-test
products:
  - Kibana
---

# Test a workflow step

Availability:

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

## Paths

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

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

Execute a single step from a workflow definition in test mode.<br/><br/>[Required authorization] Route required privileges: workflowsManagement:execute.

## Request Body

`application/json`

- `contextOverride` (map string to object) — required
  Context overrides for the step execution.
- `executionContext` (map string to object) — optional
  Execution context for the step execution.
- `stepId` (string) — required
  ID of the step to test.
- `workflowId` (string) — optional
  ID of the workflow containing the step.
- `workflowYaml` (string) — required
  YAML definition of the workflow containing the step.

## Response

Indicates a successful response

## Code Examples

#### Console

```console
POST kbn://api/workflows/step/test
{
  "stepId": "hello_world_step",
  "workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "workflowYaml": "name: Example definition\nenabled: true\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 }}\"",
  "contextOverride": { "inputs": { "message": "override message" } }
}
```

#### curl

```curl
curl \
  -X POST "${KIBANA_URL}/api/workflows/step/test" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
    "stepId": "hello_world_step",
    "workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "workflowYaml": "name: Example definition\nenabled: true\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 }}\"",
    "contextOverride": { "inputs": { "message": "override message" } }
  }'
```

## Response Examples

#### Test step response

Example response returning the step test execution ID

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

