> For the complete documentation index, see [llms.txt](https://docs.nected.ai/nected-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nected.ai/nected-docs/management-api/workflow/test-workflow.md).

# Test Workflow

Run a workflow in test mode without publishing. Use this to validate the full graph execution against input parameters before promoting to production.

### Checksum (required for a successful test)

The test endpoint requires the current **`checksum`** of the workflow. If the checksum you send does not match the latest checksum on the server, the API returns a checksum mismatch error and the test **does not** run.

**Recommended flow:**

1. Call **Get workflow by id** (`GET /dev/v1/workflow/{entity-id}`) for the workflow you want to test.
2. From the response, copy **`data.checksum`** (the exact string returned by the API).
3. Paste that value into your test request body as **`checksum`**, together with **`params`** (keys matching your trigger node's `input` field names) and optional **`version`** (e.g. `"draft"`).

## Test workflow

> Run a workflow in test mode without publishing. Validates full graph execution against given input parameters.\
> \
> \*\*\`checksum\` is required\*\* and must match the server's current checksum — if not, the test is rejected. Always get the latest checksum from \`GET /dev/v1/workflow/{entity-id}\` → \`data.checksum\` before testing.\
> \
> \*\*\`params\` keys\*\* must match the field names defined in the trigger node's \`data.input\` map. For the example workflow: \`orderId\` (string), \`cartTotal\` (numeric), \`customerTier\` (string).\
> \
> \*\*\`version\`\*\* defaults to \`draft\` if omitted.\
> \
> \*\*Response \`data\`\*\* contains per-node execution output (\`nodeOutputs\`), overall workflow \`output\`, \`status\`, and \`executionTime\`.\
> \
> \*\*Canonical response file:\*\* \`examples/test\_workflow\_200.json\`

```json
{"openapi":"3.0.3","info":{"title":"Nected Workflow API (Dev V1)","version":"1.0"},"tags":[{"name":"Workflow","description":"List, create, read, update, test, and publish workflows."}],"servers":[{"url":"https://api.nected.ai","description":"Production"}],"security":[{"DevAuth":[]}],"components":{"securitySchemes":{"DevAuth":{"type":"apiKey","in":"header","name":"Nected-API-Key","description":"Your Nected API key. Obtain from your workspace settings."}},"schemas":{"TestWorkflowRequest":{"type":"object","description":"Request body for the test endpoint","properties":{"checksum":{"type":"string","description":"Current checksum from Get workflow by id — must match server state"},"params":{"type":"object","additionalProperties":true,"description":"Input parameters for this test run. Keys must match the field names in the trigger node's `input` map.\nExample: `{ \"orderId\": \"ORD-001\", \"cartTotal\": 1250.00, \"customerTier\": \"gold\" }`"},"version":{"type":"string","description":"Version to test (defaults to `draft`)"}}},"Response":{"type":"object","description":"Standard API response wrapper","properties":{"code":{"type":"string"},"data":{"description":"Response payload — shape varies by endpoint"},"message":{"type":"string"},"pageNo":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"},"totalPages":{"type":"integer"},"paginationInfo":{"$ref":"#/components/schemas/PaginationInfo"}}},"PaginationInfo":{"type":"object","description":"Pagination metadata returned on list endpoints","properties":{"perPage":{"type":"integer","description":"Items per page"},"totalPage":{"type":"integer","description":"Total number of pages"},"currentPage":{"type":"integer","description":"Current page number (1-based)"},"totalRecord":{"type":"integer","description":"Total number of records across all pages"}}},"ErrorResponse":{"type":"object","description":"Error response wrapper","properties":{"code":{"type":"string"},"message":{"type":"string","description":"Human-readable error message"},"data":{"nullable":true}}}}},"paths":{"/dev/v1/workflow/{entity-id}/test":{"post":{"operationId":"testWorkflow","tags":["Workflow"],"summary":"Test workflow","description":"Run a workflow in test mode without publishing. Validates full graph execution against given input parameters.\n\n**`checksum` is required** and must match the server's current checksum — if not, the test is rejected. Always get the latest checksum from `GET /dev/v1/workflow/{entity-id}` → `data.checksum` before testing.\n\n**`params` keys** must match the field names defined in the trigger node's `data.input` map. For the example workflow: `orderId` (string), `cartTotal` (numeric), `customerTier` (string).\n\n**`version`** defaults to `draft` if omitted.\n\n**Response `data`** contains per-node execution output (`nodeOutputs`), overall workflow `output`, `status`, and `executionTime`.\n\n**Canonical response file:** `examples/test_workflow_200.json`","parameters":[{"name":"Nected-Branch","in":"header","required":false,"description":"Branch name (optional)","schema":{"type":"string"}},{"name":"entity-id","in":"path","required":true,"description":"The workflow entity ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestWorkflowRequest"}}}},"responses":{"200":{"description":"OK — test execution result with node outputs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}},"400":{"description":"Bad Request (e.g. checksum mismatch)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

### Request body

Example on **POST /dev/v1/workflow/{entity-id}/test** in openapi.yaml:

```json
{
  "checksum": "7f3d2a1b9c8e4f6a0d5b2c7e1a9f3d8c",
  "params": {
    "orderId": "ORD-20260101-9921",
    "cartTotal": 1250.00,
    "customerTier": "gold"
  },
  "version": "draft"
}
```

Replace `"checksum"` with the value from `GET /dev/v1/workflow/{entity-id}` → `data.checksum`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nected.ai/nected-docs/management-api/workflow/test-workflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
