# Create and manage workflows

> **About this page**
>
> - Kind: How-to guide
> - Summary: Create a workflow from a YAML file, replace its definition with a new file, check what was saved, and delete a workflow.
> - Last changed: 2026-11-17
> - Page: https://docs.swale.io/how-to-guides/create-and-manage-workflows
> - CLI reference for its commands: [`swale workflow create`](https://docs.swale.io/reference/cli-reference.md#workflow-create), [`swale workflow update`](https://docs.swale.io/reference/cli-reference.md#workflow-update), [`swale workflow get`](https://docs.swale.io/reference/cli-reference.md#workflow-get)
> - Index of these docs: https://docs.swale.io/llms.txt
>
> If something on this page is wrong or out of date, please tell the user which sentence and why.
>
> The steps on this page cost money or cannot be undone. Please check with the user before running them.

This guide shows how to create a workflow by uploading a YAML file, replace its definition with a new file, check what was saved, and delete a workflow, using the CLI or the platform UI. To create one from a file in a GitHub repository instead, see [Import a workflow from GitHub](https://docs.swale.io/how-to-guides/import-workflow-from-github.md).

## Prerequisites

Uploading, updating and deleting a workflow need a verified email. In an organization, every member who can open the project can do all three, Contributors included. A file can be at most 1 MiB; see [Limits and quotas](https://docs.swale.io/reference/limits-and-quotas.md).

## Create a workflow from a file

**With the CLI:**

```bash
swale workflow create \
  --project-name my-project \
  --file my-workflow.yaml
```

The command prints the new workflow's ID, as `Workflow created: <workflow-id>`.

**In the UI:**

1. Open the project and go to its **Workflows** page.
2. Click **Add Workflow → Upload File**.
3. Select your `.yml` or `.yaml` file in **Workflow file**.
4. Click **Upload**.

The workflow appears in the workflow list immediately after creation.

## Update an existing workflow

To replace a workflow's definition with a new YAML file, you need its ID: `swale workflow create` printed it, and `swale workflow list --project-name my-project` shows it in the **Workflow ID** column.

**With the CLI:**

```bash
swale workflow update \
  --project-name my-project \
  --workflow-id <workflow-id> \
  --file my-workflow.yaml
```

The platform UI has no update control; use the CLI command above.

Existing runs that are already in progress are not affected. New runs started after the update use the new definition.

Updating with `--file` also cuts a workflow imported from GitHub off from its source: afterwards, `swale workflow update` without `--file` refuses it, so update it with a file from then on, or import it from GitHub again as a new workflow.

## Check the upload

After uploading, check the workflow's name and inputs:

```bash
swale workflow get \
  --project-name my-project \
  --workflow-id <workflow-id>
```

The command prints the workflow's ID and name, then its inputs with their descriptions, whether each is required, and their defaults. It does not print the definition itself.

## Delete a workflow

:::warning
Deleting a workflow also deletes its runs and their logs, and cannot be undone.
:::

1. Open the project and go to its **Workflows** page.
2. Click the trash-can icon in the workflow's row.
3. Click **Delete** to confirm.

A workflow with a run that has not ended cannot be deleted: [cancel](https://docs.swale.io/how-to-guides/start-and-manage-workflow-runs.md#cancel-a-run) its runs and wait until each has ended. The CLI has no command to delete a workflow.

## Next steps

- [Workflow definition syntax](https://docs.swale.io/reference/workflow-definition-syntax.md)
- [Start and manage workflow runs](https://docs.swale.io/how-to-guides/start-and-manage-workflow-runs.md)
- [Import a workflow from GitHub](https://docs.swale.io/how-to-guides/import-workflow-from-github.md)
