Griptape Agent Config: Environment Variables
Set API keys inside the graph — no .env file, no terminal
- ENV
The Griptape Environment Variables node is how you inject API keys and settings into a workflow without leaving ComfyUI - or without hardcoding secrets into a workflow you plan to share. It's a single multiline box where you type KEY=VALUE pairs, one per line, and it sets them as real environment variables for the rest of the run. If you've ever watched someone paste their OpenAI key directly into a node field (and into every exported workflow image that followed), you understand why this node exists.
There's a subtlety that makes it more useful than a glorified .env editor: other Griptape config nodes scan the graph for this node. In the pack's base class, every config node collects the variables from all Griptape Agent Config: Environment Variables nodes in the prompt and sets them before building drivers. So you can keep one of these in a corner of your graph, fill it with every key your providers need, and every driver and config in the workflow picks them up automatically. That's the intended pattern - set it once, wire nothing.
How it works
The node's run method parses the multiline input. Each line must contain =. The key and value are split on the first = (so values containing = are fine), stripped, and set into os.environ. Invalid lines are skipped with a warning printed to the console rather than crashing the workflow. At the end it returns the list of variables it set.
Input is a single multiline field, Environment Vars, defaulting to the placeholder ENV=VALUE. The node is marked as an output node, and its output is an ENV object containing the set variables - though in practice the side effect (mutating the process environment) is what matters, not the output value.
Inputs and outputs
- Environment Vars - multiline
KEY=VALUEper line. That's the only input. - ENV - the output, listing what was set.
For the common case you don't even need to wire the output - config nodes pick up the values from the graph directly. If you're building a workflow to share, this node also keeps keys out of the exported image, which is a genuinely good habit.
Install
Same pack, same drill - ComfyUI Manager (search "Griptape") or:
cd ComfyUI/custom_nodes
git clone https://github.com/griptape-ai/ComfyUI-Griptape
The pack installs griptape[all] and python-dotenv; the README's Nvidia caveat applies (reinstall torch from the cu121 index if ComfyUI breaks).
Common gotchas
First: format matters. Lines without = are silently skipped, so a typo like OPENAI_API_KEY OPENAI_... does nothing and you'll wonder why the agent has no key. Second: this sets variables for the current ComfyUI process - it won't persist to your shell or to other sessions, and it takes effect when the node runs, so anything downstream that reads the env var must execute after it in the graph. Third, and this is the security note worth repeating: environment variables are still visible in the exported workflow text if the node runs, so this is a convenience for your own machine, not a real secrets store - keep genuinely sensitive keys in your actual environment or the Griptape settings page instead.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| Environment Varsopt | STRING | ENV=VALUE | Set your environment variables. Use the format 'KEY=VALUE'. Add each variable on a new line. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ENV | ENV | — |