> ## Documentation Index
> Fetch the complete documentation index at: https://kb.mspprocess.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cache

> Keep a workflow's result ready, refreshed hourly, daily, weekly or monthly, so form dropdowns load instantly and workflows can reuse it.

Data > Cache keeps a workflow's result and refreshes it on a schedule, so a form dropdown that needs a slow lookup, such as your PSA's ticket categories, loads instantly. Workflows can read it too. You need the [Admin role](https://kb.mspprocess.com/studio/clients/team-and-permissions.md#roles).

<video controls preload="none" playsInline poster="/images/videos/studio-cache.jpg" src="https://mintcdn.com/triggr/GxrCQFDFNLmEMyJ1/images/videos/studio-cache.mp4?fit=max&auto=format&n=GxrCQFDFNLmEMyJ1&q=85&s=2820bf9aff868b44f3b9b0561b0da105" />

Cache a result: publishing a workflow's list, caching it daily, filling it now and using it in a form dropdown (1:28).

![The Cache Definitions page, Cache data to improve form loading times, with Refresh and New Cache Definition buttons and one definition, Docs sample – Ticket categories: Global scope, workflow Docs sample – Ticket categories, Daily, Enabled, with View and delete actions.](https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/data/cache-definitions.png?fit=max\&auto=format\&n=_d7ojda9vf8IHE31\&q=85\&s=e62f5ed12af10c5addb171aad6679ad1)

## Example: ticket categories for a form

**1. Publish the list from a workflow**

Build a workflow whose last data step produces the list, such as `{ "id": …, "name": … }` items from your PSA, ending at a Finish Workflow step. On that step's Settings tab, enter a variable name, tick **Publish Variable** and save (see [Save an output under a short name](https://kb.mspprocess.com/studio/workflows/expressions.md#save-an-output-under-a-short-name)).

![The List Categories step's Settings tab: Set Output As Context Variable, Context Variable Name categories, and Publish Variable ticked.](https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/data/publish-variable.png?fit=max\&auto=format\&n=_d7ojda9vf8IHE31\&q=85\&s=f46b0e09105b011da51f8a66e4cc031c)

**2. Create the cache definition**

Click **New Cache Definition**, name it, set Scope to Global, choose the workflow, enter the variable's name as the Published Variable Name, pick a Frequency and click Create Cache Definition.

![The Create New Cache Definition dialog: Name Docs sample – Ticket categories, Scope Global, Workflow Docs sample – Ticket categories, Workflow Params (JSON) an empty JSON object, Published Variable Name categories and Frequency Daily, with Cancel and Create Cache Definition buttons.](https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/data/new-cache-definition.png?fit=max\&auto=format\&n=_d7ojda9vf8IHE31\&q=85\&s=dce5558d059143724d1e896380dc3eca)

Scope starts on Per Tenant, which keeps one value per client ([Per-client caches](#per-client-caches)); Global keeps one for everyone. Leave Workflow Params as `{}`.

**3. Fill it now**

Open the definition, click **Run on Demand** and confirm; otherwise it first fills at its next scheduled time.

![The Run Cache on Demand dialog explaining it will execute the cache workflow immediately, with Cancel and Cache Data buttons.](https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/data/run-on-demand.png?fit=max\&auto=format\&n=_d7ojda9vf8IHE31\&q=85\&s=8027c59d6b042d4abf8eaecc25c47357)

**4. Check the value**

Refresh the page: Current Cache Value shows when it was filled, and Execution Logs lists each run.

![The Docs sample – Ticket categories cache page with Run on Demand, Invalidate Cache, Edit and Refresh buttons; Cache Definition Details showing Global, Enabled, Published Variable categories, Daily and Next Execution; Current Cache Value with one array entry and View Cache Data; and Execution Logs with one SUCCESS run of 1.13s.](https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/data/cache-definition.png?fit=max\&auto=format\&n=_d7ojda9vf8IHE31\&q=85\&s=5503220ffe17a1779972df8c7b9e3608)

View Cache Data shows what's stored:

![The Cache Entry Details dialog: Object Type array and a Value listing hardware, software, access and new-starter, each with an id and a name such as Access and passwords.](https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/data/cache-entry.png?fit=max\&auto=format\&n=_d7ojda9vf8IHE31\&q=85\&s=3a2fad464b645535be694ccb0c877bec)

**5. Use it in a form**

In the form designer, click a Select field, set **Options Source** to Use cache and choose the cache definition. Value Key and Label Key start as `id` and `name`; change them if your items use other fields.

![A Select field's properties with Options Source Use cache, Cache Definition Docs sample – Ticket categories, Value Key id and Label Key name.](https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/data/form-cache-options.png?fit=max\&auto=format\&n=_d7ojda9vf8IHE31\&q=85\&s=a2e23c7f4439ae386afda7910e5f9d1c)

The dropdown now lists the cached items:

![A form preview with a Category dropdown open, listing Hardware, Software, Access and passwords, and New starter.](https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/data/form-cache-preview.png?fit=max\&auto=format\&n=_d7ojda9vf8IHE31\&q=85\&s=3b19ab14ef39f0f815ec999359cf4363)

## Read it in a workflow

Add **Get Cache Data** from Cache, choose the cache definition and leave Tenant ID empty for a global cache. The stored value is in `value`: `{{ ctx.steps['Get Categories'].value }}`.

![The Get Categories step: Cache Definition Docs sample – Ticket categories and an empty Tenant ID, described as optional and left empty for global caches.](https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/data/get-cache-data-step.png?fit=max\&auto=format\&n=_d7ojda9vf8IHE31\&q=85\&s=b08bdbdb6510599a929dc7c9b93744a6)

![The Get Categories step in a run: Status success, Type get\_cache\_data, and Output with value listing the four categories, success true, executedAt, cacheDefinition, valueTypeSummary array and workflowExecutionID.](https://mintcdn.com/triggr/_d7ojda9vf8IHE31/images/studio/data/get-cache-data-output.png?fit=max\&auto=format\&n=_d7ojda9vf8IHE31\&q=85\&s=17b8d9f7d1dbec1b952cc542c5fb38c8)

| Step | What it does |
| - | - |
| Get Cache Data | Returns the stored value, or runs the workflow and waits if there isn't one yet |
| Refresh Cache Data | Runs the workflow now, waits and stores the new value |
| Invalidate Cache Data | Deletes the stored value; the next read or scheduled run fills it again |

When a workflow adds a ticket category in your PSA, for example, end it with Refresh Cache Data so the form shows it straight away.

## How it refreshes

* The frequency counts from when you created the definition: a Daily cache created at 09:10 UTC refreshes at about 09:10 UTC each day.
* A stored value stays until a run replaces it; if a run fails, forms and workflows keep the last good value and Execution Logs shows why.
* Each run has 5 minutes, and a value can be up to 10 MB.
* Invalidate Cache deletes the stored values; Edit changes the definition or disables it, and changing its workflow, published variable or scope also clears the values.

## Per-client caches

With Scope set to Per Tenant, Triggr stores a value per client, or for the clients you pick. Each run gets the client's ID in `ctx.metadata.tenantId`, so start the workflow with a Set Client From Form step to load that client's variables and integrations. A form reads the signed-in person's client's value; in Get Cache Data, set Tenant ID to `{{ ctx.client.id }}`.

## Troubleshooting

> [accordion] “published variable '…' not found in workflow result” or “no published variables found in workflow result”
>
> Check the step's Settings tab has Publish Variable ticked, the name matches the definition, and the run reaches Finish Workflow.

> [accordion] “workflow execution timed out after 5 minutes”
>
> Fetch less, or split the workflow into several caches.

> [accordion] The form's dropdown is empty
>
> The cached value must be a list of items that each have the Value Key and Label Key fields; check its shape with View Cache Data.

> [accordion] “tenantID is required for per-tenant cache definitions”
>
> The Get Cache Data step for a Per Tenant cache needs Tenant ID set to `{{ ctx.client.id }}`.

> [accordion] “cache definition is disabled”
>
> On the definition's page, click **Edit**, set it to Enabled and save.

> [accordion] Can an internal app or an AI assistant read a cache?
>
> An internal app can't. An AI assistant connected through [MCP](https://kb.mspprocess.com/studio/mcp.md) can, with Cache tools such as `get_cache_entries` and `run_cache`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.