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

# Update Workflow

> Replaces a workflow definition by creating a new version under the same workflow. The new version is DRAFT unless activate is true.



## OpenAPI

````yaml PUT /v1/workflows/{id}
openapi: 3.0.0
info:
  title: Conduit API
  version: 1.0.0
  description: Public API for Conduit.
servers:
  - url: https://api.conduit.ai
    description: Production
security: []
tags:
  - name: meta
    description: Discovery and API metadata endpoints.
  - name: agents
    description: >-
      V2 chat agent configuration, including instructions, skills, triggers, and
      automation behavior.
  - name: contacts
    description: >-
      Contact profile and contact-scoped related resources such as tickets and
      calls.
  - name: workspaces
    description: Workspaces accessible to the current API token.
  - name: escalations
    description: >-
      Chat escalations that require operator review, including message, proposed
      response, and disposition context when available.
  - name: conversations
    description: >-
      Canonical message threads. Use these endpoints to list threads, inspect
      conversation state, read transcripts, and send replies.
  - name: conversation-tags
    description: >-
      Conversation labels, root topics, and subtopics used for classification
      and topic analytics.
  - name: tickets
    description: >-
      Operational queue items tied to conversations, including ticket-scoped
      transcripts and replies.
  - name: calls
    description: Phone call records, transcripts, summaries, and recordings when available.
  - name: reservations
    description: >-
      PMS reservations synced from the workspace's integrations (Hostaway,
      Guesty, Airbnb, etc.), including guest identity, payment status, and stay
      dates.
  - name: appointments
    description: >-
      Scheduled appointments (bookings) backed by the Conduit booking service.
      Exposes allocation context and the upstream booking-service `external_id`.
  - name: helpdesk_tickets
    description: >-
      Helpdesk tickets mirrored from external helpdesk integrations (Zendesk,
      Pylon, Plain), including requester identity and upstream metadata.
  - name: kb
    description: >-
      Knowledge base search and node management. Nodes represent knowledge base
      entries (files or directories), chunks are the indexed retrieval units
      used by search.
  - name: skills
    description: >-
      Workspace agent skills that can be attached to V2 chat agents.
      Sidebar/global-assistant skills are intentionally excluded.
  - name: custom_tools
    description: >-
      Custom code tools: user-authored Python/JavaScript functions executed in a
      sandbox when an agent calls them. Includes a runtimes endpoint describing
      the entrypoint signature, return shape, and available dependencies per
      language.
  - name: inbox_types
    description: >-
      Workspace inbox types. Each id is stable and usable as a message trigger's
      `inboxTypeId` and as the `inbox_type_id` filter on list conversations.
  - name: workflows
    description: >-
      Workspace automation workflows: definitions, executions, and per-execution
      event timelines.
  - name: insights
    description: Aggregated workspace analytics, such as conversation automation rate.
paths:
  /v1/workflows/{id}:
    put:
      tags:
        - workflows
      summary: Update workflow
      description: >-
        Replaces a workflow definition by creating a new version under the same
        workflow (the old version is untouched). New version is DRAFT unless
        `activate` is true. Config fields whose value is the redaction
        placeholder are preserved from the current version.
      operationId: updateWorkflow
      parameters:
        - schema:
            type: string
            description: Workflow (version) identifier.
            example: k17demo8f8x7c9v0n2q4r6t8y1u3i5o
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_id:
                  type: string
                  description: >-
                    Optional workspace override. Omit to resolve the workflow's
                    workspace automatically.
                name:
                  type: string
                  minLength: 1
                  description: Workflow name
                description:
                  type: string
                  nullable: true
                color:
                  type: string
                  description: 'Hex color for the workflow, e.g. #2563eb'
                trigger:
                  type: object
                  nullable: true
                  properties:
                    type:
                      type: string
                      description: Trigger type. See get_workflow_schema.
                    config:
                      type: object
                      additionalProperties:
                        nullable: true
                      description: Trigger configuration for this trigger type.
                  required:
                    - type
                    - config
                  description: The workflow trigger, or null for a trigger-less workflow.
                first_step_id:
                  type: string
                  nullable: true
                  description: Id of the entry step, or null.
                steps:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        description: >-
                          Caller-assigned step id. `next_step_id` and branch
                          pointers reference these ids; server rewrites them to
                          stored ids.
                      type:
                        type: string
                        description: Step type. See get_workflow_schema for the set.
                      description:
                        type: string
                        nullable: true
                      next_step_id:
                        type: string
                        nullable: true
                        description: Id of the next step in the chain, or null for a leaf.
                      position:
                        type: object
                        nullable: true
                        properties:
                          x:
                            type: number
                          'y':
                            type: number
                        required:
                          - x
                          - 'y'
                        description: Optional editor canvas position.
                      config:
                        type: object
                        additionalProperties:
                          nullable: true
                        description: >-
                          Step configuration for this step type (the `config`
                          object get_workflow returns). Call get_workflow_schema
                          for the per-type shape.
                    required:
                      - id
                      - type
                      - config
                  description: The step graph.
                activate:
                  type: boolean
                  description: >-
                    When true, the version goes live (status ACTIVE). Defaults
                    to false (DRAFT).
              required:
                - name
                - steps
              description: >-
                Replace a workflow definition by creating a new version under
                the same workflow. New version is DRAFT unless activate is true.
      responses:
        '200':
          description: Updated workflow definition (new version)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      workflow_id:
                        type: string
                      master_id:
                        type: string
                        nullable: true
                      name:
                        type: string
                      enabled:
                        type: boolean
                      status:
                        type: string
                      version:
                        type: number
                      is_latest:
                        type: boolean
                      color:
                        type: string
                      trigger_summary:
                        type: string
                        nullable: true
                      created_at:
                        type: string
                      updated_at:
                        type: string
                      description:
                        type: string
                        nullable: true
                      trigger:
                        type: object
                        nullable: true
                        properties:
                          type:
                            type: string
                          config:
                            type: object
                            additionalProperties:
                              nullable: true
                        required:
                          - type
                          - config
                      first_step_id:
                        type: string
                        nullable: true
                      steps:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            type:
                              type: string
                            description:
                              type: string
                              nullable: true
                            position:
                              type: object
                              nullable: true
                              properties:
                                x:
                                  type: number
                                'y':
                                  type: number
                              required:
                                - x
                                - 'y'
                            next_step_id:
                              type: string
                              nullable: true
                            config:
                              type: object
                              additionalProperties:
                                nullable: true
                              description: >-
                                Step configuration as stored by the Workflows
                                editor, with any embedded credential material
                                (e.g. HTTP auth header values) redacted.
                          required:
                            - id
                            - type
                            - description
                            - position
                            - next_step_id
                            - config
                      edges:
                        type: array
                        items:
                          type: object
                          properties:
                            from:
                              type: string
                            to:
                              type: string
                            kind:
                              type: string
                              enum:
                                - next
                                - condition_true
                                - condition_false
                                - filter
                                - branch_true
                                - branch_false
                          required:
                            - from
                            - to
                            - kind
                    required:
                      - workflow_id
                      - master_id
                      - name
                      - enabled
                      - status
                      - version
                      - is_latest
                      - color
                      - trigger_summary
                      - created_at
                      - updated_at
                      - description
                      - trigger
                      - first_step_id
                      - steps
                      - edges
                required:
                  - data
                description: >-
                  Full workflow definition: metadata, trigger, and the step
                  graph (steps + derived edges) as the Workflows editor stores
                  it. Embedded secrets are redacted.
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Token
      description: >-
        Conduit API token. Use `Authorization: Bearer <token>`. Read/write
        endpoints require a token with write access.

````