Cache values let an endpoint, server function or event reuse temporary data. For example, save a product summary for five minutes instead of requesting it from another service every time.
A cache is temporary. Keep permanent records in your database and make sure the workflow can obtain the original data again when a cached value is missing.
In your workflow, add a command and choose Cache. The four commands use the same key to store, find or remove a value. Keys are case-sensitive: product-summary and Product-summary are different.
Use the familiar value selector to enter a key or choose a workflow variable. Give the command's result a name in Return as so later commands can use it.

Choose a Key, the Value to save and how many seconds it should last. The default is 300 seconds (five minutes). Choose a whole number from 1 to 86,400 seconds (one day). Saving the same key again replaces its value and starts the chosen duration again.
The result is true when the value was saved and false when temporary storage was unavailable. The workflow should still be able to use the original value if storage fails.

Choose the same key and sharing option used when saving. The result contains:
found: true when the entry is available; false when it has expired, was removed or cannot be read.
value: the saved data when found; otherwise null.
If Return as is cached_summary, check cached_summary.found with a condition. When true, use cached_summary.value. Otherwise, obtain a fresh summary and save it with Set cache value.
Check found rather than testing whether the value is true: false, 0, an empty list and null can all be valid cached values.

Return true if the key currently exists, or false if it is missing or unavailable. This does not return its data. An entry can expire between commands, so use Get's found result when you also need the value.
Remove a key when its original data changes. For example, after updating a product, remove its cached summary so the next request obtains the updated information.
The result is true if an entry was removed and false if it was already missing or storage was unavailable. Use the same sharing option as the Set command.
Tests use their own cache, including tests with Use live data enabled. They do not read or change entries used by real calls. Repeated tests can share test entries, so use Delete or a different key when you need a fresh start.
Try Set, Get, Has and Delete with a short duration. Confirm Get returns found: false after expiry or removal. Cache commands are available in server workflows, not page workflows or database transactions.

This test stores a summary, reads it, deletes it and then confirms it is missing. The saved zero and false values are preserved.
Keep keys short and meaningful; each key supports up to 1,024 bytes. Values support ordinary text, numbers, booleans, objects, lists and null, up to 2 MiB. Avoid saving files or very large query results.
Dates, including dates within database results, are returned as ISO-formatted text, such as 2026-10-15T10:30:00.000Z. Convert them back to dates if a later command needs a date value.
A workspace supports up to 32 active entries for real calls and a separate 32 for tests. If all entries are in use, saving a new key returns false. Replace an existing key, delete an entry you no longer need or let it expire before saving another.
Entries may disappear before their chosen duration if temporary storage is cleared or unavailable. Choose durations that fit how often the original data changes. Concurrent requests can both miss a key and obtain fresh data; caching is not a lock and does not guarantee that an action runs only once.
Do not use cached values as your only record of payments, stock changes or other important actions. Existing authentication, API limits and workflow permissions still apply.
Loops
In Twidget, loops allow you to execute commands multiple times, either based on a condition or through a set number of iterations. Loops can also be nested, meaning you can run loops within other loops, creating complex logic for your tasks. List Loop. The `List Loop` command enables you to loop thr...
Local Storage
Twidget provides a set of local storage commands that enable interaction with the browser’s `localStorage` API through a no-code interface. These commands are useful for storing, retrieving, and managing key-value data persistently within the current domain context. Purpose. These commands abstract ...
Date
Twidget offers a variety of commands to manipulate date objects. Below are the available commands along with their respective descriptions, inputs, and outputs. Current Date. Description: Returns the current date and time. Output: - Type: DATE Add Time. Description: Returns the date plus a specified...
Send External HTTP Request
Using Twidget, you can send external HTTP requests effortlessly. This functionality allows you to communicate with external servers or APIs. Below, you will find the necessary parameters and structure to set up an HTTP request. Parameters. - URL: The endpoint to which the request will be sent. - Met...
Variables
Variables are essential building blocks in Twidget that allow you to store and manipulate data dynamically within your no-code applications. They enable you to create flexible and interactive applications by holding values that can be changed and referenced throughout your workflow. Creating Variabl...