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

# Update Workflow

> Update a workflow. All fields except `id` and `workspaceId` are optional; only fields you provide are changed. The `config` object is shallow-merged with the existing config — top-level keys you omit are preserved, keys you send overwrite. Nested objects and arrays are replaced wholesale (no deep merge). The workflow's `type` cannot be changed. Config fields are validated against the workflow's stored type (HTTP or VOICE).



## OpenAPI

````yaml /public-apis/openapi/workflows.json put /v1/workflows
openapi: 3.0.0
info:
  version: 1.0.0
  contact:
    name: Maxim Engineering
    email: eng@getmaxim.ai
  title: Maxim SDK API - workflows
  description: API documentation for Maxim SDK workflows endpoints
servers:
  - url: https://api.getmaxim.ai
security: []
paths:
  /v1/workflows:
    put:
      tags:
        - Workflow
      summary: Update Workflow
      description: >-
        Update a workflow. All fields except `id` and `workspaceId` are
        optional; only fields you provide are changed. The `config` object is
        shallow-merged with the existing config — top-level keys you omit are
        preserved, keys you send overwrite. Nested objects and arrays are
        replaced wholesale (no deep merge). The workflow's `type` cannot be
        changed. Config fields are validated against the workflow's stored type
        (HTTP or VOICE).
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  minLength: 1
                  description: Unique identifier of the workflow to update
                workspaceId:
                  type: string
                  minLength: 1
                  description: Workspace that currently owns the workflow
                name:
                  type: string
                  minLength: 1
                  description: New name for the workflow
                description:
                  type: string
                  description: New description for the workflow
                folderId:
                  type: string
                  nullable: true
                  description: >-
                    Move the workflow to this folder. Pass null to remove from
                    any folder; omit to leave unchanged.
                newWorkspaceId:
                  type: string
                  description: >-
                    Move the workflow to this workspace. Omit to keep it in the
                    current workspace.
                config:
                  oneOf:
                    - $ref: '#/components/schemas/HttpWorkflowConfig'
                    - $ref: '#/components/schemas/VoiceWorkflowConfig'
                  description: >-
                    Partial workflow config. Shape depends on the workflow's
                    stored type (HTTP or VOICE) — supply the matching schema.
                    Top-level keys are shallow-merged with the existing config;
                    nested objects/arrays are replaced, not merged.
                evalConfig:
                  type: object
                  properties:
                    datasetIds:
                      type: array
                      items:
                        type: string
                    evals:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type: string
                          type:
                            type: string
                          builtin:
                            type: boolean
                            default: false
                        required:
                          - id
                          - name
                          - type
                  required:
                    - datasetIds
                  description: Evaluation configuration (full replacement when provided)
              required:
                - id
                - workspaceId
            examples:
              Rename only:
                summary: Rename a workflow without touching its config
                value:
                  id: wf_abc123
                  workspaceId: ws_xyz
                  name: renamed-workflow
              Partial HTTP config update:
                summary: Change a single HTTP config field (other keys preserved)
                value:
                  id: wf_abc123
                  workspaceId: ws_xyz
                  config:
                    method: GET
              Full HTTP config replacement:
                summary: Supply a complete HTTP config (overwrites top-level keys)
                value:
                  id: wf_abc123
                  workspaceId: ws_xyz
                  config:
                    method: POST
                    url: https://api.example.com/chat
                    scheme: https
                    headers:
                      - id: h1
                        key: Content-Type
                        value: application/json
                    params: []
                    payload: '{"query":"{{input}}"}'
                    scripts: function prescript(req){return req}
                    authentication:
                      type: none
                    variables:
                      input: ''
                    timeout: 120
                    maxRetries: 3
                    concurrency: 10
                    contextToEvaluate: ''
              VOICE config update:
                summary: Set phone details on a VOICE workflow
                value:
                  id: wf_voice1
                  workspaceId: ws_xyz
                  config:
                    phoneNumber: '4155550123'
                    dialCode: '+1'
                    countryCode: US
                    country: United States
                    timeout: 60
                    concurrency: 1
                    maxRetries: 3
                    language: en-US
              Move to another folder:
                summary: Pass null to remove from any folder
                value:
                  id: wf_abc123
                  workspaceId: ws_xyz
                  folderId: null
      responses:
        '200':
          description: Workflow updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Workflow'
                required:
                  - data
        '400':
          description: Invalid request parameters or workflow not found in workspace
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
        - ApiKeyAuth: []
