# Create a new Flow

## **Purpose**&#x20;

A "Flow" is the neural schema of your Integration that holds the business logic of the data-synchronization and is written in the form of a pseudo-code. A Flow is usually written with API calls to a system (to access data), along with conditional checks and data formatting, which will successfully execute the objective of your integration.&#x20;

## **Preconditions**&#x20;

In order to successfully build a Flow, certain prerequisites need to be fulfilled:&#x20;

**1.Add a Project**

The Projects page is considered the epicenter of the integration process, where users can create, edit and access all the projects that they have access to.

A new project can be added by clicking on Projects icon from the Dashboard and then the Add New button in the Projects page. For more information click below:

{% content-ref url="broken-reference" %}
[Broken link](https://docs.dckapintegrator.com/tutorials/broken-reference)
{% endcontent-ref %}

&#x20;

**2. Add Systems / Credentials**

After a Project is added, click on the Manage button. The Project console now opens where you can manage Integrations and Credentials, and other project settings. &#x20;

Click on the Credentials icon, and add the system credentials as described below:

{% content-ref url="../project-manager/systems/credentials" %}
[credentials](https://docs.dckapintegrator.com/project-manager/systems/credentials)
{% endcontent-ref %}

## **Flowchart**&#x20;

![](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LjVABEcCgwItwY4IEAD%2Fuploads%2F8VsTsS5idmV5GBwsGzBM%2FFlowchart.png?alt=media\&token=13a91662-1f25-41e9-b5b8-c21e04ddd2a5)

## **Steps to Build a Flow**

1.Go to the Projects page by clicking on the ***Manage*** button against your project in the Dashboard. (See 1, 2 and 3 in the figure below)

![](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LjVABEcCgwItwY4IEAD%2Fuploads%2F645zFx87oyq0CDEWsjfC%2FProjects%20page%20manage%20button.png?alt=media\&token=9b809e49-be8d-4e72-b34e-d4e90c06cd2f)

2\. From the **Advanced** menu, click on ***Flows***.

![](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LjVABEcCgwItwY4IEAD%2Fuploads%2Fj8nNHYD8qrXQJb9JlDuf%2FAdvanced%20menu%20Flow.png?alt=media\&token=32bb7ce4-3029-4076-8fa7-9673760a024c)

3\. Click on the ***Add New*** button in the Flows page.&#x20;

![](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LjVABEcCgwItwY4IEAD%2Fuploads%2FCS78Ya9Be3RhwbJthDYN%2FAdd%20new%20Flow.png?alt=media\&token=ebebca75-349f-4ef6-abac-577f4175927d)

4\. The Add Flow window opens. Here, on the right side, you will find the list of Handlers. The center section is the **Play area** where you can drag and drop the Handlers to.&#x20;

![](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LjVABEcCgwItwY4IEAD%2Fuploads%2FoJVmxbdqIr8b2Dt52Eer%2FDrag%20_%20Drop%20Handler%201.png?alt=media\&token=bf1dfe43-abf7-4f8c-a0be-c324d622de20)

### Preliminary Steps

1.Add a suitable **name** and **description** for your Flow.&#x20;

> Example
>
> Flow Name: Create Customers
>
> Description: Flow to Create Customers from P21 to Magento

2\. Turn ON the status of the Flow by clicking on the ***Toggle On/Off*** button. This will enable/disable your Flow.

3\. You may add a **Source API Response**.&#x20;

*The source API response is used to display the API fields(SOURCE) in Mapping and will be used only in dynamic or webhook pipes. Provide a sample API response here.*

4\. If a **Core Flow** (pre-built template) has been built for your systems, you may load it here.&#x20;

5\. Also, a pre-built Flow can be imported by clicking on ***Import Flow***.

### Core Steps&#x20;

1.Drag and  Drop the required Handler to the Play area.&#x20;

![](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LjVABEcCgwItwY4IEAD%2Fuploads%2FjvacYBfInP5J2KkoP16e%2FDrag%20_%20Drop%20Handler%202.png?alt=media\&token=4fce6de9-8304-4e0b-b7a7-88898a797fdb)

2\. Configure the Handler by clicking on it in the Play area

> Example:  For the API Call handler, you have to choose a system, select the API call, add a Response Variable and other parameters.&#x20;

More on each type of Handler can be found below:&#x20;

{% content-ref url="../developers/flows" %}
[flows](https://docs.dckapintegrator.com/developers/flows)
{% endcontent-ref %}

3\. Similarly, you may add other Handlers until the business logic of the data synchronization is satisfied.&#x20;

For Flows: Best Practices, click below:&#x20;

{% content-ref url="../developers/flows/best-practices" %}
[best-practices](https://docs.dckapintegrator.com/developers/flows/best-practices)
{% endcontent-ref %}

For Flows: Use Cases, click below:&#x20;

{% content-ref url="../developers/flows/use-cases" %}
[use-cases](https://docs.dckapintegrator.com/developers/flows/use-cases)
{% endcontent-ref %}

4\. After building the Flow, click on Save and Merge for the changes to be reflected in the project.&#x20;

{% hint style="info" %}
Difference between Save and Save & Merge

After making changes to the Flow

* **Save** - if you click on Save, changes will be saved but do not reflect in the pipe
* **Save & Merge** - Clicking on Save & Merge, will reflect changes made in the pipe
  {% endhint %}

The Flow is now ready to be used in an Integration Pipe.&#x20;
