Creating Flows
Learn how to use the ThinkFleet visual flow builder to create automated workflows with triggers and actions.
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
Navigation
- 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
- Navigate to Flows in the sidebar
- Click New Flow
- Enter a descriptive name (e.g., "Sync new Stripe customers to HubSpot")
- You'll land on the canvas with a single Trigger placeholder
Configuring the Trigger
Click on the trigger step to open the configuration panel.
- Select a trigger type:
- Search by app name (e.g., "Stripe") or trigger type (e.g., "Webhook")
- Browse by category
- Connect your account (if the trigger requires authentication)
- Configure trigger settings — each trigger has different options
- 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
- Search for the piece (e.g., "Slack")
- Select the action (e.g., "Send Message")
- Connect your account
- 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:
- Click + and select Branch
- Define your condition:
- Field:
{{trigger.body.amount}} - Operator: Greater than
- Value:
1000
- Field:
- The canvas splits into True and False branches
- Add different actions to each branch
You can nest branches for complex decision trees.
Loops
Add a Loop action to iterate over arrays:
- Click + and select Loop
- Set the Items field to an array from a previous step:
{{step_1.items}} - Add child actions inside the loop
- 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:
- Click Publish in the toolbar
- The flow becomes live — the trigger starts listening for events
- 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.