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

# Draft an automation from a description

> Turns plain English into a schema-validated draft through one constrained model call with no tools.

It pre-fills the form and creates nothing; any `hero:` reference it emits goes through the same resolution a hand-authored save does, so an invented id is rejected before the form is populated.



## OpenAPI

````yaml post /automation/draft
openapi: 3.1.0
info:
  title: HERO API
  version: current
  description: |-
    The HERO REST API.

    See https://developers.myhero.so for the rendered docs.
servers:
  - url: https://app.myhero.so
security: []
paths:
  /automation/draft:
    post:
      tags:
        - Automations
      summary: Draft an automation from a description
      description: >-
        Turns plain English into a schema-validated draft through one
        constrained model call with no tools.


        It pre-fills the form and creates nothing; any `hero:` reference it
        emits goes through the same resolution a hand-authored save does, so an
        invented id is rejected before the form is populated.
      operationId: composeAutomationDraft
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 4000
                projectId:
                  type: string
                  minLength: 1
                workspaceId:
                  type: string
                  minLength: 1
              required:
                - prompt
                - projectId
                - workspaceId
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      name:
                        type: string
                      triggers:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - schedule
                                - event
                                - manual
                                - api
                                - webhook
                                - button
                                - connector
                            mode:
                              type: string
                              enum:
                                - recurring
                                - once
                            cron:
                              type: string
                            timezone:
                              type: string
                            runAt:
                              type: number
                            event:
                              type: string
                              enum:
                                - row.created
                                - row.updated
                                - row.deleted
                                - cell.changed
                                - row.enteredView
                                - row.leftView
                                - clause.added
                                - clause.edited
                                - clause.deleted
                                - term.defined
                                - term.removed
                                - signature.signed
                                - document.fullySigned
                                - document.signaturesVoided
                                - document.created
                                - document.updated
                                - document.moved
                                - document.published
                                - document.duplicated
                                - document.deleted
                                - document.renamed
                                - document.newVersion
                                - document.restoreVersion
                                - workspace.memberJoined
                                - workspace.memberLeft
                                - document.collaboratorAdded
                                - document.collaboratorRemoved
                                - table.created
                                - table.deleted
                                - column.added
                                - column.deleted
                                - project.created
                            projectId:
                              type: string
                            filter:
                              type: object
                              properties:
                                tableId:
                                  type: string
                                columnId:
                                  type: string
                                documentId:
                                  type: string
                                documentIds:
                                  type: array
                                  items:
                                    type: string
                            askForData:
                              type: boolean
                            dataPrompt:
                              type: string
                              maxLength: 2000
                            provider:
                              type: string
                              enum:
                                - gmail
                                - outlook
                            query:
                              type: string
                          required:
                            - type
                      conditions:
                        type: object
                        properties:
                          kind:
                            type: string
                            enum:
                              - rowFilter
                              - fields
                              - value
                          group:
                            type: object
                            additionalProperties: {}
                          conjunction:
                            type: string
                            enum:
                              - and
                              - or
                          predicates:
                            type: array
                            items:
                              type: object
                              additionalProperties: {}
                        required:
                          - kind
                      actions:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              minLength: 1
                            condition:
                              type: object
                              properties:
                                kind:
                                  type: string
                                  enum:
                                    - rowFilter
                                    - fields
                                    - value
                                group:
                                  type: object
                                  additionalProperties: {}
                                conjunction:
                                  type: string
                                  enum:
                                    - and
                                    - or
                                predicates:
                                  type: array
                                  items:
                                    type: object
                                    additionalProperties: {}
                              required:
                                - kind
                            continueOnError:
                              type: boolean
                            spec:
                              type: object
                              properties:
                                kind:
                                  type: string
                                  minLength: 1
                              required:
                                - kind
                              additionalProperties: {}
                          required:
                            - id
                            - spec
                    required:
                      - name
                      - triggers
                      - actions
                required:
                  - data
        '400':
          description: 400 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '403':
          description: 403 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '422':
          description: 422 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '429':
          description: 429 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: HERO personal access token

````