# Data Flows

Data Flows are powerful automations that allow you to process data from external sources, perform actions based on incoming information, and run jobs on a schedule. They are ideal for tasks like handling webhook events from third-party services (e.g., processing email delivery statuses from Postmark) or running recurring clean-up jobs.

A Data Flow is built on a visual canvas and consists of three main components:

* **Triggers:** The starting point of the flow, which can be an API call (webhook) or a schedule.
* **Workflow Steps:** Blocks that contain one or more actions to be executed, such as sending an email, tracking an event, or creating a variable.
* **Condition Branches:** Nodes that split the workflow into different paths based on defined rules, allowing you to create sophisticated logic.

***

### Creating a Data Flow

All Data Flows are managed from the Automations section of your workspace.<br>

1. Navigate to **Automations** in the left-hand sidebar.
2. Select the **Data Flows** tab.

![](https://616167918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLjwLbJC8g5ucoCRH06Pj%2Fuploads%2Fw8MhywFexzK6r1TB5Thf%2FCleanShot%202025-07-30%20at%2015.45.23%402x.png?alt=media\&token=633b0e58-3f33-48de-9d99-7c8c14109629)

Click the **Create Workflow** button in the top-right corner.\
\
In the **New Workflow** modal, enter a descriptive name for your flow (e.g., "Process Stripe Payments") and click **Create**.

You will be taken to a blank canvas where you can build your automation.<br>

<figure><img src="https://616167918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLjwLbJC8g5ucoCRH06Pj%2Fuploads%2FUGiqUYLigQjciEAERZ6w%2FCleanShot%202025-07-30%20at%2015.46.42%402x.png?alt=media&#x26;token=26558d34-9a1f-4316-bddb-9b786f6b08db" alt=""><figcaption></figcaption></figure>

***

### 1. Configure a Trigger

Every Data Flow must begin with a trigger. This is the event that starts the workflow.

Click **Add Trigger** on the actions bar at the bottom of the canvas to open the trigger selection modal.

<figure><img src="https://616167918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLjwLbJC8g5ucoCRH06Pj%2Fuploads%2FoMxWiiaQUJihdcqthXyk%2FCleanShot%202025-07-30%20at%2015.47.21%402x.png?alt=media&#x26;token=7b921eda-bcbb-4671-871b-e5107378f9d6" alt=""><figcaption></figcaption></figure>

There are two types of triggers scheduled or API triggers.

![](https://616167918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLjwLbJC8g5ucoCRH06Pj%2Fuploads%2FLBiVX8NrWlkwwycalaNS%2FCleanShot%202025-07-30%20at%2015.47.55%402x.png?alt=media\&token=e22e8a40-ddf1-429d-8384-e1fec4fdb015)\
\
**Option A: Schedule Trigger**

Use a Schedule Trigger to run a workflow at a specific time or on a recurring basis.

1. Select **Schedule Trigger**.
2. Choose a schedule type:
   * **One time:** Runs the workflow once on a specific date and time. Use the date and time pickers to configure it.
   * **Recurring:** Runs the workflow on a repeating schedule. Set the frequency (Minute, Day, Week, Month), interval (e.g., every 3 days), and the time of day.
3. Select the appropriate **Timezone**.
4. Click **Done**.

<figure><img src="https://616167918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLjwLbJC8g5ucoCRH06Pj%2Fuploads%2FHXOEGE9wcIpzcl4k00za%2FCleanShot%202025-07-30%20at%2015.48.45%402x.png?alt=media&#x26;token=1bf8808c-28cf-484e-a1eb-bb404ca87c8a" alt=""><figcaption></figcaption></figure>

**Option B: API Trigger**

Use an API Trigger to start the workflow when UserFlux receives a request from an external service (a webhook).

1. Select **API Trigger**.
2. Give the trigger a **Trigger Name**.
3. Choose an **Authentication Type** from the dropdown. This secures your webhook endpoint.
   * **None:** The endpoint will be publicly accessible. Use with caution.
   * **UserFlux API Key:** Requires a valid UserFlux API key in the request header.
   * **Service-Specific Webhooks (Stripe, Mailgun, Postmark, etc.):** Automatically validates the incoming webhook signatures from these services. You will need to provide the relevant signing key or secret from your third-party account.
4. Once configured, an **API Endpoint URL** is generated. Copy this URL and use it in your external service's webhook configuration.
5. Click **Done**.

<figure><img src="https://616167918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLjwLbJC8g5ucoCRH06Pj%2Fuploads%2FCzpb8UnJnN0I0YnWW6tg%2FCleanShot%202025-07-30%20at%2015.49.32%402x.png?alt=media&#x26;token=1152aeb5-09f0-4c4f-91aa-f00418af392a" alt=""><figcaption></figcaption></figure>

***

### 2. Build the Workflow

With a trigger in place, you can build the logic of your flow using steps and branches.

#### Adding Workflow Steps

A Workflow Step is a container for one or more actions that are performed in sequence.<br>

1. Click **Add Step** from the bottom actions bar. A new "Workflow Step" node will appear on the canvas.
2. Connect your trigger to the new step by clicking and dragging the dot from the right side of the trigger node to the left side of the step node.
3. Inside the Workflow Step, click **Add Action**.
4. Select an action type from the modal. Available actions include:
   * **Send Email:** Sends an email using a template and a configured provider.
   * **Create Dynamic Variable:** Fetch data from an API or define a value to use later in the flow.
   * **Track User Event:** Creates a new event for a user profile in UserFlux.
   * **Call Webhook:** Makes an outbound call to another API.
   * **Provider-Specific Actions:** Actions available from your connected apps, like sending a Slack message or a templated email via Mailgun.

![](https://616167918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLjwLbJC8g5ucoCRH06Pj%2Fuploads%2FHZ3OQWPm94AeohUwNJoW%2FCleanShot%202025-07-30%20at%2015.51.21%402x.png?alt=media\&token=af8dd05f-c934-461d-b8d1-10c547623be3)<br>

> **💡 Tip:** You can use **Liquid** templating in most action fields to dynamically insert data from the trigger or previous steps. For example, use {{ webhook.data.field }} to access data from an incoming webhook payload.

#### Adding Condition Branches

A Condition Branch splits your workflow into multiple paths based on rules. This is essential for handling different scenarios within a single flow.

1. Click **Add Condition Branch** from the bottom actions bar.
2. Connect a previous node (a trigger or step) to the branch.
3. Click on the branch node to configure its cases. A branch starts with one case by default.
4. Click **Add Rule** to define the logic for the case.
   * Select a **Workflow Variable** from any of the workflow variables that you have set up .
   * Choose an **operator** (e.g., equals, contains, exists, greater than, less than etc ).\
     ![](https://616167918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLjwLbJC8g5ucoCRH06Pj%2Fuploads%2Fsp6V6neAvtNFM4gu9yc9%2FCleanShot%202025-07-30%20at%2015.55.23%402x.png?alt=media\&token=c356a119-d585-4aff-9f40-73874851341f)
   * Provide a **value** to compare against. You can choose the drop down to choose the relevant type (e.g. text, number, true / false, time or null /empty).\
     ![](https://616167918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLjwLbJC8g5ucoCRH06Pj%2Fuploads%2FwsW56sBEBOixtBKN2oXd%2FCleanShot%202025-07-30%20at%2015.54.31%402x.png?alt=media\&token=86fc30b7-71b1-4f74-92ac-00f0fab5c638) <br>
5. You can add multiple rules to a single case using **AND** / **OR** logic.
6. Click **Add case** to create another distinct path with its own set of rules.
7. Click **Done**.<br>

After setting up a branch, you can connect each case to a different Workflow Step, allowing you to perform unique actions for each scenario.

***

### 3. Manage and Publish Your Data Flow

Once you have built your flow, you need to save and publish it to make it active.

* **Save Changes:** Click the **Save changes** button in the top-right corner to save your progress. The flow will remain in a draft state.
* **Publish:** On the main Data Flows screen, find your draft workflow and click the toggle switch to publish it. Confirm the action in the pop-up. The flow is now live and will execute when its trigger conditions are met.

<figure><img src="https://616167918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLjwLbJC8g5ucoCRH06Pj%2Fuploads%2FrC4ubsz2VuH1YXRWqYmB%2FCleanShot%202025-07-30%20at%2015.57.11%402x.png?alt=media&#x26;token=d31650c2-a48e-49c7-8ada-7a06448ca486" alt=""><figcaption></figcaption></figure>

#### Managing Existing Flows

From the Data Flows list, you can manage your workflows:

* **Views:** Switch between **Published**, **Draft**, and **Archived** views using the tabs.
* **Duplicate/Archive:** Click the three-dots menu on a workflow to **Duplicate** it or **Archive** it. Archiving removes it from the Published/Draft lists but does not delete it.

<figure><img src="https://616167918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLjwLbJC8g5ucoCRH06Pj%2Fuploads%2Feo0bVpwJs8olNTsMNM8K%2FCleanShot%202025-07-30%20at%2015.58.10%402x.png?alt=media&#x26;token=24b6f403-2744-4d87-a9f7-20fcaf0a7835" alt=""><figcaption></figcaption></figure>

* **Delete:** To permanently delete a workflow, first archive it. Then, go to the **Archived** view, click the three-dots menu on the flow, and select **Delete Workflow**.
