---
title: save_workflow
description: Writes a workflow's file, workflows/<handle>.json, on `branch` from a
  whole definition, and nothing runs until merge_branch.
sidebar:
  order: 52
---

Writes a workflow's file, workflows/&lt;handle&gt;.json, on `branch` from a whole definition, and nothing runs until merge_branch. Typed inside `bash`, where `help save_workflow` prints the same.

```text
Usage: save_workflow HANDLE BRANCH DEFINITION [options]

Writes a workflow's file, workflows/<handle>.json, on `branch` from a
whole definition, and nothing runs until merge_branch. A new one is
written paused: activate_workflow on the same branch switches it on
once merged. A trigger or a step without a `uuid` or `version` is
given one. Topic `workflows` lists every trigger and step with its
settings; read guide `site-workflows` first.

Options:
  --handle TEXT (required)
      The workflow's handle, as list_workflows names it: its file is workflows/<handle>.json. Lower-case letters and digits, words joined by _.
  --branch TEXT (required)
      The branch to write workflows/<handle>.json on, made with git switch -c. Nothing changes until merge_branch puts it live.
  --message TEXT
      What the change is, in a line. Defaults to naming the files.
  --name TEXT
      What the owner sees it called. Needed for a new workflow.
  --definition JSON (required)
      The whole definition: { "trigger": { "key", "config" }, "steps": [ { "key", "config" } ] }, the steps in the order they run.
  --json OBJECT
      Every argument at once, as one JSON object; --json - reads it from stdin.
```
