POST /api/workflows/test

Spaces method and path for this operation:

post /s/{space_id}/api/workflows/test

Refer to 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.

[Required authorization] Route required privileges: workflowsManagement:execute AND workflowsManagement:read.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

application/json

Body

  • inputs object Required

    Key-value inputs for the test execution.

    Additional properties are allowed.

  • workflowId string

    ID of an existing workflow to test.

  • workflowYaml string

    YAML definition to test.

Responses

  • 200 application/json

    Indicates a successful response

POST /api/workflows/test
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" }
  }'
POST kbn://api/workflows/test
{
  "workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "inputs": { "message": "test message" }
}
Request examples
Example request to test a saved workflow by its ID
{
  "inputs": {
    "message": "test message"
  },
  "workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Example request to test an unsaved workflow YAML draft
{
  "inputs": {
    "message": "test message"
  },
  "workflowYaml": "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"
}
Response examples (200)
Example response returning the test execution ID
{
  "workflowExecutionId": "test-exec-a1b2c3d4-e5f6"
}