# Working with run logs

## Introduction

Having accessed the `process flow run logs` page, the `active` tab displays active and previous process flow runs. These are listed chronologically based on the run start time:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Ft8cpe4ZuhubmOuahgbD4%2Frun%20logs%20page.png?alt=media&#x26;token=3df57664-85e1-42af-9f98-69f50288b7d3" alt=""><figcaption></figcaption></figure>

At a glance, you can see the outcome of a run, the start date/time, the duration, how the run was triggered and whether there were any warnings. You can also access [additional options](#additional-options) for detailed logs, and more.&#x20;

By default, logs are displayed for the last seven days. You can change this using the associated date filter - here, you can clear all [filters](#filters) to show [all available logs](#log-retention), or add rules to apply a new [date/time range](#finding-logs-by-date):

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FkMLChsiKlOWFTXQ5lWuR%2Frun%20logs%20-%20add%20date%20rule%201.png?alt=media&#x26;token=df7b675e-eafd-4d92-a00b-9c7ccab55671" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
Click the name of a process flow to access its setup.
{% endhint %}

{% hint style="info" %}
If a process flow is running, it is displayed with a 'stop' button that you can use to [stop the run](https://doc.wearepatchworks.com/product-documentation/process-flows/managing-process-flows/stopping-a-running-process-flow).
{% endhint %}

### Need to know

* Run logs are retained for 7 days.
* Payloads are retained for 72 hours.
* Payloads are stored in AWS S3 (eu-west-2 London).
* Payloads are encrypted during pull/push operations (HTTPS, TLS 1.2/1.3).
* There is a limit on the number of process flow runs that can be started per minute. This limit varies according to your subscription tier - please see [Core subscription tiers](https://doc.wearepatchworks.com/product-documentation/getting-started/core-subscription-tiers) for information.

## Searching run logs

If you're looking for a specific log, you can use the search field to search by `flow run id` or by process flow name:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FYnzmBHbzAp12rVPYjuCM%2Frun%20logs%203.png?alt=media&#x26;token=3b2e9433-55ae-4792-a42a-cf1ac033fa25" alt=""><figcaption></figcaption></figure></div>

#### Searching by flow run ID

If you want to find logs for a specific `flow run id`, type the full id into the search field - for example:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FAGJqWi3FHTnyBJWozRS1%2Frun%20logs%204.png?alt=media&#x26;token=34604226-daaf-4964-9cd0-4079d1ff08a3" alt=""><figcaption></figcaption></figure>

You must enter the id in full; partial elements are not matched.&#x20;

{% hint style="info" %}
A `flow run id` search is not case sensitive. Entering `01j6errxr432r4k4dh41y5ttpc` is the same as `01J6ERRXR432R4K4DH41Y5TTPC` or `01J6eRRxR432r4K4DH41Y5ttPC`.
{% endhint %}

#### Searching by flow name

If you want to find logs for a process flow that you only know by name, type any part of the name into the `search` field - for example:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FAU4zLOoECxJuQDO1hDGO%2Frun%20logs%205.png?alt=media&#x26;token=c549053e-071d-4dbc-af58-6b24bd47c831" alt=""><figcaption></figcaption></figure>

You can enter as much or as little of the name as you like.&#x20;

{% hint style="info" %}
A flow name search is not case sensitive - entering `CHECK` is the same as `check` or `Check`.
{% endhint %}

## Filtering run logs

Use filters to refine the list based on the value associated with a particular column. Currently, you can filter logs by:

* Started at date
* Trigger (schedule, manual, API, etc.)
* Has warnings
* Status

To define a filter, click the filter icon associated with a column - for example:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FrJo87B6hQj6odvbfAD1t%2Frun%20logs%204.png?alt=media&#x26;token=010a7035-6643-4da6-9dba-1d9ea5379c48" alt=""><figcaption></figcaption></figure></div>

...then make selections from the options provided - for example:

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><p>The date filter displays date/time rule pickers:</p><p><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FkvfxFS3PQLbVOOGNP14y%2Frun%20logs%20-%20add%20date%20rule%202.png?alt=media&#x26;token=5a883e0d-37ef-4981-a7de-1b4a6bcb9617" alt="" data-size="original"></p></td><td></td><td></td></tr><tr><td>The date filter displays date/time rule pickers:<img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F0uyibgfdhsPS5jNfRX2h%2Frun%20logs%20-%20status%20filter.png?alt=media&#x26;token=78d961fd-dd8b-4e47-a2ae-ef5514fe9be0" alt="" data-size="original"></td><td></td><td></td></tr></tbody></table>

## Understanding the run status

The status of a run will be one of the following:

<table><thead><tr><th width="238">Status</th><th>Summary</th></tr></thead><tbody><tr><td>Success</td><td>The process run was completed success without errors.</td></tr><tr><td>Partial success</td><td>The process flow run was completed successfully however, at least one <a href="../../../building-process-flows/process-flow-settings#understanding-process-flow-settings">failed payload was removed</a>.</td></tr><tr><td>Failure</td><td>The process run did not complete due to errors. See <a href="#handling-flow-run-failures">Handling flow run failures</a> for more information.</td></tr><tr><td>Retried</td><td><p>The failed run has been <a href="#retrying-a-failed-run">retried</a>. The colour associated with  this status correlates to the outcome of that retry:<br></p><ul><li><mark style="background-color:blue;">Blue</mark>. The retry is running now (look for a correlating <code>running</code> entry in the logs)</li><li><mark style="background-color:green;">Green</mark>. The retry completed successfully (look for a correlating <code>success</code> entry in the logs).</li><li><mark style="background-color:red;">Red</mark>. The retry failed (look for a correlating <mark style="background-color:red;"><code>failure</code></mark> entry in the logs).</li></ul></td></tr><tr><td>Stopped</td><td>The process flow was <a href="../../../building-process-flows/the-process-flow-canvas#the-actions-bar">stopped manually</a>.</td></tr><tr><td>Running</td><td>The process flow is currently running. If you have lots of running flows that must be stopped, you can use a <a href="working-with-run-logs/handling-failed-process-flow-runs/retrying-or-stopping-multiple-flow-runs-bulk-actions">bulk action</a> to stop all current runs.</td></tr></tbody></table>

## Handling flow run warnings

If warnings are given during a run (be it failed or successful), the entry is shown with an icon in the `Has warnings` column - for example:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FtFMBEZKMLfaqx07E04Az%2Frun%20logs%20-%20has%20warnings.png?alt=media&#x26;token=b35eb8b1-59a3-40c9-b6da-0cd0c862c53a" alt=""><figcaption></figcaption></figure>

If the run [failed](#handling-flow-run-failures), review [detailed logs](https://doc.wearepatchworks.com/product-documentation/process-flows/error-reporting-and-exception-handling/run-logs-and-queue/working-with-run-logs/viewing-detailed-logs-for-a-flow-run) to check these warnings, then make any necessary changes to your process flow.

If the run succeeded, you should still review the logs for warnings in case the issue causes a future failure.&#x20;

## Handling flow run failures

A process flow run may fail for any number of reasons - for example, perhaps a connected system is unavailable or expected data schemas/types have changed.

When a process flow run fails, its status is set to `failure` and an expandable arrow is shown to the left of the entry - click this arrow to view a summary of why the failure occurred. For example:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FaQlFcclfttU658GgXTsO%2Frun%20logs%20summary%20fail%20reason.png?alt=media&#x26;token=101c80fc-31f6-4528-aa2f-e4a3d6b54bb3" alt=""><figcaption></figcaption></figure></div>

Having confirmed/resolved any issues with a failed flow run, you can use the [retry option](https://doc.wearepatchworks.com/product-documentation/process-flows/error-reporting-and-exception-handling/run-logs-and-queue/working-with-run-logs/handling-failed-process-flow-runs/retrying-a-failed-process-flow-run) to try again or - if there are lots of failures - use a [bulk action](https://doc.wearepatchworks.com/product-documentation/process-flows/error-reporting-and-exception-handling/run-logs-and-queue/working-with-run-logs/handling-failed-process-flow-runs/retrying-or-stopping-multiple-flow-runs-bulk-actions) to retry all current failures.

## Aditional options

Each log entry has an ellipses icon, with access to additional options:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fxy1vUQBkTkfO8O6tdLdr%2Frun%20logs%20-%20additional%20options%20b.png?alt=media&#x26;token=4ae36402-0a3b-4c6a-8efd-b6464444fdc2" alt="" width="563"><figcaption></figcaption></figure></div>

From here you can:

<table><thead><tr><th width="213.24609375">Option</th><th>Summary</th></tr></thead><tbody><tr><td><code>View logs</code></td><td>Access more insights and detailed logs for this run. For more information, please see <a href="working-with-run-logs/viewing-detailed-logs-for-a-flow-run">Viewing logs</a>.</td></tr><tr><td><code>View logs (classic)</code></td><td>If you prefer to work with 'original style' logs, you can access them from here. For more information, please see <a href="working-with-run-logs/viewing-logs-classic">Viewing logs (classic)</a>.</td></tr><tr><td><code>Download logs</code></td><td>Use this option to download detailed logs in CSV format. For more information, please see <a href="working-with-run-logs/downloading-run-logs">Downloading run logs</a>.</td></tr><tr><td><code>Retry the flow run</code></td><td>Use this option to retry a process flow run that previously failed. For more information, please see <a href="working-with-run-logs/handling-failed-process-flow-runs/retrying-a-failed-process-flow-run">Retrying a failed process flow run</a>.</td></tr></tbody></table>

## Deleted flow versions

If a flow version has been run and subsequently deleted, existing run logs for the deleted version are retained as per [standard retention rules](#need-to-know).&#x20;

{% hint style="info" %}
Perhaps the most typical scenario for [deleting a flow version](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-versioning) is where a later iteration of the flow is deployed, and the now `inactive` version is removed as part of a 'housekeeping' exercise.
{% endhint %}

This means you can view run log information for the deleted flow, but the flow version itself cannot be accessed. For clarity, you will see two indications that the flow version associated with a run has been deleted.&#x20;

First, you'll see a `(deleted)` tag after the flow name in the `process flow run logs` list. For example:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FFX6t4xFxen27RtcY6Zd9%2Frun%20logs%20-%20deleted%20flow%20version%20a.png?alt=media&#x26;token=5d0d6645-33e9-422c-a023-e5663a18cfe0" alt=""><figcaption></figcaption></figure></div>

If you go on to view logs for one of these entries, you'll see a warning message against the flow version. For example:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FMiSTHMHoBwXsT4hFerrM%2Frun%20logs%20-%20deleted%20flow%20version%20b.png?alt=media&#x26;token=05ca1b7c-553b-4034-a0f6-ebd7746f43c1" alt=""><figcaption></figcaption></figure></div>

## Related information

* [Viewing logs](https://doc.wearepatchworks.com/product-documentation/process-flows/error-reporting-and-exception-handling/run-logs-and-queue/working-with-run-logs/viewing-detailed-logs-for-a-flow-run)
* [Viewing logs (classic)](https://doc.wearepatchworks.com/product-documentation/process-flows/error-reporting-and-exception-handling/run-logs-and-queue/working-with-run-logs/viewing-logs-classic)
* [Downloading run logs](https://doc.wearepatchworks.com/product-documentation/process-flows/error-reporting-and-exception-handling/run-logs-and-queue/working-with-run-logs/downloading-run-logs)
* [Retrying a failed process flow run](https://doc.wearepatchworks.com/product-documentation/process-flows/error-reporting-and-exception-handling/run-logs-and-queue/working-with-run-logs/handling-failed-process-flow-runs/retrying-a-failed-process-flow-run)
* [Working with your run queue](https://doc.wearepatchworks.com/product-documentation/process-flows/error-reporting-and-exception-handling/run-logs-and-queue/working-with-your-run-queue)
* [Email notifications for failed process flow runs](https://doc.wearepatchworks.com/product-documentation/process-flows/error-reporting-and-exception-handling/email-notifications-for-failed-process-flow-runs)
