---
title: "Test Workflow"
method: POST
path: "/v3/workflow-editor/drafts/{workflow_id}/test"
tags: ["workflow-editor"]
---

# Test Workflow

`POST /v3/workflow-editor/drafts/{workflow_id}/test`

## Request

- Base URL: `https://api.mentium.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mentium.io/v3/workflow-editor/drafts/{workflow_id}/test`
- Auth: HTTP bearer

Test a V3 workflow via the V3 Temporal orchestrator.

The workflow is materialized (YAML → DB nodes/edges), then the
test service builds a ``WorkflowExecutionContext`` with the trigger
node's output pre-populated from ``body.context``  - the trigger
itself is **not** executed.

Currently supports the **event-trigger** type for testing.

## Path parameters

- `workflow_id` string, uuid, required

## Headers

- `mentium-workspace-id` string, nullable

## Request body

- WorkflowTestRequest: Request to test a V3 workflow. The ``context`` dict is validated against the trigger node's ``output_model`` and injected as the trigger node's ``output_data``. Downstream nodes reference it via ``{{$.trigger-id.output.…}}``. The trigger itself is **not** executed.
  - `context` object: Trigger test data - validated against the trigger node's output_model. For event-trigger: include ``resource_type``, ``resource_id``, ``event_data``, etc. For email-trigger: include ``subject``, ``sender``, ``message_id``, etc. ``triggered_at`` is auto-populated if not provided.
  - `is_test` boolean: Whether this is a test run.

## Response `200`

Successful Response

- WorkflowTestOut: Response after starting a V3 test workflow run.
  - `temporal_workflow_id` string, required: Temporal workflow ID for tracking.
  - `workflow_id` string, required: The workflow that was tested.
  - `execution_id` string, required: The workflow execution ID.
  - `status` string: Test run status.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/mentium/apis/mentium-api.md) - [All operations](https://skmtc.dev/mentium/apis/mentium-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mentium/apis/mentium-api/revisions/b4ed8e59432e?raw)
