---
title: "Automations from the CLI"
description: "Create, edit, publish, activate and run BankSync automations from your terminal or a CI job with banksync automations."
section: "CLI"
canonical: "https://banksync.io/docs/cli/automations-cli"
specs: ["cli","automations"]
operationBindings: [{"capability":"automations","operation":"automations.list"},{"capability":"automations","operation":"automations.read"},{"capability":"automations","operation":"automations.create"},{"capability":"automations","operation":"automations.edit"},{"capability":"automations","operation":"automations.validate"},{"capability":"automations","operation":"automations.import"},{"capability":"automations","operation":"automations.export"},{"capability":"automations","operation":"automations.revision.publish"},{"capability":"automations","operation":"automations.activate"},{"capability":"automations","operation":"automations.webhooks.rotate"},{"capability":"automations","operation":"automations.revision.list"},{"capability":"automations","operation":"automations.revision.read"},{"capability":"automations","operation":"automations.run.start"},{"capability":"automations","operation":"automations.run.dry"},{"capability":"automations","operation":"automations.run.list"},{"capability":"automations","operation":"automations.run.read"},{"capability":"automations","operation":"automations.nodes.search"}]
---

Automations are in **preview** for invited workspaces. Elsewhere `banksync automations` answers "not found".

Everything below uses the same operations as the [API](/docs/api/automations-api) and [MCP](/docs/mcp/automations-mcp). Add `-o json` to any command for machine-readable output.

## Build and publish

```bash
banksync automations create --name "Alert on reauth"
banksync automations get wf_123 --fields draftVersion
banksync automations edit wf_123 --file commands.json
banksync automations validate wf_123
banksync automations publish wf_123
```

`commands.json` is `{ "draftVersion": 0, "spec": [...], "layout": [...] }`. The edit is refused if the draft changed since you read it; `--draft-version` overrides the document's value.

Keep automations in your repository: `banksync automations export wf_123 --out alert-on-reauth.json` writes a portable file with no ids of your workspace, and `banksync automations import --file alert-on-reauth.json` brings it back as a new draft. `import` also reads an n8n workflow or an Activepieces flow (`--dialect n8n`), and prints what did not carry across.

## Bind, configure, activate

```bash
banksync automations bind wf_123 ledger tbl_456
banksync automations config set wf_123 threshold 250
banksync automations activate wf_123
```

After publishing, a member approves the automation's grant in the app — a person's decision, with no command. `banksync automations grants list wf_123` shows where it stands. `activate` prints each webhook URL once; `banksync automations webhooks rotate wf_123 [--trigger hook]` mints a new one, stops the old one at once and prints the new URL. Publishing an automation that is already on stages the new revision until its grant is approved; `banksync automations revisions wf_123` lists the revisions and `banksync automations revisions get wf_123 <hash>` prints one with its definition.

## Run and watch

```bash
banksync automations dry-run wf_123
banksync automations run wf_123 --inputs '{"month": "2026-09"}'
banksync automations runs list wf_123
banksync automations runs get run_123
banksync automations runs output run_123 -o json
```

`create`, `import`, `copy`, `run` and `dry-run` send an idempotency key, so a retried call makes nothing new; pass `--idempotency-key` to make a script that runs twice answer what its first run made. An automation that starts from an event runs for real only with `run --live` (`--trigger` picks one of several); `dry-run` rehearses it. A run its admission holds is printed with status `queued`: `runs get` follows it. Lists print a `--cursor` for their next page.

`runs get` shows each node's status and attempts, and `runs nodes` lists each step's executions with `automations:read`; `runs output` and `runs nodes --payloads` need `automation_outputs:read`, which the default login does not ask for: sign in with `banksync login --automation-outputs` (or use an API key that holds it). `runs cancel`, `runs pause` and `runs resume` control a run in flight.

## Find node types

```bash
banksync automations nodes search reauth
banksync automations nodes describe banksync.banks/connection.needs_reauth@1 -o json
banksync automations packages
```

## In CI

Use an API key with `automations:write` (`BANKSYNC_API_KEY`), and `--no-input` so a missing value fails rather than prompts. Deleting an automation, cancelling a run, revoking a grant and rotating a webhook ask for confirmation unless you pass `--yes`; without a terminal they refuse until you do. `automations nodes options` and `widgets data` take `--params` (a JSON object) for a dependent choice's sibling values and a widget query's parameters.
