---
title: "Update Workflow"
method: PUT
path: "/api/v1/workflow/{workflow_id}"
tags: ["main"]
---

# Update Workflow

`PUT /api/v1/workflow/{workflow_id}`

Update an existing workflow.

Args:
    workflow_id: The ID of the workflow to update
    request: The update request containing the new name and workflow definition

Returns:
    The updated workflow

Raises:
    HTTPException: If the workflow is not found or if there's a database error

## Path parameters

- `workflow_id` integer, required

## Headers

- `authorization` string, nullable
- `X-API-Key` string, nullable

## Request body

- UpdateWorkflowRequest
  - `name` string, nullable
  - `workflow_definition` object, nullable
  - `template_context_variables` object, nullable
  - `workflow_configurations` WorkflowConfigurationDefaults
    - `ambient_noise_configuration` AmbientNoiseConfigurationDefaults
      - `enabled` boolean
      - `volume` number
    - `max_call_duration` integer
    - `max_user_idle_timeout` number
    - `smart_turn_stop_secs` number
    - `turn_start_strategy` 'default' | 'min_words' | 'provisional_vad'
    - `turn_start_min_words` integer
    - `provisional_vad_pause_secs` number
    - `turn_stop_strategy` 'transcription' | 'turn_analyzer'
    - `dictionary` string
    - `context_compaction_enabled` boolean
    - `external_pbx_field_mappings` ExternalPBXFieldMapping[]
      - `context_path` string, required
      - `destination_field` string, required

## Response `200`

Successful Response

- WorkflowResponse
  - `id` integer, required
  - `name` string, required
  - `status` string, required
  - `created_at` string, date-time, required
  - `workflow_definition` object, required
  - `current_definition_id` integer, nullable, required
  - `template_context_variables` object, nullable
  - `call_disposition_codes` CallDispositionCodes
    - `disposition_codes` string[]
  - `total_runs` integer, nullable
  - `workflow_configurations` object, nullable
  - `version_number` integer, nullable
  - `version_status` string, nullable
  - `workflow_uuid` string, nullable

## Other responses

- `404` — Not found
- `422` — Validation Error

---

[API](https://skmtc.net/dograh/apis/dograh-api.md) · [All operations](https://skmtc.net/dograh/apis/dograh-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/dograh/dograh-api/versions/e7d045c0295a/schema)
