> For the complete documentation index, see [llms.txt](https://docs.uptiq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uptiq.ai/ai-workbench-qore/console/flows/flow-inputs-outputs-and-variables.md).

# Flow inputs, outputs, and variables

Define the data a flow accepts, returns, and shares across tasks.

Flow I/O defines a flow's contract. Variables supply shared values and protect credentials used during a run.

## Define inputs and outputs

Open **Flow I/O** to configure the schemas: the request parameters and the expected response format.

<figure><img src="https://1326225582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0qmgQjJ5aArDTj2ACFHG%2Fuploads%2Fgit-blob-dc30638f52954103e064b08d779de3e7f171ee4d%2Fqore_flows_how-to-flow-io-input_rounded_shadow.png?alt=media" alt="The Flow I/O dialog on the Input Schema tab, with Basic and Advanced modes, a Key, Type, Description and Required table with an Add button, and Save"><figcaption><p>Flow I/O, on the Input Schema tab.</p></figcaption></figure>

| Schema            | Defines                                  | Example                             |
| ----------------- | ---------------------------------------- | ----------------------------------- |
| **Input Schema**  | Values supplied when the flow starts.    | `documentId`, text, required.       |
| **Output Schema** | Values returned when the flow completes. | `extracted_data`, object, required. |

Choose an editing mode:

{% columns %}
{% column %}

#### Basic

Add fields in a table. Set **Key**, **Type**, **Description**, and **Required**.

Supported types: **Text**, **Number**, **Boolean**, **Object**, **Array**, and **Dropdown**.
{% endcolumn %}

{% column %}

#### Advanced

Edit the schema as JSON Schema. Use this mode when you need direct schema control.
{% endcolumn %}
{% endcolumns %}

Select **Save** after editing. Input fields also appear on the **Global Variables** tab as read-only entries.

## Use variables

Variables declared in a flow are available to all tasks. Open them with **Variables** on the builder's rail.

| Type                 | Use for                                            | Reference                 |
| -------------------- | -------------------------------------------------- | ------------------------- |
| **Secrets**          | API keys, tokens, and other credentials.           | `$secret.{variable_name}` |
| **Global Variables** | Values shared across tasks, such as a document ID. | `$global.{variable_name}` |

### Add a secret

1. Select **Add Secret**.
2. Enter a required **Name** and **Value**.
3. Choose **String** or **JSON** for **Type**.
4. Select **Secured** when appropriate, then select **Save**.

{% hint style="warning" %}
**Store credentials as secrets.** Reference `$secret.CRM_TOKEN` in task settings. Do not enter credentials directly in a task.
{% endhint %}

### Add a global variable

1. Select **Add Variable**.
2. Enter a required **Key**.
3. Choose a type and add a description.
4. Select **Required** when the flow cannot run without it.
5. Select **Save**.

Task configuration can map a global variable to an input. It can also map a task output to an output variable.

***

{% columns %}
{% column width="83.33333333333334%" %}

<p align="right"><em>Maintained by</em> <mark style="color:green;">Abhishek Paul</mark><br><code>AI-assisted, human-approved</code></p>
{% endcolumn %}

{% column width="16.666666666666664%" %}

<div align="left"><img src="https://1326225582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0qmgQjJ5aArDTj2ACFHG%2Fuploads%2Fgit-blob-d034645b4f8f8ee661985f5306b60ded3289653c%2Fmaintainer-abhishek-paul.png?alt=media" alt="" width="60"></div>
{% endcolumn %}
{% endcolumns %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.uptiq.ai/ai-workbench-qore/console/flows/flow-inputs-outputs-and-variables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
