> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/reference/inference/inference-cli/workflows.md).

# Run Workflows

The `inference workflows` command provides a way to process images and videos with a [Workflow](https://docs.roboflow.com/workflows). It can process:

* individual images
* directories of images
* video files

{% hint style="success" %}
To see the details of the command, run:

```bash
inference workflows --help
```

A help guide is also available for each sub-command:

```bash
inference workflows process-image --help
```

{% endhint %}

## Process an individual image

Basic usage of the command:

```bash
inference workflows process-image \
    --image_path {your-input-image} \
    --output_dir {your-output-dir} \
    --workspace_name {your-roboflow-workspace-url} \
    --workflow_id {your-workflow-id} \
    --api-key {your_roboflow_api_key}
```

This takes your input image, runs it against your Workflow, and saves the results in the output directory. By default, the Workflow is processed using the Roboflow hosted API. You can tweak the behaviour of the command:

* if you want to process the image locally using the `inference` Python package, use the `--processing_target inference_package` option (requires `inference` to be installed)
* to see all options, use `inference workflows process-image --help`
* any option starting with `--` that is not listed in the `--help` output is treated as an input parameter to the Workflow execution, with automatic type conversion applied. Additionally, the `--workflow_params` option may specify a path to a `*.json` file providing Workflow parameters (explicit parameters override parameters defined in the file).
* if your Workflow defines an image parameter placeholder under a name different from `image`, you can point to the proper image input with `--image_input_name`
* the `--allow_override` flag must be used if the output directory is not empty

## Process a directory of images

Basic usage of the command:

```bash
inference workflows process-images-directory \
    -i {your_input_directory} \
    -o {your_output_directory} \
    --workspace_name {your-roboflow-workspace-url} \
    --workflow_id {your-workflow-id} \
    --api-key {your_roboflow_api_key}
```

You can tweak the behaviour of the command:

* if you want to process the images locally using the `inference` Python package, use the `--processing_target inference_package` option (requires `inference` to be installed)
* to see all options, use `inference workflows process-images-directory --help`
* any option starting with `--` that is not listed in the `--help` output is treated as an input parameter to the Workflow execution, with automatic type conversion applied. Additionally, the `--workflow_params` option may specify a path to a `*.json` file providing Workflow parameters (explicit parameters override parameters defined in the file).
* if your Workflow defines an image parameter placeholder under a name different from `image`, you can point to the proper image input with `--image_input_name`
* the `--allow_override` flag must be used if the output directory is not empty
* the `--threads` option can specify the number of threads used to run the requests when the processing target is the API

## Process a video file

{% hint style="info" %}
This command requires the `inference` package to be installed.
{% endhint %}

Basic usage of the command:

```bash
inference workflows process-video \
    --video_path {video_to_be_processed} \
    --output_dir {empty_directory} \
    --workspace_name {your-roboflow-workspace-url} \
    --workflow_id {your-workflow-id} \
    --api-key {your_roboflow_api_key}
```

You can tweak the behaviour of the command:

* the `--max_fps` option can be used to subsample video frames while processing
* to see all options, use `inference workflows process-video --help`
* any option starting with `--` that is not listed in the `--help` output is treated as an input parameter to the Workflow execution, with automatic type conversion applied. Additionally, the `--workflow_params` option may specify a path to a `*.json` file providing Workflow parameters (explicit parameters override parameters defined in the file).
* if your Workflow defines an image parameter placeholder under a name different from `image`, you can point to the proper image input with `--image_input_name`
* the `--allow_override` flag must be used if the output directory is not empty
