# Workflows Commands

> See [Workflows module docs](../../modules/workflows) for permissions and data model.

# Workflows Commands

See [Workflows module docs](../../modules/workflows) for permissions and data model.

### `soat list-workflows`

List workflows

- Method: `GET`
- Path: `/api/v1/workflows`

#### Usage

```bash
soat list-workflows
```

#### Options

##### `--project-id`

—

- Source: `query`
- Required: no
- Type: `string`

##### `--limit`

Maximum number of results to return

- Source: `query`
- Required: no
- Type: `integer`
- Default: `50`

##### `--offset`

Number of results to skip

- Source: `query`
- Required: no
- Type: `integer`
- Default: `0`

### `soat create-workflow`

Create a workflow

- Method: `POST`
- Path: `/api/v1/workflows`

#### Usage

```bash
soat create-workflow --name <string> --states <array<object<string, unknown>>> --transitions <array<object<string, unknown>>>
```

#### Options

##### `--project-id`

—

- Source: `body`
- Required: no
- Type: `string`

##### `--name`

—

- Source: `body`
- Required: yes
- Type: `string`

##### `--description`

—

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--states`

—

- Source: `body`
- Required: yes
- Type: `array<object<string, unknown>>`

##### `--transitions`

—

- Source: `body`
- Required: yes
- Type: `array<object<string, unknown>>`

##### `--payload-schema`

—

- Source: `body`
- Required: no
- Type: `object`

##### `--version-label`

Optional tag for the version this create archives, e.g. `initial`.

- Source: `body`
- Required: no
- Type: `string`
- Example: `initial`

### `soat get-workflow`

Get a workflow

- Method: `GET`
- Path: `/api/v1/workflows/{workflow_id}`

#### Usage

```bash
soat get-workflow --workflow-id <string>
```

#### Options

##### `--workflow-id`

—

- Source: `path`
- Required: yes
- Type: `string`

### `soat update-workflow`

Update a workflow

- Method: `PATCH`
- Path: `/api/v1/workflows/{workflow_id}`

#### Usage

```bash
soat update-workflow --workflow-id <string>
```

#### Options

##### `--workflow-id`

—

- Source: `path`
- Required: yes
- Type: `string`

##### `--name`

—

- Source: `body`
- Required: no
- Type: `string`

##### `--description`

—

- Source: `body`
- Required: no
- Type: `string \| null`

##### `--states`

—

- Source: `body`
- Required: no
- Type: `array<object<string, unknown>>`

##### `--transitions`

—

- Source: `body`
- Required: no
- Type: `array<object<string, unknown>>`

##### `--payload-schema`

—

- Source: `body`
- Required: no
- Type: `object`

##### `--version-label`

Optional tag for the version this write archives, e.g. `pre-rewire`. Ignored when the write changes no definition field, since no version is archived.

- Source: `body`
- Required: no
- Type: `string`
- Example: `pre-rewire`

### `soat delete-workflow`

Delete a workflow

- Method: `DELETE`
- Path: `/api/v1/workflows/{workflow_id}`

#### Usage

```bash
soat delete-workflow --workflow-id <string>
```

#### Options

##### `--workflow-id`

—

- Source: `path`
- Required: yes
- Type: `string`

### `soat list-workflow-versions`

List a workflow's versions

- Method: `GET`
- Path: `/api/v1/workflows/{workflow_id}/versions`

#### Usage

```bash
soat list-workflow-versions --workflow-id <string>
```

#### Options

##### `--workflow-id`

—

- Source: `path`
- Required: yes
- Type: `string`

##### `--limit`

Maximum number of results to return

- Source: `query`
- Required: no
- Type: `integer`
- Default: `50`

##### `--offset`

Number of results to skip

- Source: `query`
- Required: no
- Type: `integer`
- Default: `0`

### `soat get-workflow-version`

Fetch an archived workflow version

- Method: `GET`
- Path: `/api/v1/workflows/{workflow_id}/versions/{version}`

#### Usage

```bash
soat get-workflow-version --workflow-id <string> --version <integer>
```

#### Options

##### `--workflow-id`

—

- Source: `path`
- Required: yes
- Type: `string`

##### `--version`

The archived version number

- Source: `path`
- Required: yes
- Type: `integer`

### `soat restore-workflow-version`

Restore an archived workflow state machine

- Method: `POST`
- Path: `/api/v1/workflows/{workflow_id}/versions/{version}/restore`

#### Usage

```bash
soat restore-workflow-version --workflow-id <string> --version <integer>
```

#### Options

##### `--workflow-id`

—

- Source: `path`
- Required: yes
- Type: `string`

##### `--version`

The archived version number

- Source: `path`
- Required: yes
- Type: `integer`

##### `--label`

Optional tag for the new version the restore archives. Defaults to `restored from vN`.

- Source: `body`
- Required: no
- Type: `string`
- Example: `rollback to pre-rewire`
