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

# Validate a workflow definition

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Checks a workflow definition and tells you what is wrong with it, without saving anything.

Call this before [Create workflow](/api-reference/create-workflow) or [Update workflow](/api-reference/update-workflow) to catch problems while you still have the definition in hand. An invalid definition comes back as a 200 with `valid` set to `false` and the problems in `errors`, not as an error status, so branch on `valid` rather than on the status code.

The response also lists the task types and activities this app can use, which is the set a valid definition has to stay inside.

This endpoint is limited to 30 requests per minute.



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/workflows/validate-definition
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - ApiKeyAuth: []
paths:
  /api/apps/{app_id}/workflows/validate-definition:
    post:
      summary: Validate a workflow definition
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Checks a workflow definition and tells you what is wrong with it,
        without saving anything.


        Call this before [Create workflow](/api-reference/create-workflow) or
        [Update workflow](/api-reference/update-workflow) to catch problems
        while you still have the definition in hand. An invalid definition comes
        back as a 200 with `valid` set to `false` and the problems in `errors`,
        not as an error status, so branch on `valid` rather than on the status
        code.


        The response also lists the task types and activities this app can use,
        which is the set a valid definition has to stay inside.


        This endpoint is limited to 30 requests per minute.
      operationId: validate_definition_api_apps__app_id__workflows_validate_definition_post
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app whose workflows you want to work with.
            title: App Id
          description: ID of the app whose workflows you want to work with.
          example: 6820f3a4e7b91d003c45a1f2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateDefinitionRequest'
      responses:
        '200':
          description: The verdict. Check `valid`, not the status code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationResponse'
        '401':
          description: Missing or invalid credentials.
        '402':
          description: >-
            This workspace's plan does not include workflows. Upgrade to Builder
            or above.
        '403':
          description: >-
            You don't have access to this app, the app does not exist, the app
            still runs the older automations engine instead of workflows, or you
            used a workspace API key. A missing app and an app you cannot reach
            are deliberately the same answer.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ValidateDefinitionRequest:
      properties:
        definition:
          additionalProperties: true
          type: object
          title: Definition
          description: The CNCF Serverless Workflow v1.0 document to check.
          example:
            do: []
            document:
              dsl: 1.0.0
              name: notify
              version: 1.0.0
      type: object
      required:
        - definition
      title: ValidateDefinitionRequest
    ValidationResponse:
      properties:
        valid:
          type: boolean
          title: Valid
          description: Whether the definition can be saved as-is.
          example: true
        errors:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Errors
          description: >-
            What is wrong with the definition, one entry per problem. Empty when
            `valid` is `true`.
          example:
            - code: UNKNOWN_TASK_TYPE
              message: Task 'notify' has no known type
              path: do[0]
        supported_task_types:
          items:
            type: string
          type: array
          title: Supported Task Types
          description: Task types a definition may use.
          example:
            - call
            - set
            - switch
            - for
        available_activities:
          items:
            type: string
          type: array
          title: Available Activities
          description: Activities this app can call from a task.
          example:
            - send_email
            - create_entity_record
      type: object
      required:
        - valid
      title: ValidationResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: Personal API key.

````