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

# Update a workflow

> Updates editable fields on a Workflow scoped to the caller organization. Nodes, edges, viewport, name, description, and enabled flag are all replaceable. Renames must keep the name unique within the organization.



## OpenAPI

````yaml /api-reference/openapi.yaml put /api/workflows/{id}
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/workflows/{id}:
    put:
      tags:
        - Workflows
      summary: Update a workflow
      description: >-
        Updates editable fields on a Workflow scoped to the caller organization.
        Nodes, edges, viewport, name, description, and enabled flag are all
        replaceable. Renames must keep the name unique within the organization.
      operationId: put_workflows_by_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowUpdateRequest'
      responses:
        '200':
          description: Workflow updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowMutationResponse'
        '400':
          description: Duplicate name
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowsErrorResponse'
        '404':
          description: Workflow not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowsErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    WorkflowUpdateRequest:
      type: object
      description: >-
        Partial update — only the supplied fields are written; omitted fields
        are left untouched.
      properties:
        name:
          type: string
          description: >-
            New workflow name. Must remain unique within the caller
            organization.
        description:
          type: string
          description: Replacement free-text description. Send an empty string to clear.
        nodes:
          type: array
          description: >-
            Replacement node array — fully overwrites the current canvas nodes
            when supplied.
          items:
            type: object
            additionalProperties: true
        edges:
          type: array
          description: >-
            Replacement edge array — fully overwrites the current canvas edges
            when supplied.
          items:
            type: object
            additionalProperties: true
        viewport:
          type: object
          description: Replacement camera state (`x`, `y`, `zoom`) for the canvas.
          properties:
            x:
              type: number
              description: Horizontal pan offset of the canvas.
            'y':
              type: number
              description: Vertical pan offset of the canvas.
            zoom:
              type: number
              description: Canvas zoom factor (1 = 100%).
          additionalProperties: false
        enabled:
          type: boolean
          description: >-
            When false, the trigger system skips this workflow even when
            conditions match.
      additionalProperties: true
      example:
        name: New Lead Welcome (v2)
        description: Greet new leads, assign an agent, and create a follow-up task.
        enabled: true
    WorkflowMutationResponse:
      type: object
      description: >-
        Returned by create/update/toggle. Wraps the resulting `WorkflowDocument`
        plus a status message.
      properties:
        success:
          type: boolean
          enum:
            - true
        message:
          type: string
        data:
          $ref: '#/components/schemas/WorkflowDocument'
      required:
        - success
        - message
        - data
      additionalProperties: true
      example:
        success: true
        message: Workflow created successfully
        data:
          _id: 64d2f9c5e8a1d4e001a0b1c2
          name: New Lead Welcome
          description: Greet new leads and assign them to a leasing agent.
          organizationId: 64a1b2c3d4e5f60012345678
          userId: 64a1b2c3d4e5f60012345679
          nodes: []
          edges: []
          viewport:
            x: 0
            'y': 0
            zoom: 1
          enabled: false
          createdAt: '2026-04-12T14:22:10.000Z'
          updatedAt: '2026-04-12T14:22:10.000Z'
    WorkflowsErrorResponse:
      type: object
      description: Standard error envelope for Workflows endpoints.
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
      required:
        - success
      additionalProperties: true
      example:
        success: false
        message: Workflow not found
    WorkflowDocument:
      type: object
      description: >-
        A `Workflow` document — visual builder canvas (nodes + edges) plus
        enabled flag and metadata.
      properties:
        _id:
          type: string
        name:
          type: string
        description:
          type: string
        organizationId:
          type: string
        userId:
          type: string
        nodes:
          type: array
          items:
            type: object
            additionalProperties: true
        edges:
          type: array
          items:
            type: object
            additionalProperties: true
        viewport:
          type: object
          properties:
            x:
              type: number
            'y':
              type: number
            zoom:
              type: number
          additionalProperties: true
        enabled:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: true
      example:
        _id: 64d2f9c5e8a1d4e001a0b1c2
        name: New Lead Welcome
        description: Greet new leads and assign them to a leasing agent.
        organizationId: 64a1b2c3d4e5f60012345678
        userId: 64a1b2c3d4e5f60012345679
        nodes:
          - id: n1
            type: trigger
            position:
              x: 50
              'y': 50
            data:
              event: application.created
          - id: n2
            type: sendMessage
            position:
              x: 250
              'y': 50
            data:
              template: welcome-sms
        edges:
          - id: e1
            source: n1
            target: n2
        viewport:
          x: 0
          'y': 0
          zoom: 1
        enabled: true
        createdAt: '2026-04-12T14:22:10.000Z'
        updatedAt: '2026-04-22T10:14:00.000Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````