# Storage

<table data-header-hidden><thead><tr><th width="127"></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td>Name<br></td><td>Exists before execution<br></td><td>Can be created during execution<br></td><td>Can be read during execution<br></td><td>Can be written during execution<br></td><td>Persists across executions<br></td><td>Use cases<br></td><td>Examples<br></td></tr><tr><td>Files in the `/tmp/` folder<br></td><td>NO<br></td><td>YES<br></td><td>YES<br></td><td>YES<br></td><td>NO<br></td><td>Intermediate file operations within a single execution — writing data to disk during processing before consuming or returning it, or using libraries that require a file path rather than an in-memory object.<br></td><td><br>Generating a temporary CSV from query results and reading it back; rendering a PDF or image with a library that writes to a file path; unzipping a payload before processing its contents.</td></tr><tr><td>Global properties<br></td><td>YES<br></td><td>NO<br></td><td>YES<br></td><td>NO<br></td><td>YES<br></td><td><br>Storing read-only configuration and sensitive values that must be available across multiple functions without hardcoding them in source code — credentials, constants, and lookup tables that change infrequently.</td><td><br>An API key or token shared by several functions (e.g., <code>aws_keys</code>, a Twilio auth token); a JSON lookup table mapping device model codes to human-readable names; a constant threshold value (e.g., max temperature alert level) reused across different processing functions.</td></tr><tr><td>Local files<br></td><td>YES<br></td><td>NO<br></td><td>YES<br></td><td>NO<br></td><td>YES<br></td><td>Bundling static reference data or configuration that is known at deploy time and needs to be read (but never written) during execution — decoder logic, device configuration, or parameter files that ship alongside the function code.<br></td><td><br>A <code>device_config.json</code> with per-device-type settings; a <code>calibration_table.csv</code> with sensor offsets; separate Python/JS modules (e.g., <code>decoder.py</code>, <code>utils.py</code>) organized in a <code>modules/</code> folder and imported by the main script.</td></tr><tr><td>External files<br></td><td>YES<br></td><td>YES<br></td><td>YES<br></td><td>YES<br></td><td>YES<br></td><td>Persisting files that must survive across executions and be created or updated at runtime — long-lived data that is too large or dynamic to fit in Global Properties, and that multiple functions or executions may need to read or write.<br></td><td><br>A running log file that each execution appends to; a trained ML model binary uploaded once and downloaded on each inference call; a shared reference dataset (e.g., a lookup CSV) updated periodically by one function and consumed by others.</td></tr></tbody></table>


---

# Agent Instructions: 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:

```
GET https://dev.ubidots.com/ubifunctions/storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
