---
title: "Update workflow"
method: PUT
path: "/api/apps/{app_id}/workflows/{workflow_id}"
---

# Update workflow

`PUT /api/apps/{app_id}/workflows/{workflow_id}`

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Updates a workflow. Send only the fields you want to change.

Anything you leave out keeps its stored value, so a rename is just `{"name": "..."}`. Changing `definition` saves a new immutable version and the workflow runs it from then on; earlier versions stay readable through [List workflow versions](/api-reference/list-workflow-versions). Pass `change_summary` to label what changed.

Renaming to a name another live workflow already uses returns a 409. An invalid definition returns a 422 with the validation errors, and nothing is saved.

Updating does not change whether the workflow is running. It also rewrites the workflow's file in the app's code.

This endpoint is limited to 30 requests per minute.

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time. Send only the fields documented here. Other request fields are not supported and their behavior can change.</Warning>

## Path parameters

- `app_id` string, required — ID of the app whose workflows you want to work with.
- `workflow_id` string, required — ID of the workflow, as returned in `id` by [List workflows](/api-reference/list-workflows).

## Request body

- UpdateWorkflowRequest
  - `name` string, nullable — New name. Leave it out to keep the current one.
  - `description` string, nullable — New description. Leave it out to keep the current one.
  - `definition` object, nullable — New definition. Sending one saves a new version. Leave it out to keep the current one.
  - `trigger` object, nullable — New trigger, same shape as on create. Leave it out to keep the current one.
  - `change_summary` string, nullable — Note describing this change, kept in the version history.

## Response `200`

The updated workflow.

- WorkflowResponse
  - `id` string, required — ID of the workflow.
  - `app_id` string, required — ID of the app the workflow belongs to.
  - `file_key` string, nullable — Name of the workflow's file in the app's code. `null` on workflows saved before files were kept.
  - `name` string, required — Name of the workflow.
  - `description` string, nullable — What the workflow is for.
  - `status` string, required — Whether the workflow runs: `active`, `inactive`, or `archived`.
  - `status_reason` string, nullable — Why Base44 stopped the workflow itself, as a fixed code: `consecutive_failures`, `end_condition_reached`, `migration_activation_failed`, or `workflows_not_available`. `null` when you set the status yourself.
  - `current_version_id` string, nullable — Version the workflow runs today, as the SHA-256 hash of that definition. `null` until a definition is saved.
  - `trigger` object — What starts the workflow. The trigger sits under `config`, keyed by `trigger_type`.
  - `app_type_context` object, nullable — Which app surface the workflow was authored against.
  - `last_run_at` string, date-time, nullable — When the workflow last started running. `null` before its first run.
  - `last_run_status` string, nullable — How that run ended: `success`, `failed`, or `cancelled`. `null` before the first run. Note this is a different set of values from a run's own `status`, which reports `completed` rather than `success`.
  - `consecutive_failures` integer — Runs that have failed in a row. Resets on the next success.
  - `total_runs` integer — Runs the workflow has started, ever.
  - `successful_runs` integer — Runs that finished successfully, ever.
  - `failed_runs` integer — Runs that ended in an error, ever.
  - `created_date` string, date-time, nullable — When the workflow was created.
  - `updated_date` string, date-time, nullable — When the workflow was last changed.
  - `created_by` string, nullable — Email of whoever created the workflow.
  - `definition` object, nullable — The steps the workflow runs, as a CNCF Serverless Workflow v1.0 document. `null` when no version has been saved yet. Only this endpoint returns it; the list endpoint does not.

## Other responses

- `401` — Missing or invalid credentials.
- `402` — This workspace's plan does not include workflows. Upgrade to Builder or above.
- `403` — You don't have access to this app, the app does not exist, the app still runs the older automations engine instead of workflows, or you used a workspace API key. A missing app and an app you cannot reach are deliberately the same answer.
- `404` — There is no workflow with this ID on this app.
- `409` — Another workflow on this app already uses this name.
- `422` — The definition or trigger is not valid. The body lists what is wrong.

---

[API](https://skmtc.dev/idealspot/apis/base44-app-management-api.md) · [All operations](https://skmtc.dev/idealspot/apis/base44-app-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/idealspot/base44-app-management-api/revisions/31ef75eb64ab/schema)
