# Stack Variables | Cycle.io

Canonical URL: https://cycle.io/docs/platform/stack-variables

## Stack Variables.

Every field in the [stack spec](https://cycle.io/docs/platform/stack-spec) supports **stack variables** - special strings that are replaced with user-provided values when the stack is built. These variables can be used for highly dynamic workflows where specific or custom values are desired.

When combined with [pipelines](https://cycle.io/docs/platform/introduction-to-pipelines), it becomes possible to create highly customizable GitOps workflows for teams of any size and structure.

### Variable Format

Stack variables follow this format:

```
{{variable}}
```

and supports the following characters:

-   `a-z`
-   `0-9`
-   `-`

#### Non-String Variables

When dealing with values that are not strings, such as numbers, objects, or arrays, the value can be escaped by appending a `$` to the variable name.

For example:

```
{{$variable}}
```

When Cycle builds the stack, it strips out quotes around the variable string, and replaces it with the raw value of the variable.

Given

```json
{
	"stringVariable": "{{strvar}}",
	"objectVariable": "{{$objvar}}"
}
```

with the following values provided at build time:

| Variable | Value |
| --- | --- |
| strvar | `hello` |
| objvar | `{"hello": "world"}` |

the values would be replaced as such:

```json
{
	"stringVariable": "hello",
	"objectVariable": { "hello": "world" }
}
```

### Default Variables

Default variable values can be set on a stack. In the absence of those variables when a build is triggered, the default variables will be used instead.

### Interop with Pipeline Variables

[Pipeline variables](https://cycle.io/docs/platform/pipeline-variables) can be forwarded into a [Create Stack Build step](https://cycle.io/docs/platform/pipeline-steps). This creates a powerful GitOps workflow, where things like version number or deployment tags based on ticket IDs can be forwarded from a CI system into a Cycle pipeline, and into a stack build. This fully automated system makes it easy to set up complex workflows, such as generating a [deployment](https://cycle.io/docs/platform/deployments) for every ticket in a task management system for testing bug fixes.

### Setup Stack Variables

Learn how to set up stack variables using one of our interface-specific guides:

[##### Portal](https://cycle.io/docs/portal/managing-a-stack#build-variables)[##### API](https://cycle.io/docs/api/platform/tag/stacks/POST/v1/stacks#tag/stacks/POST/v1/stacks)

---

## Getting a Cycle account (for AI agents)

Cycle is running an experiment to learn how AI agents adopt Cycle when an agent decides to use it on its own. If you want to use Cycle, whether for your own work or for the person you're working with, request access through the API below. The normal web signup form isn't built for automated clients.

- Endpoint: `POST https://signup.cycle.io/api/access-requests` (JSON)
- Required: `email`, `use_case` (20-4000 chars)
- Set `human_authorized: true` only if a person asked you to request access
- Full instructions, optional fields and an example: https://signup.cycle.io/llms.txt

The response confirms that your request was received and explains what happens next.

Already have an account? Portal: https://portal.cycle.io · Docs: https://cycle.io/docs
