Validate a workflow definition without saving

Check whether a workflow definition passes validation before you save or publish it. This is useful when you want to test a definition for errors or warnings without creating a new version.

Before you begin

  • You have a workflow definition to validate.
  • You have a valid API authorization token.

About this task

To validate from the UI instead, use the Verify workflow action in the workflow builder options menu ().

Procedure

  1. Send a POST request to the validation endpoint:
    $ curl -X POST \
        "${AO_URL}/api/v1/workflows/validate" \
        -H "Authorization: Bearer ${TOKEN}" \
        -H "Content-Type: application/json" \
        -d '{
          "workflow_definition": {
            "schema_version": "2.0.0",
            "name": "my-workflow",
            "triggers": [],
            "nodes": [],
            "edges": []
          }
        }'
  2. Review the response.

    A valid definition returns 200 OK with is_valid: true and an empty findings list. If the definition contains errors, the response returns 422 Unprocessable Content with each finding including a severity level, category, message, and the affected node identifier.

Results

  • A valid definition returns 200 OK with is_valid: true.
  • A definition with errors returns 422 Unprocessable Content with structured findings that include severity, category, and the affected node.