> For the complete documentation index, see [llms.txt](https://docs.borndigital.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.borndigital.ai/insights/building-new-projects/add-a-flow-connector.md).

# Add a Flow connector

Send every analysed record to a Digital Agent flow – for example to classify e-mails or call a back-office system – and bring the flow's variables back to Insights.

A **Flow connector** is a parameter that sends each record of an Insights project to a [Digital Agent](/digital-agent/introduction.md) flow. The flow can work with the record – classify it, look up data in your systems, decide what should happen next – and its variables come back to Insights as results you can filter and show in dashboards.

Before you start, finish the [Analysis project](/insights/building-new-projects/analysis-project.md) tutorial: you need an Insights project with data.

## 1. Prepare the flow

1. Build the Digital Agent project that does the work (the **target project**) and **train** it – see [Build your first agent](/digital-agent/building-new-projects.md).
2. Recommended: create a second, small Digital Agent project (the **proxy project**) with only a [Transfer node](/digital-agent/conversation-flow/nodes-explained/transfer-node.md) that leads to the target project. Connect the Start node to the Transfer node and train the proxy project.

{% hint style="info" %}
**Why a proxy project?** A Flow connector is bound to **one trained version** of the project you connect. Every time you train the target project again, the connector would still call the old version. A Transfer node always goes to the **most recently trained** version of its target – so with a proxy in between you can keep improving the target project without touching the connector.
{% endhint %}

## 2. Create the Flow connector

1. In your Insights project, open **Design** › **Parameters**.
2. Click **Create** and choose **Flow connector**.
3. In **Connect to project**, choose the proxy project (or the target project), and in **Select trained version** the version to call. Only trained versions are offered.
4. Enter the **Name** of the connector.
5. Optional settings in **Extras**:
   * **Output variables** – the flow variables that should come back to Insights. Enter each name exactly as in the flow and confirm it with **Enter**. Leave it empty to get all of them.
   * **Previous parameter results to flow** – also send the results of earlier prompts to the flow, each under its `<prompt>_<parameter>` name.
   * **Send unprocessed transcript/text to flow** – also send the raw transcript or text.
   * **Should process email attachments** (Text projects) – let the flow work with the attachments of the e-mail.
6. Click **Save**.

Secret variables are never returned to Insights. All fields are described in [Parameters › Flow connector](/insights/workspace/design/parameters.md#flow-connector).

## 3. Add it to a prompt

1. Open **Design** › **Prompts** and create a prompt (or open an existing one).
2. Select the Flow connector in **Parameters**.
3. If the flow needs results of other prompts, make sure those prompts run **earlier** and switch on **Previous parameter results to flow** in the connector.
4. Click **Create** or **Save**.

New records now go through the flow. To run the flow over records you already have, use **Process** › [**Rerun**](/insights/workspace/process/rerun.md).

## 4. Use the results

* In the **flow**, the results of earlier prompts are available under their `<prompt>_<parameter>` names – use them like any other variable, for example in a Condition intent of an Answer node, in a Function node or in the Instructions of an AI node.
* In **Insights**, the returned variables are stored with the results of the record and can be shown in [dashboards](/insights/workspace/analyse/dashboards.md).

{% hint style="success" %}
Test the flow first in Digital Agent with a sample text, then connect it and check a few records in your dashboard before you process all data.
{% endhint %}
