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

# Update Workflow

> API key permission: Agents (Admin also opens it).



## OpenAPI

````yaml /api-reference/openapi.json put /workflows/{workflow_id}
openapi: 3.1.0
info:
  title: Neural Factory API
  version: 0.1.0
  description: >-
    The endpoints a program can call with an API key. Exchange the key's secret
    for a token at POST /apikeys/token and send it as a Bearer token.
servers:
  - url: https://api.neuralfactory.ai
    description: SaaS
  - url: https://{apiHost}
    description: 'Enterprise: the API address of your own deployment'
    variables:
      apiHost:
        default: api.example.com
        description: Your deployment's API host
security:
  - bearerAuth: []
tags:
  - name: API keys
  - name: Chat
  - name: Runs
  - name: Agents
  - name: Workflows
  - name: Schedules
  - name: Knowledge bases
  - name: Documents
  - name: Search
  - name: Skills
  - name: Toolkits
  - name: Files
  - name: Interactions
  - name: Usage and billing
  - name: Catalogue
  - name: Browser
  - name: Users
  - name: Groups
  - name: Builds
paths:
  /workflows/{workflow_id}:
    put:
      tags:
        - Workflows
      summary: Update Workflow
      description: 'API key permission: Agents (Admin also opens it).'
      operationId: update_workflow_workflows__workflow_id__put
      parameters:
        - name: workflow_id
          in: path
          required: true
          schema:
            type: string
            title: Workflow Id
        - name: env
          in: query
          required: false
          schema:
            title: Env
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowEntry'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WorkflowUpdate:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        steps:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Steps
        input_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input Schema
        output_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Output Schema
        error_handling:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Error Handling
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        toolkits:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Toolkits
        visibility:
          anyOf:
            - type: string
            - type: 'null'
          title: Visibility
        allowed_groups:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Groups
        allowed_user_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed User Ids
        expected_revision:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expected Revision
        expected_edit_seq:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expected Edit Seq
      type: object
      title: WorkflowUpdate
    WorkflowEntry:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
          default: ''
        version:
          type: string
          title: Version
          default: 1.0.0
        status:
          type: string
          title: Status
          default: active
        step_count:
          type: integer
          title: Step Count
          default: 0
        steps:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Steps
        input_schema:
          additionalProperties: true
          type: object
          title: Input Schema
        output_schema:
          additionalProperties: true
          type: object
          title: Output Schema
        error_handling:
          additionalProperties: true
          type: object
          title: Error Handling
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        toolkits:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Toolkits
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
        created_by_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By Email
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
        visibility:
          type: string
          title: Visibility
          default: private
        allowed_groups:
          items:
            type: string
          type: array
          title: Allowed Groups
        allowed_user_ids:
          items:
            type: string
          type: array
          title: Allowed User Ids
        revision:
          type: integer
          title: Revision
          default: 1
        edit_seq:
          type: integer
          title: Edit Seq
          default: 0
        published_revision:
          anyOf:
            - type: integer
            - type: 'null'
          title: Published Revision
        from_use_case:
          anyOf:
            - $ref: '#/components/schemas/FromUseCase'
            - type: 'null'
        governance_warnings:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Governance Warnings
        last_run:
          anyOf:
            - $ref: '#/components/schemas/WorkflowLastRun'
            - type: 'null'
        run_count:
          type: integer
          title: Run Count
          default: 0
        pending_approvals:
          type: integer
          title: Pending Approvals
          default: 0
        last_run_execution_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Run Execution Id
        recent_statuses:
          items:
            type: string
          type: array
          title: Recent Statuses
        cost_30d:
          anyOf:
            - type: number
            - type: 'null'
          title: Cost 30D
        tags:
          items:
            type: string
          type: array
          title: Tags
        is_favourite:
          type: boolean
          title: Is Favourite
          default: false
      type: object
      required:
        - id
        - name
      title: WorkflowEntry
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FromUseCase:
      properties:
        id:
          type: string
          title: Id
        version:
          type: integer
          title: Version
      type: object
      required:
        - id
        - version
      title: FromUseCase
      description: >-
        The use case an agent or a workflow was activated from, and the artifact
        version copied.
    WorkflowLastRun:
      properties:
        status:
          type: string
          title: Status
        completed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Completed At
      type: object
      required:
        - status
      title: WorkflowLastRun
      description: Most recent execution summary shown on the workflows list (B1).
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        The access_token returned by POST /apikeys/token for an API key's
        secret.

````

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