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

# Create Workflows



## OpenAPI

````yaml post /v3/workflows/
openapi: 3.0.0
info:
  title: Lyzr API - Create Workflow
  version: v3
  description: Create a new workflow with defined agents and execution flow.
servers:
  - url: https://agent-prod.studio.lyzr.ai
security:
  - ApiKeyAuth: []
paths:
  /v3/workflows/:
    post:
      summary: Create Workflow Endpoint
      description: >-
        Create a new workflow with a set of agents, dependencies, and default
        input configuration.
      operationId: createWorkflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - flow_name
                - flow_data
                - api_key
              properties:
                flow_name:
                  type: string
                  example: Document Processing Flow
                flow_data:
                  type: object
                  example:
                    tasks:
                      - name: agent_1pli
                        tag: Lyzr Agent
                        function: call_lyzr_agent
                        params:
                          config:
                            user_id: a78576a2-4c17-4021-9bf6-fc96280115c9
                            session_id: e70d7d0a-1111-4222-aacc-123456789abc
                            api_key: ''
                          user_message:
                            value: Fetch all relevant documents for the user
                      - name: agent_f8gd
                        tag: Lyzr Agent
                        function: call_lyzr_agent
                        params:
                          config:
                            user_id: 8885f9bf-a8df-4848-af4f-9f79f4e7a07c
                            session_id: bbaaccee-1234-5678-abcd-87654321cdef
                            api_key: ''
                          agent_1pli:
                            depends: agent_1pli
                          user_message:
                            value: Generate the document plan based on user documents
                    default_inputs: {}
                    run_name: Document Plan Run
                    edges: []
                api_key:
                  type: string
                  example: sk-default-JDJARRky2GCw0vlk8ChKglquOkbHmYdK
      responses:
        '201':
          description: Workflow successfully created
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Workflow created successfully
                  workflow_id:
                    type: string
                    example: 123e4567-e89b-12d3-a456-426614174000
        '401':
          description: Unauthorized
        '422':
          description: Validation Error
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````