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

# Validate workflow head

> Validate the editable head without changing it: the checks publish and run apply, as blocking errors and advisory warnings; the environment's capability rule; and what only the head's files show: a Python file nothing can run, a scripted node whose script is not in its directory, a script whose entry function takes no args while the node declares inputs, a script that hands off to a node that is not one of its transitions.



## OpenAPI

````yaml https://odyssey.asteroid.ai/agents/v2/openapi.yaml post /agents/v2/workflows/{workflowId}/head/validate
openapi: 3.1.0
info:
  title: Agent Service
  version: v1
servers:
  - url: https://odyssey.asteroid.ai
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
  - name: Environments
  - name: Schedules
  - name: Execution
  - name: Files
  - name: Profiles
  - name: Profile Groups
  - name: Agent Profiles
  - name: Agent Profile Pools
  - name: Workflows
  - name: Execution Batches
  - name: Scheduled Executions
  - name: Schema
  - name: Documentation
  - name: Context
  - name: API Keys
  - name: Integrations
  - name: Admin Customer Activity
  - name: Reference
  - name: Workflow Tags
  - name: Secrets
  - name: Vault
  - name: Chats
  - name: Insights
  - name: Portal Skills
  - name: Skills
  - name: Workflow Versions
paths:
  /agents/v2/workflows/{workflowId}/head/validate:
    post:
      tags:
        - Files
      summary: Validate workflow head
      description: >-
        Validate the editable head without changing it: the checks publish and
        run apply, as blocking errors and advisory warnings; the environment's
        capability rule; and what only the head's files show: a Python file
        nothing can run, a scripted node whose script is not in its directory, a
        script whose entry function takes no args while the node declares
        inputs, a script that hands off to a node that is not one of its
        transitions.
      operationId: WorkflowHead_validate
      parameters:
        - in: path
          name: workflowId
          required: true
          schema:
            $ref: '#/components/schemas/Common.uuid'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflows.Version.ValidationResponse'
          description: The request has succeeded.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.BadRequestErrorBody'
          description: The server could not understand the request due to invalid syntax.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.UnauthorizedErrorBody'
          description: Access is unauthorized.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.ForbiddenErrorBody'
          description: Access is forbidden.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.NotFoundErrorBody'
          description: The server cannot find the requested resource.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.InternalServerErrorBody'
          description: Server error
components:
  schemas:
    Common.uuid:
      format: uuid
      type: string
    Workflows.Version.ValidationResponse:
      description: Result of validating a workflow version spec without persisting it
      properties:
        issues:
          description: >-
            All validation issues found. The workflow can run only if none have
            error severity.
          items:
            $ref: '#/components/schemas/Agents.Workflow.WorkflowValidationIssue'
          type: array
      required:
        - issues
      type: object
    Common.BadRequestErrorBody:
      properties:
        code:
          enum:
            - 400
          type: number
          x-enum-varnames:
            - BadRequest
        detail:
          description: Explanation of this occurrence. Same text as message
          type: string
        errors:
          description: The parameters that failed validation, when known
          items:
            $ref: '#/components/schemas/Common.FieldError'
          type: array
        instance:
          description: The request path that produced the problem
          type: string
        message:
          type: string
        status:
          format: int32
          type: integer
        title:
          description: Short summary of the problem type
          type: string
        type:
          description: >-
            A URI that identifies the problem type. about:blank when the status
            says it all
          type: string
      required:
        - code
        - message
      type: object
    Common.UnauthorizedErrorBody:
      properties:
        code:
          enum:
            - 401
          type: number
          x-enum-varnames:
            - Unauthorized
        detail:
          description: Explanation of this occurrence. Same text as message
          type: string
        instance:
          description: The request path that produced the problem
          type: string
        message:
          type: string
        status:
          format: int32
          type: integer
        title:
          description: Short summary of the problem type
          type: string
        type:
          description: >-
            A URI that identifies the problem type. about:blank when the status
            says it all
          type: string
      required:
        - code
        - message
      type: object
    Common.ForbiddenErrorBody:
      properties:
        capability:
          description: The missing capability key, when reason is capability_required
          type: string
        code:
          enum:
            - 403
          type: number
          x-enum-varnames:
            - Forbidden
        detail:
          description: Explanation of this occurrence. Same text as message
          type: string
        instance:
          description: The request path that produced the problem
          type: string
        message:
          type: string
        reason:
          allOf:
            - $ref: '#/components/schemas/Common.ForbiddenReason'
          description: Why the request was refused, when the client can act on it
        status:
          format: int32
          type: integer
        title:
          description: Short summary of the problem type
          type: string
        type:
          description: >-
            A URI that identifies the problem type. about:blank when the status
            says it all
          type: string
      required:
        - code
        - message
      type: object
    Common.NotFoundErrorBody:
      properties:
        code:
          enum:
            - 404
          type: number
          x-enum-varnames:
            - NotFound
        detail:
          description: Explanation of this occurrence. Same text as message
          type: string
        instance:
          description: The request path that produced the problem
          type: string
        message:
          type: string
        status:
          format: int32
          type: integer
        title:
          description: Short summary of the problem type
          type: string
        type:
          description: >-
            A URI that identifies the problem type. about:blank when the status
            says it all
          type: string
      required:
        - code
        - message
      type: object
    Common.InternalServerErrorBody:
      properties:
        code:
          enum:
            - 500
          type: number
          x-enum-varnames:
            - InternalServerError
        detail:
          description: Explanation of this occurrence. Same text as message
          type: string
        instance:
          description: The request path that produced the problem
          type: string
        message:
          type: string
        status:
          format: int32
          type: integer
        title:
          description: Short summary of the problem type
          type: string
        type:
          description: >-
            A URI that identifies the problem type. about:blank when the status
            says it all
          type: string
      required:
        - code
        - message
      type: object
    Agents.Workflow.WorkflowValidationIssue:
      description: A single workflow validation finding.
      properties:
        message:
          type: string
        path:
          description: Path to the offending field, e.g. ["nodes", "My Node", "model"].
          items:
            type: string
          type: array
        severity:
          allOf:
            - $ref: '#/components/schemas/Agents.Workflow.WorkflowValidationSeverity'
          description: >-
            Whether this issue blocks running the workflow (error) or is
            advisory (warning).
      required:
        - severity
        - message
        - path
      type: object
    Common.FieldError:
      description: A problem with one request parameter
      properties:
        detail:
          description: What is wrong with it
          type: string
        parameter:
          description: The query or path parameter name
          type: string
      required:
        - parameter
        - detail
      type: object
    Common.ForbiddenReason:
      enum:
        - capability_required
      type: string
    Agents.Workflow.WorkflowValidationSeverity:
      description: >-
        Severity of a workflow validation issue. Error-severity issues make the
        workflow un-runnable; warnings are advisory.
      enum:
        - error
        - warning
      type: string
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: X-Api-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.