# How to Set Up a Selection Flow?

Selection flows in Fastn allow you to fetch dynamic data (such as lists of items, projects, or files) that can then be displayed as selectable options inside configuration flows. These are reusable across widgets or connectors wherever a dynamic selection is required.

## **1. Create a Selection Flow**

* Go to the **Widgets** section in Fastn.
* Click the arrow next to the **Add Widget** button (top-right corner).

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FkLhMs1Sr5sh7RHCB7dWv%2Fimage.png?alt=media&#x26;token=ecbb6dda-803f-4cc3-baa6-61cca20fad66" alt=""><figcaption></figcaption></figure>

* Select **Add Selection Flow**.
* Enter a name for your flow and click **Build**.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FRyTfiezikVQk5z1IryGk%2Fimage.png?alt=media&#x26;token=0c5186d4-36ac-44cf-9f9b-deb382642b7c" alt=""><figcaption></figcaption></figure>

This will create a configuration flow that allows you to define the logic for your selection data source.

> In this guide, we’ll build a selection flow using the **Google Cloud Storage** connector and its **Get Buckets** action.

## **2. Add a Connector Action Step**

Inside your new flow, add a step and choose **Connector Action**.

This is where you define which connector and which specific endpoint will supply data to your selection flow.

1. Under **Group Type**, select **Fastn Connectors**.
   * You can also choose **Workspace Connectors** if you’ve built custom connectors in your workspace.
2. Under **Connector**, select **Google Cloud Storage**.
3. Under **Endpoint**, select **Get Buckets**.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FNU3DTj5gomus6VVCTWjb%2Fimage.png?alt=media&#x26;token=f166a942-56e8-41bf-9456-4879161e749c" alt=""><figcaption></figcaption></figure>

Your step now represents the request that will fetch a list of storage buckets from Google Cloud Storage.

{% hint style="info" %}
For any connector you choose, the available endpoints will depend on that connector’s supported actions. For example, selecting *HubSpot* would display actions such as *Get Contacts* or *Get Companies*.
{% endhint %}

## **3. Configure the Connector Action**

After selecting the endpoint, click **Next**.\
You’ll now see the **Connection Configuration** section.

Here you can decide how your widget or flow connects to an account:

* **Fixed Connection:** Uses a specific account that you connect here (e.g., your own Google Cloud Storage account).
* **Dynamic Connection:** Allows multiple users to connect their own accounts dynamically through widgets.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2F5meWZ9GaVVpkhfqVBYnt%2Fimage.png?alt=media&#x26;token=b09b0648-5a92-4062-8024-a2f24c020759" alt=""><figcaption></figcaption></figure>

## **4. Define the Configuration Parameters**

Once your connection is set, you’ll see the **Configure** section.\
This section displays the endpoint URL and the fields you can map.

For the **Google Cloud Storage – Get Buckets** endpoint, for example, you’ll see:

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FRfUmUrU8TnqXtETdLXzY%2Fimage.png?alt=media&#x26;token=cbec02f7-c950-4566-8bac-fe71d134cccb" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You can provide **static values** directly in these fields or map them to existing **input variables** for flexibility.
{% endhint %}

## **5. Test the Selection Flow**

Next, open the **Test** section.

Here you can:

* View the **Headers** and **Input** fields used in your connector request.
* See the **Tenant ID** associated with your workspace or environment.
* Run a **Test** to verify that your selection flow returns the expected data (e.g., a list of buckets).

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2F54zXSUYBj2A807PtgSqp%2Fimage.png?alt=media&#x26;token=6ca22374-88aa-4cf5-b03e-eba0e6a8453e" alt=""><figcaption></figcaption></figure>

If successful, you’ll see the response data in the output preview.

## **6. Add a Final Step**

Once you’ve confirmed the connector response, you can add any follow-up step to process or format the data.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FmmmJkcTZw8AI3xZB0ELw%2Fimage.png?alt=media&#x26;token=6c9cd541-9879-4778-a989-27c6abc31cb4" alt=""><figcaption></figcaption></figure>

For instance, in this use case,

* Add an **Advanced Action** to transform the output.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FJU1Z7iHEiDKuO0ogjhRo%2Fimage.png?alt=media&#x26;token=7c4845fe-049d-4ff0-ba64-340b1a2ffcca" alt=""><figcaption></figcaption></figure>

* Add a **Loop** step to iterate over the items returned (e.g., each bucket).

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FXiMOblMo1wm6txmNfDIg%2Fimage.png?alt=media&#x26;token=7d82a70c-dbc3-41db-97e9-146d1a16cd14" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2FuOE7l3grlknhnl4VmUhm%2Fimage.png?alt=media&#x26;token=48774ce8-328a-44ef-8fa3-8b2d63ac99b4" alt=""><figcaption></figcaption></figure>

* Or simply return a **Success Message** as an object confirming completion:

> **Str "GCS buckets' fetching successful"**

This final output will serve as the data source for your selection dropdown in configuration flows.

## **7. Using the Selection Flow in Configuration Flows**

After saving, your newly created flow will appear in:

* **Workspace Selection Flows** (if created within your workspace), or
* **Community Selection Flows** (if shared publicly).

{% hint style="info" %}
You can now reference this selection flow from any configuration flow that supports **Selection Type: Mapping, Dynamic, or Custom**.
{% endhint %}

For example, in your **GCS Configuration Flow**, when you open the selection dropdown for a dynamic input, you’ll see **“GCS – Get Buckets”** listed as an available selection source.\
You can then enable **pagination**, apply **limits**, or transform the results based on your configuration.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2F91RQYs3sZXg1i1WiZM3U%2Fimage.png?alt=media&#x26;token=42fd9acb-cbc5-497d-a6dd-eb86a2a5d7fa" alt=""><figcaption></figcaption></figure>

Your selection flow is now ready and can be reused across configuration flows wherever dynamic data selection is required.

#### Example Scenarios

* [x] Populate dropdowns with live data from connectors (e.g., list of buckets, projects, or files).
* [x] Handle large datasets using pagination and limit controls.
* [x] Provide a seamless experience for users to select external data dynamically from widgets.
