Variables
Overview
Two kinds of variables -- one for data flowing through a workflow, one for config and secrets.
Mandala has two different things called "variables," and they solve different problems:
Workflow Variables
A global data store scoped to a single workflow run -- set a value in one block, read it from any other block later in the same execution.
Environment Variables
Config values and secrets (API keys, tokens) that live at the personal or workspace level and are available across every workflow, referenced with {{ notation.
Which One Do I Want?
- Passing data between blocks in the same run -- for example, a value computed early in a workflow that a much later block needs -- use a workflow variable. It exists only for the lifetime of that execution.
- A secret or config value every workflow should be able to reach -- an API key, a base URL, a shared constant -- use an environment variable. It's set once (personally or at the workspace level) and referenced by name from any workflow, any time.
A workflow variable is written and read with its own block; an environment variable is referenced inline in any input field by typing {'{{'} and picking it from the dropdown -- they're never interchangeable, and neither one substitutes for the other.