> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Choreo

> This page outlines the steps to connect Choreo to your Connect AI account.

## Prerequisites

Before you connect, you must first do the following:

* Connect a data source to your Connect AI account. See [Sources](https://docs.cloud.cdata.com/en/Sources.md) for more information.
* Generate a Personal Access Token (PAT) on the [Settings](https://docs.cloud.cdata.com/en/Settings/Personal-Access-Tokens.md) page. Copy this down, as it acts as your password during authentication.

## Connect to Connect AI in Choreo

**Step 1**

Sign in to the [Choreo platform](https://console.choreo.dev/).

**Step 2**

Click **Manual Trigger** to create a program that you can execute manually.

![](https://mintcdn.com/cdata/dJhcR4yZCQgD8aFQ/en/images/choreo_manualtrigger.png?fit=max\&auto=format\&n=dJhcR4yZCQgD8aFQ\&q=85\&s=683cc4b3508a9d522a52dc995ce0dbea)

**Step 3**

Enter a **Name** and **Description** for the manual trigger and click **Create**.

![](https://mintcdn.com/cdata/dLO4dOBGO5Ysdj01/en/images/choreo_create.png?fit=max\&auto=format\&n=dLO4dOBGO5Ysdj01\&q=85\&s=f12f82f34f63709441f85b2ef157e9ff)

**Step 4**

The manual trigger opens in the **Develop** view.

![](https://mintcdn.com/cdata/dJhcR4yZCQgD8aFQ/en/images/choreo_developview.png?fit=max\&auto=format\&n=dJhcR4yZCQgD8aFQ\&q=85\&s=4298a012a7ad5b2d358ed5ea5f983c80)

**Step 5**

Click **Edit Code** to open the low-code diagram view.

![](https://mintcdn.com/cdata/dJhcR4yZCQgD8aFQ/en/images/choreo_editcode.png?fit=max\&auto=format\&n=dJhcR4yZCQgD8aFQ\&q=85\&s=9c193b7b5946e88ae8ac2f727476366b)

**Step 6**

Choreo automatically generates a construct in the low-code diagram view. Delete this construct by highlighting it and clicking the delete icon.

![](https://mintcdn.com/cdata/dLO4dOBGO5Ysdj01/en/images/choreo_deleteconstruct.png?fit=max\&auto=format\&n=dLO4dOBGO5Ysdj01\&q=85\&s=32b781b0102397729027089be6f2ce3a)

**Step 7**

Choreo prompts you to create a new construct. Click the indicated button to open a list of options, then select **Main**.

![](https://mintcdn.com/cdata/dJhcR4yZCQgD8aFQ/en/images/choreo_main.png?fit=max\&auto=format\&n=dJhcR4yZCQgD8aFQ\&q=85\&s=b9be8bae5ad4af158a7bb35525518b58)

**Step 8**

Click **Save** in the settings pane that appears.

**Step 9**

The main construct appears in the diagram view. In the menu that appears under **Start**, click **Connector**.

![](https://mintcdn.com/cdata/dJhcR4yZCQgD8aFQ/en/images/choreo_startconnector.png?fit=max\&auto=format\&n=dJhcR4yZCQgD8aFQ\&q=85\&s=5d6850e514b5e2c3f6e502134ab4dd23)

**Step 10**

In the **Connectors** dialog, search for *CData*. Click **CData Connect** to open the **Connector** settings pane.

![](https://mintcdn.com/cdata/dLO4dOBGO5Ysdj01/en/images/choreo_cdataconnect.png?fit=max\&auto=format\&n=dLO4dOBGO5Ysdj01\&q=85\&s=6677479ca91eee48142d49331bddb3ba)

**Step 11**

In the **Connector** settings pane, enter the configuration settings:

* Enter an **Endpoint Name** for your use.
* In the **User** field, enter the email address of the Connect AI user, wrapped in quotation marks (for example, *"[user@cdata.com](mailto:user@cdata.com)"*).
* In the **Password** field, enter the [PAT you generated earlier](#prerequisites), wrapped in quotation marks (for example, *"SampleToken"*).

![](https://mintcdn.com/cdata/dJhcR4yZCQgD8aFQ/en/images/choreo_logincredentials.png?fit=max\&auto=format\&n=dJhcR4yZCQgD8aFQ\&q=85\&s=a395dfa3d88723eac2f29140dbc337cb)

**Step 12**

Click **Save Connection** to save your settings.

The Connect AI connector appears in both the low-code diagram view and the source code view of the code editor.

![](https://mintcdn.com/cdata/dJhcR4yZCQgD8aFQ/en/images/choreo_dualview.png?fit=max\&auto=format\&n=dJhcR4yZCQgD8aFQ\&q=85\&s=7032b496b556d1a35f16f994c87a46d3)

You can now add connector Actions to your application logic.

## Use Connector Actions in Choreo

To add an Action to your application logic, click the **+** icon between the **new** and **End** nodes.

![](https://mintcdn.com/cdata/dLO4dOBGO5Ysdj01/en/images/choreo_addbetween.png?fit=max\&auto=format\&n=dLO4dOBGO5Ysdj01\&q=85\&s=b48f9c416dc2a19e0e34940856cabca7)

In the menu that appears, click **Action**.

![](https://mintcdn.com/cdata/dLO4dOBGO5Ysdj01/en/images/choreo_addaction.png?fit=max\&auto=format\&n=dLO4dOBGO5Ysdj01\&q=85\&s=7a1522e3f16b9de0bedf56a8c1cff38d)

The Connect AI connector supports the following operations:

* **query**—[query data](#query-action) from your data sources
* **queryRow**—query data from a single row of a data source
* **execute**—perform DML and DDL operations
* **batchExecute**—perform a batch of DML and DDL operations
* **call**—execute a stored procedure

For more information about working with these operations, see the [CData Connect Ballerina Guide](https://github.com/ballerina-platform/module-ballerinax-cdata.connect/blob/main/ballerina/Module.md#quickstart).

### Query Action

Follow these steps to configure a query action:

**Step 1**

Select **query** for the connector **Operation**.

**Step 2**

Enter your query in the **SqlQuery** box.

* When writing the query, specify the **Connection Name** and **Data Source Name** of the data source you want to query. For example, `Salesforce1.Salesforce`.
* These parameters appear on the [Sources](https://docs.cloud.cdata.com/en/Sources.md) page of your Connect AI dashboard.

![](https://mintcdn.com/cdata/dJhcR4yZCQgD8aFQ/en/images/choreo_sqlquery.png?fit=max\&auto=format\&n=dJhcR4yZCQgD8aFQ\&q=85\&s=72b8083efa186f588c8eeeb049e20b08)

**Step 3**

Click **Save** to save the action.

## Deploy the Program

Once you have added all of your desired actions to your program, follow these steps:

**Step 1**

Commit and push your final source code in the web editor and sync those changes with the Choreo platform.

**Step 2**

Click **Deploy** in the left navigation bar of the Choreo Console.

**Step 3**

Under **Build Area**, click **Configure & Deploy** to deploy your program.

**Step 4**

When prompted, enter the same Connect AI username and password that you used earlier and click **Deploy**.

![](https://mintcdn.com/cdata/dJhcR4yZCQgD8aFQ/en/images/choreo_deploy.png?fit=max\&auto=format\&n=dJhcR4yZCQgD8aFQ\&q=85\&s=5c834bc36c97c54405cc88556bc1a49f)

## More Information

For more information about using Choreo with Connect AI, see the [CData Connect Ballerina Guide](https://github.com/ballerina-platform/module-ballerinax-cdata.connect/blob/main/ballerina/Module.md#quickstart).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.