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

# Generate Workflow

> Generate workflow Python code from a natural language description.

Uses the configured LLM (Anthropic Claude) to produce a runnable
workflow. Returns the generated code for review; does not save automatically.
Requires ANTHROPIC_API_KEY to be configured.



## OpenAPI

````yaml POST /v1/workflows/generate
openapi: 3.1.0
info:
  title: Calseta
  description: SOC data platform for security agent consumption
  version: dev
servers: []
security: []
paths:
  /v1/workflows/generate:
    post:
      tags:
        - workflows
      summary: Generate Workflow
      description: >-
        Generate workflow Python code from a natural language description.


        Uses the configured LLM (Anthropic Claude) to produce a runnable

        workflow. Returns the generated code for review; does not save
        automatically.

        Requires ANTHROPIC_API_KEY to be configured.
      operationId: generate_workflow_v1_workflows_generate_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowGenerateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataResponse_WorkflowGenerateResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WorkflowGenerateRequest:
      properties:
        description:
          type: string
          title: Description
        workflow_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Type
        indicator_types:
          items:
            type: string
          type: array
          title: Indicator Types
          default: []
      type: object
      required:
        - description
      title: WorkflowGenerateRequest
      description: Request body for POST /v1/workflows/generate.
    DataResponse_WorkflowGenerateResponse_:
      properties:
        data:
          $ref: '#/components/schemas/WorkflowGenerateResponse'
        meta:
          additionalProperties: true
          type: object
          title: Meta
      type: object
      required:
        - data
      title: DataResponse[WorkflowGenerateResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    WorkflowGenerateResponse:
      properties:
        generated_code:
          type: string
          title: Generated Code
        suggested_name:
          type: string
          title: Suggested Name
        suggested_documentation:
          type: string
          title: Suggested Documentation
        warnings:
          items:
            type: string
          type: array
          title: Warnings
          default: []
      type: object
      required:
        - generated_code
        - suggested_name
        - suggested_documentation
      title: WorkflowGenerateResponse
      description: Response for POST /v1/workflows/generate.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````