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

> Registers a recurring cron-driven trigger for a workflow. The caller's identity is pinned to the schedule and re-verified on every tick; losing execute access deactivates the schedule rather than running as a stale principal. Only one schedule can exist per workflow, so creating a new one cancels and deletes any prior schedule for the same workflow.



## OpenAPI

````yaml openapi/superflow.yaml POST /workflow-schedules
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:
  /workflow-schedules:
    post:
      tags:
        - workflow-schedules
      summary: Create a workflow schedule
      description: >-
        Registers a recurring cron-driven trigger for a workflow. The caller's
        identity is pinned to the schedule and re-verified on every tick; losing
        execute access deactivates the schedule rather than running as a stale
        principal. Only one schedule can exist per workflow, so creating a new
        one cancels and deletes any prior schedule for the same workflow.
      operationId: createSchedule
      requestBody:
        required: true
        description: Schedule definition
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateScheduleRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Schedule'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateScheduleRequest:
      type: object
      required:
        - cron_expression
        - workflow_id
      properties:
        workflow_id:
          type: string
        cron_expression:
          type: string
          example: 0 9 * * 1
        timezone:
          type: string
          example: Asia/Kolkata
        max_retries:
          type: integer
        retry_delay:
          type: integer
    Schedule:
      type: object
      properties:
        id:
          type: string
        workflow_id:
          type: string
        cron_expression:
          type: string
        timezone:
          type: string
        is_active:
          type: boolean
        max_retries:
          type: integer
        retry_delay:
          type: integer
        run_count:
          type: integer
        last_run_at:
          type: string
        next_run_time:
          type: string
        user_id:
          type: string
        org_id:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
    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.

````