POST /api/workflows/step/test

Spaces method and path for this operation:

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

Refer to Spaces for more information.

Execute a single step from a workflow definition in test mode.

[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

  • contextOverride object Required

    Context overrides for the step execution.

    Additional properties are allowed.

  • executionContext object

    Execution context for the step execution.

    Additional properties are allowed.

  • stepId string Required

    ID of the step to test.

  • workflowId string

    ID of the workflow containing the step.

  • workflowYaml string Required

    YAML definition of the workflow containing the step.

Responses

  • 200 application/json

    Indicates a successful response

POST /api/workflows/step/test
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" } }
  }'
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" } }
}
Request example
Example request to test a single workflow step
{
  "stepId": "hello_world_step",
  "workflowId": "workflow-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "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",
  "contextOverride": {
    "inputs": {
      "message": "override message"
    }
  }
}
Response examples (200)
Example response returning the step test execution ID
{
  "workflowExecutionId": "step-test-exec-a1b2c3d4"
}