components:
  schemas:
    HttpWorkflowConfig:
      type: object
      description: >-
        Configuration for HTTP workflows. All fields are optional in update
        payloads (partial schema applied server-side).
      properties:
        scheme:
          type: string
          enum:
            - https
            - wss
          description: Transport scheme
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - DELETE
            - PATCH
          description: HTTP method
        url:
          type: string
          description: Endpoint URL
        params:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                minLength: 1
              key:
                type: string
                minLength: 1
              value:
                type: string
            required:
              - id
              - key
              - value
          description: Query parameters
        headers:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                minLength: 1
              key:
                type: string
                minLength: 1
              value:
                type: string
            required:
              - id
              - key
              - value
          description: HTTP headers
        payload:
          type: string
          description: Request body payload (string; JSON should be pre-stringified)
        output:
          type: string
          description: Response output mapping expression
        scripts:
          type: string
          description: Pre/post request scripts
        authentication:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - none
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - aws4
                accessKeyId:
                  type: string
                  minLength: 1
                secretAccessKey:
                  type: string
                  minLength: 1
                sessionToken:
                  type: string
                region:
                  type: string
                service:
                  type: string
              required:
                - type
                - accessKeyId
                - secretAccessKey
          description: 'Authentication strategy: ''none'' or AWS Signature V4 (''aws4'').'
        timeout:
          type: number
          description: Request timeout in seconds
        concurrency:
          type: number
          default: 10
          description: Maximum concurrent requests
        maxRetries:
          type: number
          minimum: 0
          default: 3
          description: Maximum retry attempts
        contextToEvaluate:
          type: string
          description: Context expression evaluated against the response
        variables:
          type: object
          additionalProperties:
            type: string
          description: Variable substitutions used in url, payload, headers, etc.
        environmentId:
          type: string
          description: Environment identifier used to resolve variables
    VoiceWorkflowConfig:
      type: object
      description: >-
        Configuration for VOICE workflows. All fields are optional in update
        payloads (partial schema applied server-side).
      properties:
        phoneNumber:
          type: string
          minLength: 1
          description: Phone number (national portion, without dial code)
        countryCode:
          type: string
          description: ISO 3166-1 alpha-2 country code (e.g., US, GB)
        country:
          type: string
          description: Country name (display only)
        dialCode:
          type: string
          minLength: 1
          description: International dial code (e.g., +1)
        timeout:
          type: number
          description: Call timeout in seconds
        concurrency:
          type: number
          default: 10
          description: Maximum concurrent calls
        contextToEvaluate:
          type: string
          description: Context expression evaluated against the call output
        maxRetries:
          type: number
          minimum: 0
          default: 3
          description: Maximum retry attempts
        variables:
          type: object
          additionalProperties:
            type: string
          description: Variable substitutions
        language:
          type: string
          description: Language/locale code (e.g., en-US)
    Workflow:
      type: object
      properties:
        id:
          type: string
        workspaceId:
          type: string
        accountId:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        type:
          type: string
          enum:
            - HTTP
            - VOICE
        folderId:
          type: string
        config:
          nullable: true
        createdAt:
          type: string
        updatedAt:
          type: string
      required:
        - id
        - workspaceId
        - accountId
        - name
        - type
        - createdAt
        - updatedAt
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-maxim-api-key
      description: API key for authentication

````