> For the complete documentation index, see [llms.txt](https://karini-ai.gitbook.io/karini-ai-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://karini-ai.gitbook.io/karini-ai-documentation/recipes/knowledgebase-recipe/pause-and-unpause-recipe-runs.md).

# Pause and Unpause Recipe Runs

The Pause and Unpause feature provides a safety mechanism that automatically halts a recipe run when the volume of detected data changes exceeds configured thresholds, or when processing settings have been modified since the last run. This gives you the opportunity to review the scope of changes before they are applied to your knowledge base, preventing unintended large-scale modifications.

A recipe run can be paused under two categories of conditions:

1. **Threshold-Based Pause** : triggered when data change counts meet or exceed configured limits.
2. **Settings Change Pause** :triggered when processing configuration has been modified since the last run.

### Threshold-Based Pause

Threshold-based pause enables the recipe to stop execution automatically when the volume of detected changes exceeds predefined limits. This control is intended to prevent further processing when the number of newly added, updated, or deleted items is higher than expected.

The pause configuration settings are shown in the following image.

<figure><img src="/files/2uRfJYaN3x2VN4S3Pf4x" alt=""><figcaption></figcaption></figure>

#### How It Works

Threshold values can be configured independently for each change category - **New items**, **Updated items**, and **Deleted items**. At runtime, the recipe evaluates the detected change count per category against its configured threshold. If the count for any category meets or exceeds the defined threshold, the recipe is automatically paused.

{% hint style="info" %}
If a threshold is not configured for a specific category, that category is excluded from pause evaluation.
{% endhint %}

#### Pause Conditions

| Condition         | Description                                                                                             |
| ----------------- | ------------------------------------------------------------------------------------------------------- |
| **New Items**     | Pauses the recipe when the detected count of new items reaches or exceeds the configured threshold.     |
| **Updated Items** | Pauses the recipe when the detected count of updated items reaches or exceeds the configured threshold. |
| **Deleted Items** | Pauses the recipe when the detected count of deleted items reaches or exceeds the configured threshold. |

Each threshold is evaluated independently. The recipe does not wait for multiple conditions to be met. Reaching any single configured threshold is sufficient to trigger a pause.

### **Settings Change Pause**

Settings Change Pause automatically pauses a recipe when the system detects changes to tracked processing settings since the previous run. This control is designed to ensure that configuration changes are reviewed before the recipe continues execution with updated processing behavior.

#### How It Works

Before each execution, the system compares the current processing configuration with the configuration used in the previous run. If any tracked setting has changed, the recipe is paused automatically.

#### Tracked Settings for Knowledge base recipes with text

For  text-based recipes, the system monitors changes in the following configuration groups:

| Setting Group                    | Examples of Tracked Settings                                                                                  |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| **OCR / Document Understanding** | OCR method enable, processing method, image extraction, layout extraction, table extraction, fallback options |
| **PII Masking**                  | Enable, language, configured entity types                                                                     |
| **Chunking Strategy**            | Chunking type, tokenizer, overlap, chunk size                                                                 |
| **Embeddings Model**             | Model configuration, provider, endpoint, dimensions, runtime parameters                                       |
| **Metadata Extraction**          | LLM configuration, prompt definition, page inclusion settings                                                 |

#### Tracked Settings for Multimodal Recipes

For multimodal recipes, the system monitors changes in the following configuration groups:

| Setting Group                        | Examples of Tracked Settings                                         |
| ------------------------------------ | -------------------------------------------------------------------- |
| **Image Understanding**              | Enable/disble, processing method, model configuration                |
| **Audio Understanding**              | Enable/disable, processing method, credentials                       |
| **Video Understanding**              | Enable/disable, processing method, model configuration               |
| **Embeddings Model**                 | Model configuration, provider, endpoint, dimensions, and credentials |
| **Custom Metadata Extraction Model** | Organization-level custom metadata extraction model configuration    |

Paused state is shown as below:

<figure><img src="/files/N9Spy0i513if2X8l1iji" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
While a recipe is in a paused state, the Save button is disabled. You cannot modify and save recipe configuration until the paused run is either resumed or canceled. This prevents configuration drift between the paused state and the live recipe settings.
{% endhint %}

### Pause Notification Email

When a recipe is paused, an email is sent to all configured notification recipients.&#x20;

The email includes:

* The recipe name, run ID, and dataset ID.
* The timestamp of when the pause occurred.
* A breakdown of detected changes (additions, deletions, updates) alongside the configured thresholds, with a clear indication of which thresholds were exceeded.
* If the pause was triggered by a settings change, the email lists which processing settings were modified (e.g., chunking, embeddings, OCR).
* Recommended next steps: review the changes, unpause to continue, or cancel the run.

### Unpausing a Recipe

When a recipe is in a paused state, the "Run" button in the recipe top bar changes to "Unpause." A "Cancel Paused Run" button also becomes available. Users can resume execution by unpausing the recipe, with updated changes applied.

<figure><img src="/files/UruhIT5T2ezRE2Mgg0rZ" alt=""><figcaption></figcaption></figure>

Recipe run details display the pause information, as shown below.

<figure><img src="/files/8puMAxhwjWupsXvpVBCN" alt=""><figcaption></figcaption></figure>

To resume a paused recipe:

1. Navigate to the paused recipe.
2. Click the **Unpause** button.
3. A confirmation dialog will appear asking "Do you want to resume the paused recipe?" - select **Yes** to proceed.
4. The recipe resumes processing from where it was paused. It picks up using the saved state, so items from datasets that were already processed before the pause are not re-listed or re-fetched.
5. Once the resume succeeds, the saved pause state is automatically cleaned up.

Only users with **Admin role** can unpause a recipe.

### Canceling a Paused Run

If you decide the detected changes should not be applied, you can cancel the paused run instead of resuming it.

1. Navigate to the paused recipe.
2. Click the **Cancel Paused Run** button.
3. The recipe run is marked as canceled, the processing state is cleared, and no changes are applied to the knowledge base.

### Scheduling and Paused Recipes

Recipes can be configured to run on a schedule either as a one-time future run or on a recurring basis (e.g., every hour, daily, weekly). The scheduler operates independently and triggers recipe runs automatically when the scheduled time arrives.

#### How Scheduling Interacts with Pause

When a scheduled run is triggered, it calls the same processing endpoint as a manual run. This endpoint includes a guard that checks the recipe's current status before starting execution:

* If the recipe is in a "paused" state, the scheduled run is rejected. The system will not start a new run on top of an existing paused run. The scheduled trigger effectively becomes a no-op for that cycle.
* For recurring schedules, the next scheduled date is still advanced to the next interval regardless of whether the run was blocked. This means the scheduler does not retry the failed trigger-it simply moves on to the next occurrence.
* For one-time schedules, the schedule entry is removed after the trigger fires, even if the recipe was paused and the run did not execute.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://karini-ai.gitbook.io/karini-ai-documentation/recipes/knowledgebase-recipe/pause-and-unpause-recipe-runs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
