# Create a Flow

In the **Flows** section, click the **New** button and the **New Flow** board will appear. This board is provided with a **Nodes panel** on the right, which contains all the entities that can be part of the map. Useful chips are available to display a specific category of entities, e.g. clicking the Action chip, all actions will be shown.&#x20;

A toolbar at the top of the board allows you to:

* <img src="/files/lINE0YBXynSQ0zqkArRw" alt="" data-size="line"> edit the name of the flow. By default, **New flow** is assigned.&#x20;
* <img src="/files/5uDdNzYnbv6hUS9EoJyc" alt="" data-size="line"> delete the draft you are/were working on.
* <img src="/files/iR5Dxgb0YbuBFnNTYzrk" alt="" data-size="line"> save the flow. This icon is enabled only once the flow does not have any errors.&#x20;

These are the steps to create the map:

{% stepper %}
{% step %}

### **Define the starting point**

The first thing to do when drawing a map is to **define the starting point**. In our example, it is a folder in a VFS. So, in the **Nodes** panel, we select the **Folder (VFS) box** and we drop it onto the board. We now have to specify the folder where files are expected to arrive, so we click the VFS box, and the **Folder (VFS)** panel will appear.

<figure><img src="/files/EjHomJDCYkZuRz6CDLAt" alt="" width="325"><figcaption></figcaption></figure>

Clicking **Choose**, the **Choose folder** window will appear. Here, configured folders are listed and can be selected. Additionally, a new folder can be created by clicking on the + button as detailed on the [Folders](broken://pages/KCp1NxZMsZUuIcQuqqz1) page.
{% endstep %}

{% step %}

### Define the rule

The next step required is to **define the rule that must be applied to the folder** we have selected. We want actions to be applied to new files entering the folder.&#x20;

To set a rule associated with our VFS, we click the  ![](/files/Ie8O6qnZXKT3g5iM2dge)  icon on the right of the **VFS** box and the **Rule** box automatically appears, linked to the **Folder (VFS)** box. To define the rules, we click the Rules box and fill in the fields in the **Rule** window as detailed on the [Rules](/data-mover-smart/rules/rules-overview.md) page. &#x20;

🚀 A rule can be disabled clicking the Rule card and toggling the **Enabled** switch to **Off**. The Rule card, along with any connected cards, will appear grayed out to indicate they are inactive.
{% endstep %}

{% step %}

### Set the criteria

We now have to set the criteria we want to be applied to the rule we have set. Once met, these criteria will trigger one or more actions. For example, we want to apply actions to Excel files coming from company GAMMA.&#x20;

To set conditions to our rule, we click the ![](/files/vwwoZiXCVwDvZrqUbfva)  icon on the right of the **Rule** box, and the **Conditions (Rule)** box automatically appears, linked to the **Rule** box. To define the criteria, we click on the **Conditions (Rule)** box and then on the + button. The **Attribute field** contains a list of pre-defined criteria we can choose from. We select **filename**, set the **value** to \*.xlsx, and click the **Add** button. Then, we click the + button again, select **sender**, set the **value** to Gamma, and click the **Add** button.&#x20;

If needed, new Attributes can be created, as detailed on the [Metadata](/data-mover-smart/settings/metadata.md) page.&#x20;
{% endstep %}

{% step %}

### Set the actions

We now have to set the actions we want to be applied to the files. In our example, we want Excel files coming from the company GAMMA to be renamed, and copied to a specific VFS, and then the original files can be deleted.&#x20;

To set these actions, we click on the <img src="/files/eJlsd2chAANlexh9GOzB" alt="" data-size="line"> icon on the right of the **Conditions** box and the possible applicable options will appear.

<figure><img src="/files/mv5XwIeIMnniUlrValtl" alt="" width="249"><figcaption></figcaption></figure>

Hovering the mouse over each icon, a tooltip will appear showing the relevant action.&#x20;

We want our files to be renamed, so we select the <img src="/files/L6tjI1GqdDHz4UUDoufo" alt="" data-size="line"> rename file icon. A new **Rename file** box will appear, linked to the **Conditions** box. Clicking the box, we can set the new name we want to be assigned. Either enter the name in the **New file name** field or set a macro. By clicking the <img src="/files/n7pQhL7mEiR3kQBRJTrh" alt="" data-size="line"> icon, a panel with supported variables will appear.&#x20;

{% hint style="info" %}
Note that useful chips appear when typing ${ in the **New file name** field.&#x20;

These chips can be selected to define the macro.&#x20;
{% endhint %}

We now click again on the <img src="/files/eJlsd2chAANlexh9GOzB" alt="" data-size="line"> icon on the right of the **Rename file** box and we select the <img src="/files/z6Ss4jcT2lY6Mc1B45dN" alt="" data-size="line"> Copy to VFS icon. A new **Copy to VFS** box will appear, linked to the **Rename file** box. Clicking the box, we can set the VFS where the file must be copied. Clicking **Choose**, the **Choose folder** window will appear. Here, configured folders are listed and can be selected. Additionally, a new folder can be created by clicking the + button as detailed on the [Folders](broken://pages/KCp1NxZMsZUuIcQuqqz1) page.

The selected VFS will appear as a box connected with the **Copy to VFS** box.

We now click again on the <img src="/files/eJlsd2chAANlexh9GOzB" alt="" data-size="line"> icon on the right of the **Copy to VFS** box and we select the <img src="/files/zpaVtg1oRtm5Jqgg5W0o" alt="" data-size="line">Delete file icon. A new **Delete file** box will appear, linked to the **Copy to VFS** box.
{% endstep %}

{% step %}

### Save the flow

Up to now, the flow is in the status **draft**. To make it active, we simply have to click the <img src="/files/RD5M0qQYWroyHPMayD7s" alt="" data-size="line"> Save button at the top of the screen.&#x20;

Note that if there are any errors, the Save icon will not be enabled. When a box is not fully or correctly configured, this icon <img src="/files/7lsQsLa6UMnGrWLtE209" alt="" data-size="line"> will appear at the top of the box. On the lower part of the board,  the **Errors found** chip shows the total number of errors. By clicking on the chip, a panel will open, showing all the errors categorized by entity. Clicking on each error will open a window where the issue can be fixed.
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.primeur.com/data-mover-smart/flows/create-a-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
