---
title: "Update a workflow"
method: PUT
path: "/v1/workspaces/{workspaceId}/workflows/{workflowId}"
tags: ["Workflows"]
---

# Update a workflow

`PUT /v1/workspaces/{workspaceId}/workflows/{workflowId}`

Updates a workflow template.

## Path parameters

- `workspaceId` string, required
- `workflowId` string, required

## Request body

- UpdateWorkflow
  - `inputs` WorkflowInput[], required
    - union
      - WorkflowStringInput
        - `default` string
        - `key` string, required
        - `type` 'string', required
      - WorkflowNumberInput
        - `default` number
        - `key` string, required
        - `type` 'number', required
      - WorkflowBooleanInput
        - `default` boolean
        - `key` string, required
        - `type` 'boolean', required
      - union
        - WorkflowManualArrayInput
          - `default` object[]
          - `key` string, required
          - `type` 'array', required
        - WorkflowSelectorArrayInput
          - `key` string, required
          - `selector` object, required
            - `default` string — CEL expression for the default selector.
            - `entityType` 'resource' | 'environment' | 'deployment', required
          - `type` 'array', required
      - WorkflowObjectInput
        - `default` object
        - `key` string, required
        - `type` 'object', required
  - `jobAgents` CreateWorkflowJobAgent[], required
    - `config` object, required — Configuration for the job agent
    - `name` string, required
    - `ref` string, required — Reference to the job agent
    - `selector` string, required — CEL expression to determine if the job agent should dispatch a job
  - `name` string, required
  - `slug` string — URL-safe identifier unique within the workspace.

## Response `202`

Accepted response

- Workflow
  - `id` string, required
  - `inputs` WorkflowInput[], required
    - union
      - WorkflowStringInput
        - `default` string
        - `key` string, required
        - `type` 'string', required
      - WorkflowNumberInput
        - `default` number
        - `key` string, required
        - `type` 'number', required
      - WorkflowBooleanInput
        - `default` boolean
        - `key` string, required
        - `type` 'boolean', required
      - union
        - WorkflowManualArrayInput
          - `default` object[]
          - `key` string, required
          - `type` 'array', required
        - WorkflowSelectorArrayInput
          - `key` string, required
          - `selector` object, required
            - `default` string — CEL expression for the default selector.
            - `entityType` 'resource' | 'environment' | 'deployment', required
          - `type` 'array', required
      - WorkflowObjectInput
        - `default` object
        - `key` string, required
        - `type` 'object', required
  - `jobAgents` WorkflowJobAgent[], required
    - `config` object, required — Configuration for the job agent
    - `name` string, required
    - `ref` string, required — Reference to the job agent
    - `selector` string, required — CEL expression to determine if the job agent should dispatch a job
  - `name` string, required
  - `slug` string, required

## Other responses

- `400` — Invalid request
- `404` — Resource not found
- `409` — Workflow slug already exists in this workspace

## Changes

> 50 revisions in range; 24 could not be searched.

- **2026-03-30** `9c961c6052c4` — 2 breaking, 1 warning, 1 info
  - added the new required request property `jobAgents`
  - removed the required property `jobs` from the response with the `202` status
  - removed the request property `jobs`
  - added the required property `jobAgents` to the response with the `202` status
- **2026-03-12** `95ad4756775e` — 3 breaking, 1 info
  - removed `#/components/schemas/JsonSelector, #/components/schemas/CelSelector` from the `inputs/items/oneOf[#/components/schemas/WorkflowArrayInput]/oneOf[#/components/schemas/WorkflowSelectorArrayInput]/selector/default` request property `oneOf` list
  - the `inputs/items/oneOf[#/components/schemas/WorkflowArrayInput]/oneOf[#/components/schemas/WorkflowSelectorArrayInput]/selector/default` request property type/format changed from ``/`` to `string`/``
  - the `inputs/items/oneOf[#/components/schemas/WorkflowArrayInput]/oneOf[#/components/schemas/WorkflowSelectorArrayInput]/selector/default` response's property type/format changed from ``/`` to `string`/`` for status `202`
  - removed `#/components/schemas/JsonSelector, #/components/schemas/CelSelector` from the `inputs/items/oneOf[#/components/schemas/WorkflowArrayInput]/oneOf[#/components/schemas/WorkflowSelectorArrayInput]/selector/default` response property `oneOf` list for the response status `202`

[Change history](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api/changes/v1/workspaces/:workspaceId/workflows/:workflowId/put.md)

---

[API](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api.md) · [All operations](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ctrlplanedev/ctrlplane-api/revisions/156e0d264995/schema)
