> ## 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 Workflow

> Stores a workflow definition. The caller becomes the owner, and a private sharing group is registered upstream so the resource is visible to the RBAC layer. Only flow_name and flow_data are required from the caller.

Only `flow_name` and `flow_data` are required in the request body. The full structure of the `flow_data` document, including connections and expression syntax, is described in the [flow\_data reference](/enterprise/api/superflow/flow-data), and every node type is documented in the [node types reference](/enterprise/api/superflow/node-types).


## OpenAPI

````yaml openapi/superflow.yaml POST /workflows
openapi: 3.0.3
info:
  title: Lyzr SuperFlow API
  version: '1.0'
  description: >-
    SuperFlow orchestration API covering workflow CRUD, the execution lifecycle
    (run, pause, resume, terminate, rerun), scheduling, and human-in-the-loop
    approvals. Chat-completions and agent CRUD endpoints are documented
    separately and are not part of this surface.
servers:
  - url: https://inference.studio.lyzr.ai/api
security:
  - ApiKeyAuth: []
tags:
  - name: workflows
    description: Create, read, update, delete, and share workflow definitions.
  - name: workflow-execution
    description: Run workflows and control the execution lifecycle.
  - name: workflow-schedules
    description: Cron-driven recurring triggers for stored workflows.
  - name: approvals
    description: Human-in-the-loop approval requests raised by running workflows.
paths:
  /workflows:
    post:
      tags:
        - workflows
      summary: Create a workflow
      description: >-
        Stores a workflow definition. The caller becomes the owner, and a
        private sharing group is registered upstream so the resource is visible
        to the RBAC layer. Only flow_name and flow_data are required from the
        caller.
      operationId: createWorkflow
      requestBody:
        required: true
        description: Workflow definition. Only flow_name and flow_data are required.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Workflow'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWorkflowResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    Workflow:
      type: object
      properties:
        flow_id:
          type: string
        flow_name:
          type: string
          example: Document Processing Flow
        flow_data:
          type: object
          description: >-
            Workflow graph definition as JSON (nodes, connections, and node
            configuration). See the flow_data reference for the full structure
            and the node types reference for every node type.
          example:
            name: Minimal Example
            nodes:
              - id: a1b2c3d4-0000-0000-0000-000000000001
                name: Trigger
                type: lyzr-nodes-base.trigger
                typeVersion: 1
                parameters: {}
                position:
                  - 240
                  - 300
              - id: a1b2c3d4-0000-0000-0000-000000000002
                name: Set
                type: lyzr-nodes-base.set
                typeVersion: 3.4
                parameters:
                  assignments:
                    assignments:
                      - id: f1
                        name: greeting
                        type: string
                        value: '=Hello {{ $json.name }}'
                position:
                  - 480
                  - 300
            connections:
              Trigger:
                main:
                  - - node: Set
                      type: main
                      index: 0
            settings: {}
        version:
          type: integer
        is_owner:
          type: boolean
          description: >-
            Computed per response so the UI can distinguish owned rows from
            shared rows without seeing the owner's key. Not persisted.
        user_id:
          type: string
        org_id:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
    CreateWorkflowResponse:
      type: object
      properties:
        flow_id:
          type: string
          example: wf_9f2c1a
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Tenant API key. Required on every endpoint.

````