---
title: "Update a Workflow"
method: PUT
path: "/v1/workflows/{id}"
tags: ["Workflows API"]
---

# Update a Workflow

`PUT /v1/workflows/{id}`

Use this endpoint to update an existing workflow definition. Only workflows with `draft` status can be updated.

## Path parameters

- `id` string, uuid, required

## Request body

- UpdateWorkflowInput
  - `description` string — Updated description of the workflow.
  - `edges` WorkflowEdgeInput[] — Updated connections between nodes.
    - `condition` string — Optional expression evaluated at runtime to determine whether this edge is followed. Supports referencing step outputs and HTTP status codes.
    - `id` string, required — Unique identifier for this edge within the workflow.
    - `label` string — Optional human-readable label for the edge (useful for visual editors).
    - `source` string, required — ID of the source node.
    - `sourceHandle` string — Optional handle identifier on the source node for visual editors.
    - `target` string, required — ID of the target node.
  - `metadata` object — Updated custom metadata.
  - `name` string, required — Updated workflow name.
  - `nodes` WorkflowNodeInput[] — Updated list of workflow nodes.
    - `data` object — Configuration data specific to the node type (e.g., triggerId for triggers, executorId + URL for executors).
    - `id` string, required — Unique identifier for this node within the workflow. Used in edges to define connections.
    - `name` string — Optional display name for the node.
    - `position` PositionInput, required
      - `x` integer — Horizontal position in pixels.
      - `y` integer — Vertical position in pixels.
    - `type` 'trigger' | 'executor' | 'conditional' | 'action', required — Type of the node: `trigger` (entry point), `executor` (external call), `conditional` (branching logic), or `action` (internal operation).

## Response `200`

Indicates that the request was successful and the response contains the requested data.

- WorkflowOutput
  - `createdAt` string, date-time — Timestamp when the workflow was created.
  - `description` string — Human-readable description of the workflow.
  - `edges` WorkflowEdgeOutput[] — Connections between nodes that define the execution flow.
    - `condition` string — Condition expression for conditional edges.
    - `id` string — Unique identifier of the edge.
    - `label` string — Human-readable label.
    - `source` string — ID of the source node.
    - `sourceHandle` string — Handle on the source node.
    - `target` string — ID of the target node.
  - `id` string, uuid — Unique identifier of the workflow.
  - `metadata` object — Custom key-value pairs for tagging or categorizing.
  - `name` string — Unique name of the workflow.
  - `nodes` WorkflowNodeOutput[] — The steps that make up this workflow.
    - `data` object — Configuration data specific to the node type.
    - `id` string — Unique identifier of the node within the workflow.
    - `name` string — Display name of the node.
    - `position` PositionOutput
      - `x` integer — Horizontal position in pixels.
      - `y` integer — Vertical position in pixels.
    - `type` string — Type of the node.
  - `status` 'draft' | 'active' | 'inactive' — Current lifecycle status: `draft` (editable), `active` (executable), or `inactive` (archived).
  - `updatedAt` string, date-time — Timestamp of the last update.

## Other responses

- `400` — Indicates that the request was malformed or contained invalid parameters.
- `404` — Indicates that the requested resource could not be found.
- `422` — Indicates that the request was well-formed but contains semantic errors that prevent processing.
- `500` — Indicates an unexpected internal error. If this persists, please contact support.

---

[API](https://skmtc.net/lerian/apis/identity-plugin.md) · [All operations](https://skmtc.net/lerian/apis/identity-plugin/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lerian/identity-plugin/versions/25daba385532/schema)
