# Real-time run logs

## Introduction

When a process flow is running, the `logs` panel provides real-time information about the progress of each step. This is a great way to monitor what's happening during each step of the flow.&#x20;

## Working with real-time logs

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FpLMO12yvTCxi9PorCt53%2Ficons8-film.svg?alt=media&#x26;token=e59864bc-2d97-4f98-966c-a083c18e60db" alt="" data-size="line"> Show me</summary>

![](https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F7MI7I89kbuYtpZ0RLt3W%2Fdemo%20process%20flow%20logs.gif?alt=media\&token=deb2f1b2-aa14-4db0-88ea-16c4e82b38cc)

</details>

As a flow progresses, click the 'tick' icon for a shape to view information for that step - for example:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FAK2Vmb9tXIHYwOTLAwSc%2Frealtime%20logs%201a.png?alt=media&#x26;token=33499bf4-c7c7-43c0-b13f-fd7609cc8834" alt=""><figcaption></figcaption></figure>

You can drag this panel anywhere on the canvas. If you prefer to work with a larger window, click the 'pop-out' icon:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FdZWauMJkskURz18K9ip5%2Frealtime%20logs%201b.png?alt=media&#x26;token=6e494288-eec0-44ee-8d5a-c3b543a524d2" alt="" width="375"><figcaption></figcaption></figure></div>

## Log details

Details are provided over a series of tabs:

* [Logs](#logs)
* [Payloads](#payloads)
* [Failed payloads](#failed-payloads)
* [Requests](#requests)
* [Responses](#responses)
* [Metadata](#metadata)

### Logs

The `logs` tab provides a commentary about the status of the process flow as it progresses through each step - 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%2FgRXebGXOWbTUfd8mllmJ%2Fdetails%20panel%20-%20logs.png?alt=media&#x26;token=2bf7c268-1b1f-4487-944c-60c60f8a68d5" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
Look out for warnings displayed in different colours:

* Orange: warning
* Red: error
* Blue: [virtual environment](https://doc.wearepatchworks.com/product-documentation/virtual-environments) replacement swap&#x20;
  {% endhint %}

### Payloads

The `payloads` The tab shows the payload for the selected step in the process flow, so you can see exactly what has happened to your data at every stage. 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%2F4B9eeLMv5nGbD31g2dbB%2Fdetails%20panel%20-%20payloads%20a.png?alt=media&#x26;token=6851664a-0908-488b-b64f-19c67da51228" alt=""><figcaption></figcaption></figure></div>

If a shape generates multiple payloads (for example, where a [flow control shape](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/flow-control-shape) batches data into smaller payloads, or if incoming data is paginated), you can choose which one to view - 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%2FHQIvxhrHzmNGh7mTnzqv%2Fdetails%20panel%20-%20payloads%20b.png?alt=media&#x26;token=24d00b91-3cbb-4819-a704-a1e1dc1a052d" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
You can use the `pretty print` option to format the payload in a more readable form. A `download` option is also available, so you can save failed payloads locally (for example, you might want to amend any data issues and send the amended version into a 'sweeper' process flow via the [manual payload](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/manual-payload-shape) shape).&#x20;
{% endhint %}

{% hint style="info" %}
If a payload is too large to display, it is trimmed, and a `download` option is available for offline viewing.
{% endhint %}

### Failed payloads

If the [remove failed payloads](https://doc.wearepatchworks.com/product-documentation/building-process-flows/process-flow-settings#understanding-process-flow-settings) option is toggled `on` in [process flow settings](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-settings) OR a [try/catch shape](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/try-catch-shape) has found exceptions, this tab displays any payloads that were removed in this run:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FLdmj394LBKjUhlXCqaRO%2Fdetails%20panel%20-%20failed%20payloads.png?alt=media&#x26;token=c7af1477-8c8c-4feb-b7f1-1963b6e605cd" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
You can use the `pretty print` option to format the payload in a more readable form. A `download` option is also available, so you can save failed payloads locally (for example, you might want to amend any data issues and send the amended version into a 'sweeper' process flow via the [manual payload](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/manual-payload-shape) shape).&#x20;
{% endhint %}

If multiple payloads are removed, you can choose which one to view - 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%2FDFCug9DqKrttFV9pK6SV%2Frealtime%20logs%20-%20failed%20payloads%202.png?alt=media&#x26;token=5ae95bd0-b3f4-4709-bd0f-accb4c315c47" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="info" %}
Failed payloads are added to a 'payload metadata' object, together with error information. You can view this from the [metadata](#metadata) tab.
{% endhint %}

### Requests

The `requests` tab shows details of the API request made for the selected shape - 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%2Fnpse7C2LCCgwS1yKlaGE%2Fdetails%20panel%20-%20requests.png?alt=media&#x26;token=c60d4bb6-7362-4d32-b406-4b84ccfe9bc4" alt=""><figcaption></figcaption></figure></div>

Here you can see the API request `URL`, `method`, `body` content and `headers`. If multiple requests are made (for example, if a connection fails the first time) you can use the request dropdown list to view each one.

### Responses

The `responses` tab shows details of the API response received for the selected shape - 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%2FxjV3OPB1grHpJWDQpkfS%2Fdetails%20panel%20-%20responses.png?alt=media&#x26;token=7b185465-d869-420c-bd8d-dd32be38cbf1" alt=""><figcaption></figcaption></figure></div>

Here you can see the API response `status`, `body` content and `headers`. If multiple responses are received,  you can use the response dropdown list to view each one.

### Metadata

The `metadata` tab shows payload metadata for the selected shape - 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%2FPDp5sxhJVqAqnwTDqSDW%2Fdetails%20panel%20-%20metadata.png?alt=media&#x26;token=a52a778a-b8e5-48ce-b7aa-f4e2427b5c2a" alt=""><figcaption></figcaption></figure></div>

Here, you can see metadata associated with payloads for the give step (via a [script](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/advanced-shapes/script-shape) or the [set variables](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/set-variables-shape) shape).

If incoming payloads are received via a connector, you'll find connection information before the metadata. For example:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fmc3woui5T1ZYuYovtvnQ%2Fmetadata%20with%20connection%20info.png?alt=media&#x26;token=889cb769-fe54-4e5e-a9fa-3f7718384611" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If a run includes [failed payloads](#failed-payloads), you'll find the failed payload here, together with error information. If the payload exceeds the maximum number of characters allowed (5000), the error message content is truncated. In rare cases, it may also be necessary to truncate the payload element. [Run logs](https://doc.wearepatchworks.com/product-documentation/process-flows/error-reporting-and-exception-handling/run-logs-and-queue) indicate where data was truncated.&#x20;
{% endhint %}
