# Workflows

> Automate work across your tools: pick a trigger, add actions, and let the workflow run every time the event happens.

Source: https://docs.getlinkai.com/agents/workflows

Workflows run a set of actions every time something happens in your business, such as a new order, a form submission, or a booking. Use them for background automation that doesn't need a conversation, like sending a follow-up email or creating a calendar event.

![Workflows](https://docs.getlinkai.com/screenshots/v2/workflows.png)

## How workflows work

Each workflow has two parts:

1. **A trigger**: the event that starts the workflow
2. **Actions**: the steps that run in order after the trigger fires

You build workflows on a visual canvas with no code. Or describe what you want in plain English and AI builds the workflow for you.

**Note:**
Workflows run in the background. When a job happens inside a conversation and needs fixed steps, use [Procedures](https://docs.getlinkai.com/agents/procedures) instead.

## Create your first workflow

### Open Workflows

Open **Workflows** in the sidebar.

### Start a workflow

Click **New Workflow**, or select it from the workflow dropdown.

### Choose a trigger

Click the trigger node on the canvas and pick a trigger.

### Add actions

Click the "+" node or **Add Step**. Click each step to configure it.

### Save and activate

Click **Save**, then toggle the workflow to **Active**.

You should see the workflow marked **Active**. Click **Run** in the toolbar to test it.

**Or let AI build it**

### Open the prompt

In **Workflows**, press `Cmd+K` (or `Ctrl+K`).

### Describe the workflow

For example: *"When a new contact is created, send them a welcome email via Gmail."*

### Review and activate

Review the generated workflow, adjust it if needed, then save and activate.

## Triggers

A trigger is the event that starts your workflow. Every workflow has exactly one trigger. When that event happens in your workspace, the workflow fires.

### Built-in triggers

| Trigger | When it fires |
|---------|--------------|
| **New Order** | A customer places a new order |
| **Order Status Changed** | An order's status changes (for example, pending to completed) |
| **New Appointment** | A new appointment is booked through your calendar |
| **Appointment Status Changed** | An appointment is confirmed, cancelled, or rescheduled |
| **New Contact** | A new contact is added to your workspace |
| **Form Submitted** | Someone submits one of your Smart Forms |
| **New Ticket** | A customer support ticket is created |
| **Scheduled (Recurring)** | Runs on a schedule: pick days of the week, time, and timezone |

### monday.com

Requires the [monday.com integration](https://docs.getlinkai.com/integrations/monday).

| Trigger | When it fires |
|---------|--------------|
| **Item created** | A new item is added to the selected board |
| **Status changed** | A status column value changes on the selected board |

### Shopify

Requires the [Shopify integration](https://docs.getlinkai.com/integrations/shopify).

| Trigger | When it fires |
|---------|--------------|
| **Shopify Order Created** | A new order is created in the connected store |
| **Shopify Order Paid** | An order is marked as paid |
| **Shopify Order Fulfilled** | An order is fulfilled |
| **Shopify Product Created** | A product is created |
| **Shopify Product Updated** | A product is updated |
| **Shopify Product Deleted** | A product is deleted |

### Zoho CRM

Requires the [Zoho CRM integration](https://docs.getlinkai.com/integrations/zoho). A webhook is registered automatically for each trigger.

| Trigger | When it fires |
|---------|--------------|
| **Record Created** | A new record is created in the module you select |
| **Field Changed** | A field value changes on a record in the selected module |
| **Record Deleted** | A record is deleted |
| **Lead Converted** | A lead is converted to a contact, account, or deal |
| **User Created** | A new active user is added to the Zoho CRM org |

### Outlook

Requires [Outlook](https://docs.getlinkai.com/integrations/outlook) or [Outlook Calendar](https://docs.getlinkai.com/integrations/outlook-calendar).

| Trigger | When it fires |
|---------|--------------|
| **Outlook Email Received** | A new message arrives in the connected mailbox |
| **Outlook Event Created** | An event is created on the connected Outlook calendar |
| **Outlook Event Updated** | An Outlook calendar event changes |
| **Outlook Event Cancelled** | An Outlook calendar event is cancelled or deleted |

### Trigger filters

Some triggers support filters that narrow when the workflow fires. For example, fire a form trigger only for one form, or an order trigger only for orders from one agent.

### Trigger variables

Every trigger provides data you can use in your actions. These **variables** use the `{{variable}}` syntax:

- **New Order** gives you `{{orderId}}`, `{{customerName}}`, `{{customerEmail}}`, `{{totalAmount}}`, and more
- **Form Submitted** gives you `{{formName}}`, `{{submissionData}}`, and the submitted field values
- **New Appointment** gives you `{{attendeeName}}`, `{{attendeeEmail}}`, `{{startTime}}`, `{{serviceName}}`, and more

Variables are available in every action after the trigger: email bodies, AI prompts, HTTP request payloads, and anywhere else you need dynamic data.

## Actions

Actions are the steps your workflow runs after the trigger fires. They run in order, and each one can use data from the trigger and from earlier actions.

### Timing

| Action | What it does |
|--------|-------------|
| **Wait** | Pause for a set duration before the next step, such as 30 minutes before a follow-up |
| **Wait for Approval** | Pause until a person approves or rejects. Approve from your dashboard or through Ally. The workflow resumes based on the decision. |

### Messaging

| Action | What it does |
|--------|-------------|
| **Send Email via Gmail** | Send an email from your connected [Gmail](https://docs.getlinkai.com/integrations/gmail) account. Recipient, subject, and body all support variables. |
| **Send Outlook email** | Send a new message from the connected [Outlook](https://docs.getlinkai.com/integrations/outlook) mailbox |
| **Reply to Outlook email** | Reply in the same Outlook conversation. Use `{{messageId}}` from an Outlook Email Received trigger. |

### AI

| Action | What it does |
|--------|-------------|
| **Trigger Agent** | Send context to one of your agents. The agent returns a response you can use in later steps. |
| **Send to Ally** | Send a message to Ally, your personal agent. Ally can process information, take actions, or provide analysis. |
| **AI Transform** | Summarize, rewrite, extract, or analyze text. Feed in data from earlier steps and get structured output back. |
| **AI Decision** | Classify or route based on content. Returns a decision you can use in conditions on later steps. |

### Stripe

| Action | What it does |
|--------|-------------|
| **Create Invoice** | Create and send a Stripe invoice. Set the customer, line items, and amount with trigger variables. |
| **Create Payment Link** | Generate a Stripe payment link, for example to request payment after a booking or order |

### Google

Requires the [Google Calendar](https://docs.getlinkai.com/integrations/google-calendar) integration.

| Action | What it does |
|--------|-------------|
| **Create Calendar Event** | Add an event to your connected Google Calendar. Set the title, time, description, and attendees with variables. |
| **Cancel Calendar Event** | Delete or cancel an existing Google Calendar event |
| **Create document** | Generate a shareable document with AI. Outputs `{{document_url}}` and `{{document_title}}`. |

### Outlook Calendar

Requires the [Outlook Calendar](https://docs.getlinkai.com/integrations/outlook-calendar) integration.

| Action | What it does |
|--------|-------------|
| **Create Outlook event** | Add an event. Optionally create a Teams meeting. |
| **Update Outlook event** | Change the title, time, location, description, or attendees |
| **Cancel Outlook event** | Cancel an event using `{{calendar_event_id}}` |
| **Create Teams meeting** | Create an event with a Teams join link |

### Research

| Action | What it does |
|--------|-------------|
| **Web Search** | Search the web and return results. Use it to look up information, verify data, or gather context for later AI steps. |

### Data

| Action | What it does |
|--------|-------------|
| **Change Order Status** | Update the status of an order in your workspace |

### monday.com

Requires the [monday.com integration](https://docs.getlinkai.com/integrations/monday).

| Action | What it does |
|--------|-------------|
| **Create item** | Add a new item to a board, optionally in a specific group, with column values filled in |
| **Update item columns** | Update one or more column values on an existing item |
| **Move item to group** | Move an item to a different group on the same board |
| **Post update** | Add an update (comment) to an existing item |

### Shopify

Requires the [Shopify integration](https://docs.getlinkai.com/integrations/shopify).

| Action | What it does |
|--------|-------------|
| **Sync products** | Pull the latest Shopify catalog into Orders |
| **Get order** | Look up a Shopify order by ID (`{{orderId}}` from a Shopify trigger) |
| **Add order note** | Add a note to a Shopify order |

### Zoho CRM

Requires the [Zoho CRM integration](https://docs.getlinkai.com/integrations/zoho).

| Action | What it does |
|--------|-------------|
| **Create / update / upsert record** | Write to Leads, Contacts, Accounts, Deals, or another module |
| **Find / get record** | Look up a record by field value or ID |
| **Add note** | Add a note to a record |
| **Add / remove tag** | Tag or untag a record |
| **Convert lead** | Convert a lead to a contact, account, and optional deal |
| **Relate record** | Link two records |
| **Add attachment** | Attach a public file URL to a record |
| **Delete record** | Permanently delete a record |

See [Zoho CRM](https://docs.getlinkai.com/integrations/zoho) for outputs such as `{{zoho_record_id}}` and `{{zoho_record_url}}`.

### Integrations

| Action | What it does |
|--------|-------------|
| **HTTP Request** | Call any external webhook or API. Set the URL, method, headers, and body. Use it for tools without a native integration. |

## Conditions

Each action can have conditions that decide whether it runs. Conditions check data from the trigger and earlier steps.

| Part | What it is |
|------|------------|
| **Field** | The variable to check, such as `totalAmount`, `status`, or `customerEmail` |
| **Operator** | How to compare: `equals`, `not equals`, `greater than`, `less than`, `contains` |
| **Value** | What to compare against |

When an action has several conditions, all of them must be true for it to run. An action with no conditions always runs.

**Examples**

- Only send a Stripe invoice if `{{totalAmount}}` is greater than `100`.
- Only trigger the agent if `{{status}}` equals `completed`.

## Variables

Variables make workflows dynamic. Instead of hardcoding values, reference data from the trigger and from earlier steps.

### Trigger variables

These come from the event that started the workflow:

- `{{orderId}}`, `{{customerName}}`, `{{customerEmail}}`, `{{totalAmount}}`
- `{{attendeeName}}`, `{{startTime}}`, `{{serviceName}}`
- `{{formName}}`, `{{submissionData}}`
- `{{contactName}}`, `{{contactEmail}}`

### Step output variables

Actions can produce output that every later step can use:

| Variable | From |
|----------|------|
| `{{stripe_invoice_url}}` | Create Invoice |
| `{{stripe_payment_link}}` | Create Payment Link |
| `{{ai_summary}}` | AI Transform |
| `{{ai_decision}}` | AI Decision |
| `{{approval_status}}` | Wait for Approval (`approved` or `rejected`) |
| `{{agent_response}}` | Trigger Agent |
| `{{search_results}}` | Web Search |
| `{{document_url}}`, `{{document_title}}` | Create document |
| `{{zoho_record_id}}`, `{{zoho_record_url}}` | Zoho CRM actions |
| `{{shopify_order_id}}`, `{{shopify_order_name}}` | Shopify Get order |
| `{{calendar_event_id}}`, `{{teams_join_url}}` | Outlook Calendar actions |

Use them anywhere in later steps: email bodies, API payloads, AI prompts, and conditions.

## The visual editor

### Canvas

The editor is a visual canvas, built with React Flow. Your trigger sits on the left, and actions flow to the right in a connected chain.

- **Click a node** to open its configuration panel on the right
- **Add nodes** with **Add Step** in the toolbar or the "+" placeholder between nodes
- **Delete nodes** by selecting them and clicking delete in the toolbar
- **Undo and redo** with the toolbar buttons or keyboard shortcuts
- **Zoom and pan** to move around larger workflows
- **Minimap** in the corner for orientation

### Toolbar

| Control | What it does |
|---------|--------------|
| **Workflow selector** | Switch between workflows or create a new one |
| **Settings** | Rename, duplicate, or delete the workflow |
| **Add Step** | Add a new action node |
| **Undo / Redo** | Step backward or forward through changes |
| **Save** | Save the workflow. A dot means unsaved changes. |
| **Active / Paused** | Turn the workflow on or off |
| **Run** | Start a test run |

### Node configuration

Click any node to open its configuration panel:

- **Trigger nodes**: pick the trigger type and set filters, such as which form or which agent
- **Action nodes**: pick the action type, configure it, and optionally add conditions
- **Variables**: available variables are listed and can be inserted into any text field

## AI workflow generation

Describe what you want in plain English, and AI builds the full workflow: trigger, actions, and configuration. It appears on the canvas for you to review and adjust.

Click the AI prompt input at the bottom of the canvas, or press `Cmd+K` / `Ctrl+K`, then describe the workflow and press Enter. Examples:

- "When a new order comes in, wait 10 minutes, then send a thank-you email to the customer"
- "Every Monday at 9am, search the web for industry news and send a summary to Ally"
- "When a form is submitted, use AI to classify the request, and if it's urgent, create a support ticket"

You can:

- **Generate from scratch** on an empty canvas
- **Extend a workflow** by adding steps to one in progress
- **Modify a workflow** by describing the changes

## Run history

Every time a workflow runs, it creates a **run**. Open a workflow in the editor, then open its run history.

Each run shows its status, run ID, when it was triggered, and the trigger payload (expand to view the full data).

| Status | What it means |
|--------|--------------|
| **Completed** (green) | All steps ran successfully |
| **Failed** (red) | A step hit an error and the workflow stopped |
| **Running** (blue) | The workflow is running now |
| **Waiting** (yellow) | The workflow is paused, for example waiting for approval or a timed delay |

## Scheduled workflows

The **Scheduled (Recurring)** trigger runs a workflow on a schedule, with no external event.

| Setting | Options |
|---------|---------|
| **Days of the week** | Which days it runs, such as Monday through Friday |
| **Time** | The time of day, such as 9:00 AM |
| **Timezone** | Eastern, Central, Mountain, Pacific, Alaska, Hawaii, London, Paris, Tokyo, Sydney, and UTC |

Use cases:

- **Daily reports**: every morning, pull your business metrics and send a summary email
- **Weekly outreach**: every Monday, search for leads and send personalized emails
- **Weekly wrap-up**: every Friday at 5 PM, generate a summary with AI and send it to Ally

## Example workflows

### Order follow-up

**Trigger:** New Order

1. Wait 30 minutes.
2. AI Transform: write a personalized thank-you message from the customer's name and order details.
3. Send Email via Gmail: send it to `{{customerEmail}}`.

### Appointment confirmation with calendar sync

**Trigger:** New Appointment

1. Create Calendar Event: add the appointment to Google Calendar with attendee details.
2. Send Email via Gmail: send a confirmation with the appointment time and Google Meet link.

### Form submission triage

**Trigger:** Form Submitted

1. AI Decision: classify the submission as "Sales Lead", "Support Request", or "General Inquiry".
2. Add conditions to the next steps:
   - If `{{ai_decision}}` equals "Sales Lead", Trigger Agent (your sales agent).
   - If `{{ai_decision}}` equals "Support Request", create a support ticket.
   - If `{{ai_decision}}` equals "General Inquiry", Send Email via Gmail with an auto-response.

### Invoice after booking

**Trigger:** New Appointment

1. Create Invoice: generate a Stripe invoice for the service price, sent to `{{attendeeEmail}}`.
2. Send Email via Gmail: send a booking confirmation with the invoice link.

### Weekly business digest

**Trigger:** Scheduled (Recurring), every Monday at 8:00 AM

1. Send to Ally: "Give me a summary of last week's orders, appointments, and open tickets."
2. AI Transform: format Ally's response into an email digest.
3. Send Email via Gmail: send the digest to your inbox.

### Human-in-the-loop approval

**Trigger:** New Order (where total > $500)

1. Wait for Approval: notify you that a high-value order needs review.
2. If `{{approval_status}}` equals "approved":
   - Change Order Status to "confirmed".
   - Send Email via Gmail to confirm the order with the customer.
3. If `{{approval_status}}` equals "rejected":
   - Change Order Status to "cancelled".
   - Send Email via Gmail to notify the customer.

## Tips

- **Start small.** Begin with a trigger and one action, then add steps.
- **Test before activating.** Click **Run** in the toolbar.
- **Check run history.** It shows exactly where a run failed.
- **Use variables everywhere.** Dynamic workflows are more useful.
- **Combine AI actions.** Chain AI Transform, AI Decision, and Trigger Agent.

## FAQ

**How many workflows can I have?**
There's no limit on the number of workflows per workspace.

**Do workflows run in the background?**
Yes. Once a workflow is active, it runs whenever the trigger event happens. You don't need the dashboard open.

**What happens if a step fails?**
The workflow stops at the failed step and the run is marked **Failed**. Check the run history to see what went wrong. Other workflows aren't affected.

**Can I pause a workflow without deleting it?**
Yes. Toggle it to **Paused** in the toolbar. It keeps its configuration but won't fire until you reactivate it.

**Can I duplicate a workflow?**
Yes. Open the workflow settings and click **Duplicate**. The copy has "(copy)" in its name and is paused by default.

**Do conditions support OR logic?**
Not directly. All conditions on a step must be true for it to run. For OR logic, create separate branches or use an AI Decision step to route.

**How does Wait for Approval work?**
The workflow pauses and creates an approval request. Approve or reject from your dashboard or through Ally. The workflow resumes with `{{approval_status}}` set to `approved` or `rejected`, which you can use in conditions on later steps.

**Can I use workflows with my agents?**
Yes. The **Trigger Agent** action sends data to any of your agents. The agent returns a response you can use in later steps.

**Can workflows call external APIs?**
Yes. The **HTTP Request** action calls any URL with a custom method, headers, and body.

## Next steps

**[Procedures](https://docs.getlinkai.com/agents/procedures)**:
Give an agent fixed steps to follow inside a conversation.

**[Ally](https://docs.getlinkai.com/getting-started/ally)**:
Send work to your personal agent and approve requests.

**[Stripe](https://docs.getlinkai.com/integrations/stripe)**:
Create invoices and payment links from a workflow.

**[Custom Connections](https://docs.getlinkai.com/integrations/custom-connections)**:
Connect tools that don't have a native integration.
