# Launch Variables & Global Variables

{% embed url="<https://youtu.be/Q5XEPAk8ziI>" %}

MindStudio supports two powerful types of variables that extend the functionality of your AI agents: **Global Variables** and **Launch Variables**. Each serves a distinct purpose and can help you build more advanced, persistent, and externally-driven workflows.

### Global Variables

Global variables allow you to **store values between workflow runs**. This is useful when you want to retain state, keep a running record, or reference previous output in future executions.

#### Key Features:

* Prefixed with `global.`
* Stored project-wide and persist between agent runs
* Configurable from the **Global Variables tab** in the root project folder

#### Example: Story Generator

* A story-writing agent appends new chapters to a global variable called `global.story`.
* Each run checks if a story exists:
  * If it does: generates the next chapter.
  * If not: starts a new story.
* The story is stored and updated in the `global.story` variable.
* You can view and edit global variable values under the Global Variables tab.

This approach is ideal for accumulating content, maintaining histories, or building AI memory-like features.

### Launch Variables

Launch variables allow you to **inject data into your workflow at runtime**, often via an external integration (e.g. API, webhooks, Make.com).

#### Key Features:

* Declared in the **Start Block**
* Replaces the need for user input blocks when running workflows programmatically
* Supports structured automation flows like onboarding forms, CRMs, or lead collection

#### Example: Sales Collateral via Google Form

* A Google Form collects company data (e.g. name, representative, company info).
* A Make.com automation sends these inputs into MindStudio as **launch variables**.
* The MindStudio workflow uses these variables to generate personalized sales content.
* The generated output is passed back and saved to a Google Sheet.

Launch variables streamline integrations and automate personalized content generation at scale.

### Recap

| Variable Type    | Purpose                           | Persistence  | Source                           |
| ---------------- | --------------------------------- | ------------ | -------------------------------- |
| Global Variables | Save data across runs             | Persistent   | Internal (within MindStudio)     |
| Launch Variables | Inject data from external systems | One-time use | External (via API or automation) |

By using global and launch variables strategically, you can create more intelligent, dynamic, and automated AI agents in MindStudio.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://university.mindstudio.ai/2-workflow-mastery/launch-variables-and-global-variables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
