Creating Flows

Learn how to use the ThinkFleet visual flow builder to create automated workflows with triggers and actions.

5 min readBuilding Flows

Creating Flows

The visual flow builder is the primary interface for designing automations in ThinkFleet. This guide covers everything you need to know to build flows from scratch.

The Flow Canvas

When you create a new flow, you're taken to the flow builder canvas — a visual editor where you assemble your automation step by step.

Canvas Layout

  • Toolbar (top) — Flow name, test button, publish button, version history
  • Canvas (center) — The visual representation of your flow steps
  • Step Panel (right) — Configuration for the currently selected step
  • Runs Panel (bottom) — Test results and run history
  • Zoom: Scroll wheel or pinch gesture
  • Pan: Click and drag on empty canvas space
  • Select step: Click on a step node
  • Add step: Click the + button between steps

Creating a New Flow

  1. Navigate to Flows in the sidebar
  2. Click New Flow
  3. Enter a descriptive name (e.g., "Sync new Stripe customers to HubSpot")
  4. You'll land on the canvas with a single Trigger placeholder

Configuring the Trigger

Click on the trigger step to open the configuration panel.

  1. Select a trigger type:
    • Search by app name (e.g., "Stripe") or trigger type (e.g., "Webhook")
    • Browse by category
  2. Connect your account (if the trigger requires authentication)
  3. Configure trigger settings — each trigger has different options
  4. Load sample data — click "Load Data" to pull a sample event for testing

Example: Gmail Trigger

Piece: Gmail
Trigger: New Email
Connection: my-gmail-account
Settings:
  Label: INBOX
  Subject Filter: "invoice"

Adding Actions

Click the + button below any step to add an action.

Adding a Piece Action

  1. Search for the piece (e.g., "Slack")
  2. Select the action (e.g., "Send Message")
  3. Connect your account
  4. Configure inputs — use the data selector to reference outputs from previous steps

Using the Data Selector

When configuring an action input, click the data selector icon (or type {{) to browse available data from previous steps:

{{trigger.body}}           → Full trigger payload
{{trigger.body.email}}     → Specific field
{{step_1.response.id}}     → Output from step 1
{{step_2.items[0].name}}   → Array access

The data selector shows the actual shape of your data based on test results, so you can pick fields visually.

Adding a Code Action

For custom logic, add a Code action:

export const code = async (inputs) => {
  // Access data from previous steps via inputs
  const customers = inputs.customers;

  // Transform, filter, or compute
  const highValue = customers.filter(c => c.totalSpend > 10000);

  // Return data for the next step
  return {
    count: highValue.length,
    customers: highValue,
  };
};

Code actions run in a sandboxed Node.js environment. You can import npm packages by declaring them in the action settings.

Branching Logic

Add a Branch action to create conditional paths:

  1. Click + and select Branch
  2. Define your condition:
    • Field: {{trigger.body.amount}}
    • Operator: Greater than
    • Value: 1000
  3. The canvas splits into True and False branches
  4. Add different actions to each branch

You can nest branches for complex decision trees.

Loops

Add a Loop action to iterate over arrays:

  1. Click + and select Loop
  2. Set the Items field to an array from a previous step: {{step_1.items}}
  3. Add child actions inside the loop
  4. Inside the loop, reference the current item with {{loop.item}}
Loop over: {{trigger.body.lineItems}}
  → Create invoice line: {{loop.item.description}} - ${{loop.item.amount}}
  → Update inventory for SKU: {{loop.item.sku}}

Error Handling

Step-Level Error Handling

Each action has an error handling configuration:

Option Behavior
Stop on Error (default) The flow run fails and stops executing
Continue on Error The step is marked as failed but the flow continues
Retry on Error Retries the step up to N times with a delay

Retry Configuration

Retry Count: 3
Retry Interval: 5 seconds
Backoff: Exponential

Flow Settings

Click the gear icon in the toolbar to access flow settings:

  • Flow Name — Rename your flow
  • Folder — Organize flows into folders
  • Notifications — Get alerted on failures via email or Slack
  • Concurrency — Limit how many runs can execute simultaneously

Publishing

When your flow is ready:

  1. Click Publish in the toolbar
  2. The flow becomes live — the trigger starts listening for events
  3. All future events will be processed by this published version

Draft vs Published

You can continue editing a published flow. Your edits create a new draft that doesn't affect the live version until you publish again. This lets you safely iterate without disrupting running automations.

Flow Templates

ThinkFleet includes pre-built flow templates for common use cases:

  • Sync CRM contacts between platforms
  • Post social media updates on a schedule
  • Route support tickets based on content
  • Back up files to cloud storage
  • Monitor website uptime

Access templates from the New Flow dialog by clicking Start from Template.

Next Steps