> For the complete documentation index, see [llms.txt](https://docs.borndigital.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.borndigital.ai/insights/workspace/process/rerun.md).

# Rerun

This feature is used for re-running the processing/analysis of files after any changes to the configuration of parameters, prompts, or uploading new files, changing providers, adding metadata, etc.

When you change parameters or prompts, records that were already analysed keep their old results. Rerun analyses them again with the current configuration, and you choose exactly which records: one result version, a date range, and any conditions on the results, such as one agent's calls or only the negative ones. You pay only for the records you really need. **Check** shows how many records match before anything runs.

## Run a rerun

1. Select a **Version** you want to rerun.
2. Set a date range if you need to limit the scope.
3. Use **Additional filters** to add conditions or nested groups. See [Filters](#filters).
4. Select **Check** and review the number of matching results.
5. Select **Rerun**.

Each rerun creates a new result version. The confirmation shows the new **Prompt version:** number and how many results will be re-analysed. Follow the progress in [Batch jobs](https://docs.borndigital.ai/insights/workspace/process/batch-jobs.md) and [Unprocessed](https://docs.borndigital.ai/insights/workspace/process/unprocessed.md). Prompts set to **Disabled for rerun** are skipped.

A rerun runs the prompts again and consumes additional tokens, which costs extra. The note next to **Check** and **Rerun** says so; with **Dry rerun** on, it says that the rerun is free – results are saved, but prompts are not run.

<figure><img src="https://4261467870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6iQTvxgRZRwPS1NgIGEb%2Fuploads%2FK95taTy2RJoL4GQddhov%2Frerun-filters.webp?alt=media" alt="The Rerun page with version, dates, nested additional filters, the cost note and the Check and Rerun buttons"><figcaption><p>Filters and the cost note next to Check and Rerun</p></figcaption></figure>

On-screen elements:

* **Version**, **From**, **To** and **Additional filters**: select the records to rerun. See [Filters](#filters).
* **Dry rerun**: switch next to **Version**. When it is on, the selected results are saved again as a new version without running any prompts, so the rerun costs nothing.
* **Result**: appears below **Additional filters** after **Check**, for example `120 audio results will be used for rerun.`
* **Floating buttons**:
  * **Check**: counts the results that match the selected version, date range, and additional filters. It is disabled while the date range is invalid.
  * **Rerun**: starts the rerun. It is available only after **Check** has found at least one matching result for the current selection.

{% hint style="danger" %}
Pay attention to how many results will be re-analysed, as every re-analysed result adds to the cost.
{% endhint %}

## Filters

The same filter builder selects records on this page and in **Copy data from another project** on the [Audio](https://docs.borndigital.ai/insights/workspace/upload/data-sources-audio.md#copy-data-from-another-project) and [Text](https://docs.borndigital.ai/insights/workspace/upload/data-sources-text.md#copy-data-from-another-project) data source pages. It combines a result version, a time range and any number of conditions on the stored results.

* **Version**: dropdown with the result versions of the project. On this page, the newest version is preselected.
* **From** + **To**: date and time fields that limit the records to a time range. They use your local time zone, shown in the label, for example **From (UTC+01:00)**. Leave them empty to include all dates. If **From** is not earlier than **To**, the range is invalid and **Check** is disabled.
* **Additional filters**: conditions that narrow the selection further.
  * **Level 1**, **Level 2**, **Level 3**: label of each condition group. The top group is Level 1, and you can nest groups up to Level 3.
  * **AND** + **OR**: choose whether all conditions in the group must match (**AND**, the default) or at least one of them (**OR**).
  * **Parameter**: name of the field to filter on, as it is stored in the results, for example `<prompt>_<parameter>` for a parameter result. Spaces are removed automatically.
  * **Operator**: how the value is compared: **Equal**, **Not equal**, **>**, **>=**, **<**, **<=**, **Is in**, **Is not in**, and **RegEx**.
  * **Value**: the value to compare with. The input changes with **Type** and **Operator**:
    * **String**, **Integer** and **Float**: a text field. Confirm the value with **Enter** or by leaving the field.
    * **Date**: a date and time picker.
    * **Bool**: a select with **True** and **False**.
    * **Is in** and **Is not in**: type each value and confirm it with **Enter**; every value becomes a chip.
    * **RegEx**: a regular expression in RE2 syntax. It is checked as you type; an invalid pattern shows `Enter a valid RE2 regular expression.`
  * **Type**: **String**, **Integer**, **Float**, **Date**, or **Bool**. The list offers only the types that fit the selected operator: **>**, **>=**, **<** and **<=** work with **Integer**, **Float** and **Date**; **Is in** and **Is not in** with **String**, **Integer** and **Float**; **RegEx** only with **String**. When you change the operator, the type switches to a supported one.
  * **Condition**: adds another condition to the group.
  * **Nested group**: adds a group of conditions inside the current group, up to Level 3.
  * Bin icon: removes the condition or nested group.
  * **Preview**: collapsible section that shows the filter in its stored JSON form. It does not run the filter or count results. A condition is left out of the preview until its parameter and value are complete and valid.
  * **Import**: button under **Preview** that opens the **Import filter** dialog. The dialog starts with the current filter; paste a filter in the same JSON format (the dialog calls it a Mongo query) and select **Import** to replace the current filter. A filter copied from **Preview**, for example from another project, can be reused this way. If the text is not valid, the dialog says what is wrong, such as `Enter valid JSON.` or `A filter field must start with result_json. and contain no whitespace.`, and the current filter stays unchanged.

**Example.** You changed the sentiment prompt and want to re-analyse the difficult calls of two agents, as in the picture above. Select the version and, if needed, the dates. In Level 1 keep **AND** and add a condition: **Parameter** `meta_input_agent`, **Operator** **Is in**, **Value** `Anthony` and `Lucy`, **Type** **String**. Add a **Nested group** (Level 2) with the condition `client_sentiment` **Equal** `negative` (**String**) – switch it to **OR** and add more conditions when any of them should be enough. Back in Level 1, add `meta_input_call_duration` **>** `100` (**Integer**). The filter now matches Anthony's and Lucy's negative calls longer than 100. Select **Check** to see how many calls that is before you rerun.

After **Check**, the number of matching results appears below **Additional filters** as **Result:**. If you then change the version, the dates or a filter, **Warning: Outdated results.** appears next to the number; select **Check** again before you continue.
