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

# Update a workflow



## OpenAPI

````yaml put /api/workflows/{agent_name}/{workflow_id}
openapi: 3.1.0
info:
  title: Apigene
  description: Apigene API
  version: 1.0.0
  contact:
    name: Apigene Support
    url: https://app.apigene.ai
    email: support@apigene.ai
servers:
  - url: https://app.apigene.ai
security:
  - BearerAuth: []
paths:
  /api/workflows/{agent_name}/{workflow_id}:
    put:
      tags:
        - Workflows
      summary: Update a workflow
      operationId: workflow_update
      parameters:
        - name: agent_name
          in: path
          required: true
          schema:
            type: string
            title: Agent Name
        - name: workflow_id
          in: path
          required: true
          schema:
            type: string
            title: Workflow Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    WorkflowUpdate:
      properties:
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Updated description
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Updated display name
        nodes:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Nodes
          description: Updated nodes
        connections:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Connections
          description: Updated connections
        inputs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Inputs
          description: Updated default inputs
      type: object
      title: WorkflowUpdate
    WorkflowResponse:
      properties:
        id:
          type: string
          title: Id
        agent_name:
          type: string
          title: Agent Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        nodes:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Nodes
        connections:
          additionalProperties: true
          type: object
          title: Connections
        inputs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Inputs
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
      type: object
      required:
        - id
        - agent_name
        - nodes
        - connections
      title: WorkflowResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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: >-
        JWT Authorization header using the Bearer scheme. Example:
        'Authorization: Bearer {token}'

````