> ## Documentation Index
> Fetch the complete documentation index at: https://altostrat.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate a workflow definition

> Validates a workflow graph before you create or update it. Use this to catch missing triggers, invalid node configuration, and graph errors.



## OpenAPI

````yaml /api/en/workflows.yaml post /workflows/validate
openapi: 3.0.3
info:
  title: Altostrat Workflows API
  version: 1.0.0
  description: >-
    Create, validate, execute, and monitor SDX workflows through the public
    `/workflows` gateway path. The reference intentionally omits internal
    dashboard-builder and local development endpoints.
servers:
  - url: https://v1.api.altostrat.io
    description: Altostrat SDX Production API
security: []
tags:
  - name: Workflows
    description: Manage workflow definitions, the core automation blueprints.
  - name: Workflow Runs
    description: Execute, monitor, and manage individual workflow executions.
  - name: Vault
    description: Securely store and manage secrets used by your workflows.
  - name: Webhooks
    description: Endpoints for triggering workflows from external systems.
  - name: Utilities
    description: Helper endpoints for building and debugging workflows.
  - name: Workflow Logs
    description: Inspect workflow execution logs and aggregate log statistics.
  - name: Authorizations
    description: Manage delegated account authorization for workflow runs.
paths:
  /workflows/validate:
    post:
      tags:
        - Workflows
      summary: Validate a workflow definition
      description: >-
        Validates a workflow graph before you create or update it. Use this to
        catch missing triggers, invalid node configuration, and graph errors.
      operationId: validateWorkflowDefinition
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkflowRequest'
      responses:
        '200':
          description: The workflow definition is valid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                    example: true
                  errors:
                    type: array
                    items:
                      type: string
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateWorkflowRequest:
      type: object
      required:
        - name
        - authorization_id
        - nodes
        - edges
      properties:
        name:
          type: string
          description: The name for the new workflow.
          example: Daily Network Health Check
        description:
          type: string
          nullable: true
          description: An optional description for the workflow.
        is_active:
          type: boolean
          default: true
          description: Set to `false` to create the workflow in an inactive state.
        authorization_id:
          type: string
          description: >-
            The prefixed ID of the Authorization (`auth_...`) to use for this
            workflow's executions.
          example: auth_01H...
        schedule_type:
          type: string
          enum:
            - manual
            - interval
            - cron
            - daily
            - weekly
            - monthly
          default: manual
        schedule_value:
          type: string
          nullable: true
          description: Required if `schedule_type` is `interval` or `cron`.
          example: 0 4 * * *
        nodes:
          type: array
          minItems: 1
          description: The array of nodes defining the workflow logic.
          items:
            $ref: '#/components/schemas/WorkflowNode'
        edges:
          type: array
          description: The array of edges connecting the workflow nodes.
          items:
            $ref: '#/components/schemas/WorkflowEdge'
    WorkflowNode:
      type: object
      required:
        - id
        - type
        - data
        - position
      properties:
        id:
          type: string
          description: >-
            A unique identifier for the node within the workflow (e.g., 'n1',
            'trigger').
          example: n1
        type:
          type: string
          description: The UI identifier for the node type.
          example: manual_trigger
        position:
          type: object
          properties:
            x:
              type: number
            'y':
              type: number
          example:
            x: 150
            'y': 250
        data:
          type: object
          required:
            - componentId
          properties:
            componentId:
              type: string
              description: The backend identifier for the node's logic.
              example: manual_trigger
          additionalProperties: true
          description: >-
            A flexible object containing the specific configuration for this
            node type.
    WorkflowEdge:
      type: object
      required:
        - id
        - source
        - target
      properties:
        id:
          type: string
          description: A unique identifier for the edge.
          example: e1-2
        source:
          type: string
          description: The ID of the source node.
          example: n1
        target:
          type: string
          description: The ID of the target node.
          example: n2
        sourceHandle:
          type: string
          nullable: true
          description: >-
            The specific output handle on the source node this edge connects
            from (e.g., 'true', 'false' for conditions).
          example: 'true'
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          description: A broad category for the error (e.g., 'invalid_request_error').
          example: invalid_request_error
        code:
          type: string
          description: A short, unique string identifying the specific error.
          example: parameter_missing
        message:
          type: string
          description: A human-readable description of what went wrong.
          example: The 'name' parameter is required for this request.
        doc_url:
          type: string
          description: >-
            A direct link to the documentation page for this specific error
            code.
          example: https://docs.altostrat.io/errors/parameter_missing
  responses:
    UnprocessableEntity:
      description: >-
        Unprocessable Entity - The request was well-formed but could not be
        processed due to semantic errors (e.g., validation failure).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Standard JWT for user sessions obtained via Altostrat authentication.

````