Theme
Run scripts with RuntimeVars
What this is
RuntimeVars (shown in the UI as FlexRuntimeVars) let you supply FlexVar values for a single script run on one device. Values live in agent memory for that request only unless you choose to persist them. They are not written into the normal FlexVar sync cache when you leave Use once selected.
Who can use it
Anyone who can run scripts on a device. The agent must advertise RuntimeVars support when you send non-empty RuntimeVars.
How to open it
- In the left side menu, click Devices.
- Open the device.
- Open the Scripts tab.
- Click Run on the script you want.

Supply RuntimeVars and execute
- The Execute Script modal opens.
- The modal scans script content for FlexVar usage, including:
- PowerShell:
Get-FlexVar -Name "X",Get-FlexVar "X",Get-FlexVars - Template:
${FLEX.NAME} - Bash-style:
Get-FlexVar "X"
- PowerShell:
- A resolve preview shows which names are already resolved (and from which scope) and which still need values.
- Fill unresolved fields, or click Add variable for ad-hoc names. Secret fields stay masked when marked secret in the catalog.
- Per field, choose:
- Use once (default) — one-shot RuntimeVar; no catalog write
- Save to device — persists via the device FlexVar API before execute
- Click Execute Script. Capability is re-checked; any Save to device values save first; then the script runs with RuntimeVars (typical timeout about five minutes).

Secrets
- Catalog Mark as secret controls masking in this UI.
- Resolved secrets are used for the run without showing values in this release.
- Prefer Use once for one-shot secrets. Do not put secrets in process environment variables for child processes.
Capability
Agents must advertise flex_runtime_vars. If RuntimeVars will be non-empty and the capability is missing, Execute Script stays disabled until you update the agent or clear those fields.
Tips
- Open Scripts → FlexVars Help → RuntimeVars for copy-ready examples.
- Library/bulk Run does not collect RuntimeVars yet — use this device tab when values are required.
- For catalog scopes and secret marking, see Flex Center FlexVars documentation.
- For bulk or group runs without RuntimeVars, see Run scripts.
