---
title: "Update workflow configuration"
method: PATCH
path: "/workflow/{id}"
tags: ["Agents"]
deprecated: true
---

# Update workflow configuration

`PATCH /workflow/{id}`

> **Deprecated.**

**Deprecated** — use `PATCH /agent/{id}/drafts/{draftId}/config` instead.

Directly mutates the legacy workflow document for an agent. This write path
bypasses the versioning system entirely: the change is not captured as a
new version, and future version activations may overwrite the legacy doc
back to whatever the version snapshot contains.

⚠ **Writing here on a versioned agent can silently wipe tools, prompt, or
other fields that were missing from the PATCH payload.** Only use this if
you know the agent is not using versioning, or if you are intentionally
hot-patching the legacy doc.

## Path parameters

- `id` string, required

## Request body

- object
  - `type` 'workflow_graph' | 'single_prompt', required — The type of workflow configuration. workflow_graph uses a node-based visual workflow, single_prompt uses a simple prompt-based configuration.
  - `workflowGraph` object — Required when `type = workflow_graph`. Exactly one of `workflowGraph` or `singlePromptConfig` must be provided.
    - `nodes` object[]
    - `edges` object[]
  - `singlePromptConfig` SinglePromptConfig — Configuration for single prompt workflow type
    - `prompt` string, required — The main prompt that defines the agent's behavior and responses
    - `tools` Tool[] — Array of tools/functions available to the agent during conversations. Five tool types are supported: `end_call`, `transfer_call`, `api_call`, `extract_dynamic_variables`, and `knowledge_base_search`. Each type has its own required fields — see `Tool` schema.
      - `type` 'end_call' | 'transfer_call' | 'api_call' | 'extract_dynamic_variables' | 'knowledge_base_search', required — The type of function/tool
      - `name` string, required — Unique name for the function (no spaces)
      - `description` string, required — Description of what the function does
      - `enabled` boolean — Whether the tool is enabled
      - `transferNumber` string — Required for transfer_call type. Phone number to transfer the call to (E.164 format)
      - `transferOption` object — Required for transfer_call type. Controls cold vs warm transfer behavior.
        - `type` 'cold_transfer' | 'warm_transfer' — Transfer mode. `cold_transfer` hands off immediately; `warm_transfer` briefs the receiving party first.
        - `privateHandoffOption` object, nullable — Private briefing delivered to the transfer target before the caller is connected. Only used when `type = warm_transfer`.
          - `type` 'prompt' | 'static' — `prompt` generates briefing from the LLM; `static` plays fixed text.
          - `prompt` string — The prompt or static text for the private handoff.
        - `publicHandoffOption` object, nullable — Message played to the caller while the transfer is being set up. Only used when `type = warm_transfer`.
          - `type` 'prompt' | 'static'
          - `prompt` string
      - `onHoldMusic` 'ringtone' | 'relaxing_sound' | 'uplifting_beats' | 'none' — Optional for transfer_call type. Audio played to the caller while the transfer is in progress.
      - `transferOnlyIfHuman` boolean — Optional for transfer_call type. If true, the call is only transferred when a human is detected on the receiving end (voicemail/IVR skipped).
      - `detectionTimeout` integer — Optional for transfer_call type. Seconds to wait for human detection before giving up (5–60).
      - `url` string, uri — Required for api_call type. The URL to make the HTTP request to.
      - `method` 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' — Required for api_call type. HTTP method to use.
      - `timeout` integer — Optional for api_call type. Request timeout in milliseconds (1000–30000).
      - `headers` object — Optional for api_call type. Static HTTP headers as a key/value map.
      - `headersArray` object[] — Optional for api_call type. Headers as an array of key/value objects (alternative to `headers` map).
        - `key` string, required
        - `value` string, required
      - `queryParams` object[] — Optional for api_call type. Query parameters to include in the request URL. Values support variable templating like `{{order_id}}`.
        - `key` string, required
        - `value` string, required
      - `requestBody` string — Optional for api_call type. Raw request body as a JSON string. Supports variable templating.
      - `llmParameters` object[] — Optional for api_call type. Parameters the LLM can supply dynamically at runtime.
        - `name` string, required — Parameter name
        - `description` string, required — What the parameter represents
        - `type` 'text' | 'number' | 'boolean' | 'enum', required
        - `values` string[] — Required when type is `enum`. Allowed values.
        - `required` boolean
      - `responseVariables` object[] — Optional for api_call type. Variables to extract from the API response into the agent's variable store.
        - `variableName` string, required — Name to store the extracted value under
        - `jsonPath` string, required — JSON path to extract the value from the response
      - `variablesExtractionSchema` object[] — Required for extract_dynamic_variables type. Schema defining variables to extract from the conversation.
        - `name` string, required — Name of the variable to extract
        - `description` string, required — What this variable represents
        - `type` 'text' | 'number' | 'boolean' | 'enum', required
        - `values` string[] — Required when type is `enum`. List of possible values.
      - `knowledgeBaseId` string — Required for knowledge_base_search type. ID of the knowledge base to search.
      - `fillerPhrases` string[] — Optional for knowledge_base_search type. Phrases spoken while searching.

## Response `200`

Workflow updated successfully.

## Other responses

- `400` — Invalid input
- `401` — Unauthorized access
- `404` — Workflow not found.
- `500` — Internal server error

---

[API](https://skmtc.net/smallest-inc/apis/agent-management-api.md) · [All operations](https://skmtc.net/smallest-inc/apis/agent-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smallest-inc/agent-management-api/versions/6d1036a76fbc/schema)
