# Cache

## Introduction

When a process flow runs, the payload for received data flows through to subsequent steps. In a straightforward scenario we pull data from one connection, then perhaps apply filters and/or scripts before mapping/transforming data fields and finally pushing the payload into a target connection. This is a very linear example - we start with a  payload and it flows all the way through to completion.&#x20;

However, more complex scenarios might need to use a payload that was generated several steps previously, or even from a different process flow. This is where the [add to cache](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/advanced-shapes/cache/add-to-cache-shape) and [load from cache](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/advanced-shapes/cache/load-from-cache-shape) shapes come in.&#x20;

Wherever you place an **add to cache** shape shape in a process flow, it will cache (i.e. store a copy of) the payload as it stands at that point in the process flow. You can then use a **load from cache** shape to reference this payload elsewhere in the same process flow and/or in other process flows for your organisation (depending on how the **add** **to** **cache** shape is [configured](#add-to-cache-shape-settings)).&#x20;

## Demo

{% embed url="<https://www.youtube.com/watch?v=NiVxv6lV1zU>" %}

## More information

For more information please see:

* [Add to cache shape](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/advanced-shapes/cache/add-to-cache-shape)
* [Load from cache shape](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/advanced-shapes/cache/load-from-cache-shape)
