# Custom Workflows

Execute custom workflow definitions and check their status.

## workflow run

Execute a custom workflow definition. Accepts JSON from a file or stdin.
The command starts the workflow and returns the workflow ID, current status, and message.

```bash
linkedin workflow run [flags]
```

| Flag | Type | Description |
| --- | --- | --- |
| `-f` / `--file` | string | Path to workflow JSON file |

```bash
# From file
linkedin workflow run --file workflow.json

# From stdin
cat workflow.json | linkedin workflow run

# Inline
echo '{"actions":[...]}' | linkedin workflow run
```

See [Building Workflows](/docs/building-workflows) for the workflow JSON schema.

## workflow status

Check status of a running workflow or wait for its completion.
In-progress responses include `status` (`pending` or `running`) and `message`.

```bash
linkedin workflow status <id> [flags]
```

| Arg | Required | Description |
| --- | --- | --- |
| `id` | yes | Workflow ID |

| Flag | Type | Description |
| --- | --- | --- |
| `--wait` | boolean | Block until the workflow completes |

```bash
# Check current status
linkedin workflow status abc123

# Wait for completion
linkedin workflow status abc123 --wait --json
```
