> For the complete documentation index, see [llms.txt](https://doc.wearepatchworks.com/product-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.wearepatchworks.com/product-documentation/company-management/company-insights/company-insights-overview/about-data-usage.md).

# About data usage

## Introduction

Data usage is calculated by aggregating the size of payloads that leave each shape in a process flow - these are known as *payloads out*.&#x20;

In any process flow, data is received and passed from one shape to the next. Different shapes handle their incoming payload(s) in different ways - in some cases, data simply passes through (data in is the same as data out) but in others, data is manipulated and changed. &#x20;

Understanding how these payloads are aggregated provides a clearer picture of your overall data usage.

## What is a payload out?

A *payload* is the data generated/processed during the execution of any shapes within a flow. We refer to the *payload out* when it leaves that shape. This could be via any of the mechanisms below:

<table><thead><tr><th width="237">Mechanism</th><th>Summary</th></tr></thead><tbody><tr><td>Patchworks API call</td><td>Data is received from or sent to an API call.</td></tr><tr><td>Connector shape</td><td>Data is received from or sent to a Patchworks connector.</td></tr><tr><td>Other shapes</td><td>Data is processed within any shape - for example, by a custom script (script shape or transform function), mapping payloads from one structure to another (map shape), or routing payloads down multiple branches (route shape).</td></tr><tr><td>File transfers</td><td>Data moves between systems - for example, CSV files or image files.</td></tr><tr><td>Database queries</td><td>Data is fetched from or inserted into a database.</td></tr><tr><td>Triggers</td><td>Data is sent/received via an event, webhook or Patchworks API call.</td></tr></tbody></table>

## How data usage is calculated

To calculate data usage, all *payload out* sizes (from each shape in a process flow) are aggregated. Here's how this works:

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><strong>(1) Identify interactions</strong> <br>Every time a shape in your process flow performs a manipulation, moves data or sends/receives data between systems, an <em>interaction</em> occurs. This could be an API call, a file upload, or any other data transfer/manipulation.</td><td></td><td></td><td><a href="/files/zoVznPrvKj7jwEpw5Q9f">/files/zoVznPrvKj7jwEpw5Q9f</a></td></tr><tr><td><strong>(2) Measure payload sizes</strong><br>For each <em>interaction</em>, the size of the <em>payload out</em> is measured in megabytes.</td><td>Only the actual payload is considered - metadata, headers, and other non-payload data are NOT considered when calculating the <em>payload out</em> size.</td><td></td><td><a href="/files/K5rxRu5TnRBok5tDb5fj">/files/K5rxRu5TnRBok5tDb5fj</a></td></tr><tr><td><strong>(3) Aggregate payload sizes</strong><br>All payload sizes are aggregated to calculate the total data usage.</td><td></td><td></td><td><a href="/files/rvCqekbu12fYUX1uzpP9">/files/rvCqekbu12fYUX1uzpP9</a></td></tr></tbody></table>

## Considerations for your data usage

Typically, the size of a payload that goes into a process flow shape is the same as the *payload out* size - payloads are not modified unless your flow includes actions that are designed to do this.

The table below summarises process flow shapes and their ability to change the size of incoming payloads:

<table><thead><tr><th width="203">Shape</th><th width="141">Change size?</th><th>Notes</th></tr></thead><tbody><tr><td><a href="/pages/aGi157tdOz4wMkNdBOWh">Add to cache</a></td><td>No</td><td>The <em>payload out</em> is always the same as the incoming payload.</td></tr><tr><td><a href="/pages/UImyCH9s7yBX09kl8KKy">Assert</a></td><td>No</td><td>The <em>payload out</em> is always the same as the incoming payload.</td></tr><tr><td><a href="/pages/ksVeuo8Bz6ah8fn0PpJx">Connector</a></td><td>Yes</td><td><p>When <em>receiving</em> data, the <em>payload out</em> will reflect the volume of data received from this connection request. </p><p></p><p>When <em>sending</em> data, the <em>payload out</em> will be the same as the incoming payload UNLESS you choose to <code>save response as payload</code> (in which case the <em>payload out</em> is - typically - smaller than the incoming payload).</p></td></tr><tr><td><a href="/pages/LQRcBGzoCvqv2cEsqUsZ">De-dupe</a></td><td>No</td><td><p>If set to <code>filter</code> or <code>track &#x26; filter</code>, a de-dupe shape may reduce the size of the incoming payload by removing duplicate items. </p><p></p><p>If set to <code>track</code>, the incoming payload simply passes through for tracking - the payload out will always be the same as the incoming payload.</p><p></p><p>A de-dupe shape will never increase the size of the <em>payload out</em>.</p></td></tr><tr><td><a href="/pages/W8dQNd0BPMY9SOSg7haK">Filter</a></td><td>Yes</td><td>If a filter removes data from an incoming payload, the <em>payload out</em> will be smaller than the incoming payload. A filter will never increase the size of the <em>payload out</em>.</td></tr><tr><td><a href="/pages/uNI6ZNhC4NnwLaAhP1yN">Flow control</a></td><td>No</td><td>The incoming payload is batched into multiple, smaller batches but the aggregate size of the <em>payload out</em> for those batches is always equal to the incoming payload size. </td></tr><tr><td><a href="/pages/0Fl03CW16xxoUrQrDhqo">Load from cache</a></td><td>Yes</td><td>The <em>payload out</em> will reflect the volume of data loaded from the cache.</td></tr><tr><td><a href="/pages/sDacY10PFWZPapzdTUvr">Map</a></td><td>Yes</td><td>A straightforward like-for-like mapping between two systems will not affect the size of the payload out. However, if <a href="/pages/HDn9NDKmYejdH2cKYLTv">transform functions</a> are applied the size of the <em>payload out</em> may change slightly - for example, <code>prefix</code>, <code>suffix</code>, <code>format date</code> and <code>script</code> transforms. <br><br>Typically, any size variations from mapping transformations are small.</td></tr><tr><td><a href="/pages/4NgngMhzA8xLo7xLd51X">Manual payload</a></td><td>No</td><td>The <em>payload out</em> is always the same as the incoming payload.</td></tr><tr><td><a href="/pages/7qvE65C5mdtXjrbB4swe">Route</a></td><td>Yes</td><td><p>When an incoming payload hits a <em>route</em> shape, your defined conditions are checked and a <em>payload out</em> is created for each defined route. </p><p></p><p>If your route conditions exclude items in the incoming payload from progressing down any routes then the aggregate size of <em>payloads out</em> will be smaller than the incoming payload.</p></td></tr><tr><td><a href="/pages/1YdpDOKiycGviDZd7krP">Run process flow</a></td><td>Yes</td><td>If you configure this shape with a manual payload then the payload out is likely to differ from any incoming payload. <br><br>If no manual payload is specified then the <em>payload out</em> is always the same as the incoming payload.</td></tr><tr><td><a href="/pages/0C93Lh1WJuGoTR9rN6NN">Script</a></td><td>Yes</td><td>A custom script might increase or decrease the size of the <em>payload out</em>. </td></tr><tr><td><a href="/pages/T9gT7vCqVNpdJ4mwYRsa">Set variables</a></td><td>No</td><td>The <em>payload out</em> is always the same as the incoming payload.</td></tr><tr><td><a href="/pages/fQWZMN73bKUIontUN4LA">Split</a></td><td>Yes</td><td>The incoming data is split at a defined data element, so only that element progresses to the next step - i.e. the payload out is likely to be smaller than the incoming payload.</td></tr><tr><td><a href="/pages/Y1n6bZHdxkq19kbUGscv">Track data</a></td><td>No</td><td><p>The incoming payload simply passes through for tracking - the payload out will always be the same as the incoming payload.</p><p></p><p>A track data shape will never increase the size of the <em>payload out</em>. </p></td></tr></tbody></table>

### Examples

The examples below show how data usage can be affected by different process flow shapes. &#x20;

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><img src="/files/8zcYKejtKI3CZvfTPGM6" alt=""></td><td><p></p><p>In the simplest of flows, a <em>connector</em> shape receives a 1MB payload, so the first <em>payload out</em> is <strong>1MB</strong>. </p><p></p><p>The <em>map</em> shape receives this as its incoming payload. There are no field transformations so the data doesn't change - the second <em>payload out</em> is <strong>1MB</strong>. </p><p></p><p>The final <em>connecto</em>r shape receives this as its incoming payload to be sent into the associated system. We have NOT set the save response as payload option to <code>on</code>, so the <em>payload out</em> is <strong>1MB</strong>.   </p><p></p><p>The aggregate total for the <em>payload out</em> size for all three shapes is <strong>3MB</strong>.</p></td><td></td><td><a href="/files/sFcaHnKaslPJZkRJ0XTQ">/files/sFcaHnKaslPJZkRJ0XTQ</a></td></tr><tr><td><p><img src="/files/8Y1D1d6JUzJaHLtdzwjC" alt=""></p><p></p><p>Here, a <em>connector</em> shape receives a 1MB payload, so the first <em>payload out</em> is <strong>1MB</strong>. </p><p></p><p>The <em>de-dupe</em> shape receives this as its incoming payload and filters out all duplicate records, reducing the payload size. The next <em>payload out</em> is <strong>0.75MB</strong>.</p><p></p><p>The map shape receives this as its incoming payload. There are no field transformations so the data doesn't change - the next <em>payload out</em> is <strong>0.75MB</strong>. The <em>flow control</em> shape receives this as its incoming payload and batches it into 10 payloads for onward processing. The next <em>payload out</em> is <strong>10 x 75K</strong>.</p><p></p><p>The second connector receives all 10 payloads to be sent into the associated system. We have NOT set the save response as payload option to <code>on</code>, so the <em>payload out</em> is <strong>10 x 75K</strong>.  Finally, all 10 payloads pass through the <em>de-dupe</em> shape for tracking only. The <em>payload out</em> is <strong>10 x 75K</strong>.   </p><p></p><p>The aggregate total for the <em>payload out</em> size for all shapes is <strong>4.75MB.</strong></p></td><td></td><td></td><td><a href="/files/MTORGGfttFhKKy5WmGXZ">/files/MTORGGfttFhKKy5WmGXZ</a></td></tr><tr><td><p><img src="/files/CVdllRXDXXRtmmndTKrY" alt=""></p><p></p><p>Here, a <em>connector</em> shape receives a 1MB payload, so the first <em>payload out</em> is <strong>1MB</strong>. </p><p></p><p>This payload is added to a cache, and the next <em>payload out</em> is <strong>1MB</strong>. This payload is passed to a <em>route</em> shape with conditions that send half the payload down one route and half down the other - resulting in <strong>2 x 0.5MB</strong> payloads out. </p><p></p><p>For <em>route 1,</em> the first 0.5MB payload passes through a <em>track data</em> shape and the <em>payload out</em> is <strong>0.5MB</strong>. The <em>map</em> shape receives this as its incoming payload and there are no field transformations so the data doesn't change - the <em>payload out</em> is <strong>0.5MB</strong>. The final connector receives this as its incoming payload to be sent into the associated system. We have NOT set the save response as payload option to <code>on</code>, so the <em>payload out</em> is <strong>0.5MB</strong>.   </p><p></p><p>For <em>route 2,</em> the first 0.5MB payload is received by the <em>map</em> shape - there are no field transformations so the data doesn't change - the <em>payload out</em> is <strong>0.5MB</strong>. The final connector receives this as its incoming payload to be sent into the associated system. We have NOT set the save response as payload option to <code>on</code>, so the <em>payload out</em> is <strong>0.5MB</strong>.   </p><p></p><p>The aggregate total for the <em>payload out</em> size for all shapes is <strong>5.5MB</strong>.</p></td><td></td><td></td><td><a href="/files/DVMxzLQClyPxWKL9jwEx">/files/DVMxzLQClyPxWKL9jwEx</a></td></tr><tr><td><p><img src="/files/JypbSua2xO189AjIDuwS" alt=""></p><p></p><p>Here, a <em>connector</em> shape receives a 1MB payload, so the first <em>payload out</em> is <strong>1MB</strong>. </p><p></p><p>This payload is added to a cache, and the next <em>payload out</em> is <strong>1MB</strong>. Then we <em>load cache</em> data from an existing company cache which is 50MB, so the next <em>payload out</em> is <strong>50MB</strong>.</p><p></p><p>The <em>script</em> shape receives this as its incoming payload and runs - it doesn't do anything that affects the payload size so the next <em>payload out</em> is <strong>50MB</strong>.</p><p></p><p>The map shape receives this as its incoming payload. There are no field transformations so the data doesn't change - the next <em>payload out</em> is <strong>50MB</strong>. </p><p></p><p>The final connector receives this as its incoming payload to be sent into the associated system. We have NOT set the save response as payload option to <code>on</code>, so the <em>payload out</em> is <strong>50MB</strong>.   </p><p></p><p>The aggregate total for the <em>payload out</em> size for all shapes is <strong>202MB</strong>.</p></td><td></td><td></td><td><a href="/files/LI648kmmfWe3mA5K34hI">/files/LI648kmmfWe3mA5K34hI</a></td></tr></tbody></table>


---

# 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://doc.wearepatchworks.com/product-documentation/company-management/company-insights/company-insights-overview/about-data-usage.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.
