# Check a workflow definition

Answers whether a workflow definition would run — `valid` plus a list of problems, each with a code and the step it is about. It CHANGES NOTHING and publishes nothing, so this is the safe way to ask "is this rule right". Body: `definition` as {trigger, steps}. It is the same code `post_workflows_id_publish` refuses on, and catches an unknown action or event, a duplicate or missing step id, a jump to nowhere, a backward jump, an expression or template that will not parse, a `{{steps.x}}` naming a step that runs later, and `wait` / `review` / `stop` / `each` nested inside an `each`.

Access class: `workspace`.

## Endpoint

`POST /v1/workflows/validate`

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "definition": "string"
  },
  "params": {},
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "problems": [
      {
        "code": "string",
        "field": "string",
        "message": "string"
      }
    ],
    "valid": true
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
