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

# Lock Workflow

> Locks a workflow so collaborators cannot edit it, or unlocks it. Only the owner can lock or unlock. While a workflow is locked, a shared editor's save, publish, or deploy is refused with 423; the owner can still edit, publish, and deploy.

Send `{"is_locked": true}` to lock the workflow and `{"is_locked": false}` to unlock it. Workflow responses carry `is_locked`, and a normal save never changes it.


## OpenAPI

````yaml openapi/superflow.yaml PATCH /workflows/{id}/lock
openapi: 3.0.3
info:
  title: Lyzr SuperFlow API
  version: '1.0'
  description: >-
    SuperFlow orchestration API covering workflow CRUD, versions and deployment,
    validation, the node catalog, the execution lifecycle (run, pause, resume,
    terminate, rerun), scheduling, and human-in-the-loop approvals. Agent CRUD
    and agent inference are served by the platform API 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, validate, lock, and share workflow
      definitions.
  - name: workflow-versions
    description: Save the draft as a version and choose which version production runs.
  - name: node-catalog
    description: The contract for every node type, used to build and validate workflows.
  - 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/{id}/lock:
    patch:
      tags:
        - workflows
      summary: Lock or unlock a workflow
      description: >-
        Locks a workflow so collaborators cannot edit it, or unlocks it. Only
        the owner can lock or unlock. While a workflow is locked, a shared
        editor's save, publish, or deploy is refused with 423; the owner can
        still edit, publish, and deploy.
      operationId: lockWorkflow
      parameters:
        - name: id
          in: path
          required: true
          description: Workflow ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LockRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LockResponse'
        '403':
          description: Forbidden. Only the owner can lock or unlock a workflow.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    LockRequest:
      type: object
      required:
        - is_locked
      properties:
        is_locked:
          type: boolean
    LockResponse:
      type: object
      properties:
        message:
          type: string
          example: workflow lock updated
        is_locked:
          type: boolean
          example: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Lyzr API key. Studio session keys (agk_, ags_) and durable sk- keys are
        accepted. Required on every endpoint except GET /node-types and a
        webhook-triggered execute that carries X-Webhook-Secret.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.