> 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-operations.md).

# About operations

## Introduction

In Patchworks, an `operation` is counted whenever a request is made to send or receive a payload to/from an endpoint or query.

Crucially, we're not concerned with the number of items in the payload - we simply count the number of times a process flow requests to send or receive a payload. This might happen in several ways:

<table><thead><tr><th width="237">Mechanism</th><th>Summary</th></tr></thead><tbody><tr><td>Connector shape</td><td>A request is made (successfully or otherwise) to <em>receive</em> data from a specified endpoint/query.</td></tr><tr><td>Connector shape</td><td>A request is made (successfully or otherwise) to <em>send</em> data to a specified endpoint/query.</td></tr><tr><td>Webhook trigger</td><td>A <code>webhook</code> is <em>received</em> (with or without a payload) in the first step of the process flow.</td></tr><tr><td>Event trigger</td><td>An <code>event</code> is <em>received</em> (with or without a payload) in the first step of the process flow.</td></tr><tr><td>Patchworks API call</td><td>A <code>Patchworks API call</code> is <em>received</em> (with or without a payload) in the first step of the process flow.</td></tr></tbody></table>

## Considerations for your operations count

The number of payloads that a process flow sends or receives correlates with the number of operations logged. In the most straightforward case, you might create a process flow that always *receives* a single, unpaginated payload from one system and then *sends* a single, unpaginated payload to another system - this would be an operations count of 2.

However, as the complexity of a process flow increases, so too does the potential for an increase in the number of payloads being processed. The most likely ways that this can happen are:

**Paginated data.** If you receive paginated data, you receive 1 payload for each page of data - so each page represents 1 *receive* operation. In short, an initial data pull can result in multiple *receive* operations. And if you receive multiple pages, it follows that multiple pages continue through the flow - which means (potentially) multiple pages will be sent into your destination system, resulting in multiple *send* operations.

**Flow control.** The [flow control](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/flow-control-shape.md) shape is typically used to batch an incoming payload into multiple, smaller payloads for onward processing. So, even if you start by *receiving* 1 payload, it's likely that you will be *sending* multiple payloads at the end of the flow.

{% hint style="info" %}
Retries for failed connection requests are included in your operations count. For more information on connector retry settings, please see [Understanding how data flows through shapes (retries)](/product-documentation/process-flows/building-process-flows/understanding-how-data-flows-through-shapes.md#retries).
{% endhint %}

### Examples

The examples below show the impact that these scenarios can have on operation counts:

<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><p>In the simplest of flows you might <strong>receive</strong> 1 payload from a source endpoint which contains 350 records in a single, unpaginated payload. The flow goes on to <strong>send</strong> that payload to a destination endpoint.</p><p>This results in <strong>2</strong> operations - 1 for the <strong>receive</strong> operation and 1 for the <strong>send</strong> operation.</p></td><td><img src="/files/zbC4YRmNTMtE9tSIvWuY" alt=""></td><td></td><td><a href="/files/ljiVyl0fvcnmd99N7IAi">/files/ljiVyl0fvcnmd99N7IAi</a></td></tr><tr><td><p>In a slightly more complex flow you might <strong>receive</strong> 1 payload from a source endpoint which contains 350 records in a single, unpaginated payload.</p><p>The flow continues with a <a href="/pages/uNI6ZNhC4NnwLaAhP1yN">flow control </a>shape which batches this data into smaller chunks, resulting in 5 payloads, each containing 70 records. The flow goes on to <strong>send</strong> all of these payloads to a destination endpoint.</p><p>This results in <strong>6</strong> operations - one for the <strong>receive</strong> operation and 5 for the <strong>send</strong> operations.</p></td><td><img src="/files/22ntyKwQCY5qeIp6crpJ" alt=""></td><td></td><td><a href="/files/vabJwD87u8xUVOpslH7K">/files/vabJwD87u8xUVOpslH7K</a></td></tr><tr><td><p>In this example, our incoming data is paginated as 50 records per page, so we <strong>receive</strong> 350 records as 7 payloads (50 records in each).</p><p>The flow proceeds to <strong>send</strong> all of these payloads to a destination endpoint.</p><p>This results <strong>14</strong> operations - 7 for <strong>receive</strong> operations and 7 for <strong>send</strong> operations.</p></td><td><img src="/files/Zh0UuloKPfNtsPgkpDwq" alt=""></td><td></td><td><a href="/files/WcrshValPU0ClHF0fTBw">/files/WcrshValPU0ClHF0fTBw</a></td></tr><tr><td><p>In this example, our incoming data is paginated as 50 records per page, so we <strong>receive</strong> 350 records as 7 payloads (50 records in each).</p><p>The flow continues with a <a href="/pages/uNI6ZNhC4NnwLaAhP1yN">flow control </a>shape which batches this data into single-item payloads. The flow goes on to <strong>send</strong> all of these payloads to a destination endpoint.</p><p>This results <strong>357</strong> operations - 7 for <strong>receive</strong> operations and 350 for <strong>send</strong> operations.</p></td><td><img src="/files/Ti7vZD00Yr51DhhwwdFs" alt=""></td><td></td><td><a href="/files/ZV0qrXpxYY5Yf8PSb7WP">/files/ZV0qrXpxYY5Yf8PSb7WP</a></td></tr></tbody></table>
