> ## Documentation Index
> Fetch the complete documentation index at: https://docs.connie.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment variables

> Save secrets such as another service's API key in Settings → Environment and use them safely in workflow steps with {{connie.env.KEY}}.

Environment variables are saved secrets for your workspace, such as another service's API key or token. You save the secret once in Settings. Then you put a reference to it, such as `{{connie.env.STRIPE_API_KEY}}`, in a workflow step, instead of pasting the real key into the step.

Why it matters: the real value is never shown in your workflow, its run history or the chat. Anyone building workflows can use the secret without ever seeing it. To change the key later, you update it in one place.

**Where:** **Settings** → **Developers** → **Environment** · `https://connie.ai/<workspace-id>/settings?tab=env`

## Add a variable

Owners and admins only.

<Steps>
  <Step title="Open Environment">
    Go to **Settings** → **Environment** (under **Developers**). The page is headed **Environment variables**.
  </Step>

  <Step title="Click Add variable">
    The **Add variable** dialog opens.
  </Step>

  <Step title="Fill in the fields">
    * **Name**: for example `STRIPE_API_KEY`. Use letters, numbers and underscores, starting with a letter or underscore (up to 128 characters).
    * **Value**: the secret itself (up to 8,192 characters).
    * **Description (Optional)**: what it's for, for example "Stripe key for invoice workflow" (up to 256 characters).
  </Step>

  <Step title="Create">
    Click **Create**. You'll see `Added "STRIPE_API_KEY".` The row shows the name, the date and `∗∗∗` instead of the value.
  </Step>
</Steps>

<Warning>
  After you save a value, it's **never shown again**, not even to admins. Keep your own copy somewhere safe if you'll need it.
</Warning>

## Use a variable in a workflow step

<Steps>
  <Step title="Open the step's field">
    In your workflow, click into the field that needs the secret. For example, the `Authorization` header value of an **Api Call** step.
  </Step>

  <Step title="Insert the variable">
    Click **+** (or type **@**) to open **Select variable or function**. Under **Environment Variables**, pick your variable (shown with its description, or **Secret** if it has none). It's inserted as a chip that shows the name, never the value.
  </Step>

  <Step title="Or type the reference">
    You can type it yourself: `{{connie.env.STRIPE_API_KEY}}`. Inside text, it works like any other variable, for example `Bearer {{connie.env.STRIPE_API_KEY}}`.
  </Step>
</Steps>

When the step runs, Connie fills in the real value just before sending the request. If the value appears in the step's result, Connie shows the reference back in its place, so the secret isn't visible in the run history. See [Variables](/automations/workflows/variables).

## Edit or delete a variable

Owners and admins only.

* **Edit:** click **⋯** on the row → **Edit**. The dialog says "The current value can't be shown — entering a new one overwrites it." Type a **New value** (or leave it blank to keep the current value), change the **Description** if you like, and click **Save**.
* **Delete:** click **⋯** → **Delete**. The confirmation warns: "Any workflow referencing `{{connie.env.KEY}}` will stop resolving it." Click **Delete**.

## Good to know

* **Saved secrets only work in workflow steps.** They aren't filled in for Chat, Agents or MCP tool calls, even though the Settings page says variables can be used by "tools, workflow, lists, chats and apps". If you need a secret in an action, put that action in a workflow step.
* **Who can do what:** every workspace member can see the list of names. Only owners and admins can add, edit or delete. Members still see the buttons, but saving fails.
* **Names are unique** in a workspace, and they're case-sensitive in references. Use the name exactly as saved.
* **Never paste a real key into a step or a chat.** Save it here and use the reference.

## Troubleshooting

<AccordionGroup>
  <Accordion title="The saved secret KEY does not exist. Add it in Settings → Env, then try again.">
    **Why:** the step references a variable name that isn't saved, or is spelled differently. The workflow step fails. **Fix:** go to **Settings** → **Environment** (the message calls it 'Env') and add a variable with exactly that name, or fix the reference in the step.
  </Accordion>

  <Accordion title="Saved secrets can only be used in a workflow step's fields">
    **Why:** a `{{connie.env...}}` reference was used in Chat, an Agent or an MCP call, where secrets aren't filled in. **Fix:** put the API call in a workflow step and reference the secret there.
  </Accordion>

  <Accordion title="Invalid name. Use letters, numbers and underscores; must start with a letter or underscore.">
    **Fix:** remove spaces, dashes and other symbols. For example, use `MY_API_KEY`, not `my-api key`.
  </Accordion>

  <Accordion title="A variable named KEY already exists.">
    **Fix:** pick another name, or use **Edit** on the existing variable to change its value.
  </Accordion>

  <Accordion title="Enter a name and a value.">
    **Fix:** both **Name** and **Value** are required.
  </Accordion>

  <Accordion title="I can't add or edit variables (I'm a member)">
    **Why:** only owners and admins can change environment variables. **Fix:** ask an admin. See [Members and roles](/workspace/members-and-roles).
  </Accordion>

  <Accordion title="I need to see a value I saved">
    **Why:** values are never shown after saving. **Fix:** get the value from the service it came from, then use **Edit** to save it again if needed.
  </Accordion>
</AccordionGroup>

## Related

* [Variables](/automations/workflows/variables): all the kinds of variables in workflows
* [Build a workflow](/automations/workflows/build)
* [Workspace settings](/workspace/settings)
* [Build on Connie](/developers/overview)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.