> ## Documentation Index
> Fetch the complete documentation index at: https://help.leaf360.com/llms.txt
> Use this file to discover all available pages before exploring further.

# The workflow builder

> Building a Leaf360 Mortgage CRM workflow: triggers, actions, branching and delays on the builder screen, the AI assistant that can build it for you, and how to test one before it touches a real record.

Every workflow starts with one trigger, followed by a chain of steps laid out top to bottom on the builder screen. Open an existing one from **My Workflows** on the [Workflows](/mortgage-crm/workflows) dashboard, or press **Create Workflow** there to start blank.

## Starting from nothing

Instead of an empty grid, a blank workflow opens with an AI prompt box. Type what you want in plain language — for example, *"When a new lead comes in, send an email and assign a task"* — or pick one of six suggestions, and Leaf360 builds the trigger and steps for you, showing its progress as it sets up each one and a summary of what it built when it's done. The same assistant stays available afterward behind the sparkle icon in the header, so you can ask it to add a step, explain what a step does, or fix something instead of building by hand.

You can just as easily skip all that and drag steps from the left sidebar onto the builder screen yourself.

## Trigger, then steps

A workflow needs exactly one trigger before anything else can be added. The trigger picker groups by record type:

| Group            | Examples                                                                                                                                                 |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Lead             | Lead Created, Lead Stage Changed, Lead Field Updated                                                                                                     |
| Contact          | Contact Created, Contact Stage Changed, Contact Field Updated                                                                                            |
| Loan             | Loan Created, Loan Status Changed, Loan Field Updated, Loan Tracker Updated, RESPA Completed                                                             |
| Tags             | Tag Added or Removed, scoped to leads, loans, or contacts separately                                                                                     |
| Tasks & meetings | Task Completed, Meeting Scheduled                                                                                                                        |
| General          | Webhook, Receive Email, Calendar Date, Schedule (Recurring), Email Parser, Website Visit, Leaf360IQ: Properties Found, Manual Enrollment / Drip Campaign |

Once you set a trigger, Leaf360 only shows you actions that match that trigger's record type — so a loan workflow won't offer you an action that only makes sense on a lead.

Add a step by clicking the **+** below any existing step, or by dragging one from the sidebar onto the line connecting two steps. Steps in the middle of a straight chain can be dragged up or down to reorder; the trigger and anything inside a branch stay put.

## What a step can do

| Category             | What's in it                                                                                                                                                                                                                     |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Communication**    | Send Email, Reply in Email Thread, Send SMS, Send Email or SMS to a 3rd Party                                                                                                                                                    |
| **Records**          | Create Task, Create Note, Add or Remove Tag, Add or Remove Team Members, Create Lead, Create Contact, Convert Lead to Contact, Update Field, Update Linked Lead, Assign Lead, Assign Loan, Assign Contact                        |
| **Workflow control** | Start Workflow, Stop Workflow, Stop All Workflows                                                                                                                                                                                |
| **AI & advanced**    | Run AI Agent, AI Content Writer (drafts the email or SMS body), AI Email Parser, HTTP Request, HTTP Request + Wait for Callback, LIA Research Agent (browses to research news, listings, or enrich a contact), Send Notification |
| **Integrations**     | Follow Up Boss, Push to Fello                                                                                                                                                                                                    |
| **AI Agents**        | Document Analyzer, Application Reviewer, Inbound Agent, Outbound Agent                                                                                                                                                           |
| **Logic & flow**     | If/Else, Router/Switch, Delay, Transform Data, Loop (jump back to an earlier step)                                                                                                                                               |
| **Connectors**       | Slack, Google Calendar, Gmail, Google Meet, Google Drive, Google Docs, Google Sheets, Microsoft Teams, Zoom, Outlook, HubSpot, Salesforce, Typeform, Zapier, and more                                                            |

A Send Email or Send SMS step can target the record itself, a person on the loan, or a specific team role, and can expand to reach a whole group of contacts or leads matching a filter instead of just one record.

### Branching, delays and loops

**If/Else** splits on one condition; **Router/Switch** splits into as many named branches as you need, with an optional default path. Conditions compare a field to a value — equals, contains, starts with, is empty, greater than or equal, and similar comparisons — on any lead, loan, or contact field.

**Delay** can wait a fixed duration, until a specific date, until a particular day and time, until a date stored on the record, or until a condition becomes true.

**Loop** jumps back to an earlier step. The builder draws a visible box around the loop so you can see exactly what repeats. Set an optional **Max Iterations** to stop it from looping forever.

## Configuring a step

Click any step to open its settings in the panel on the right. What you see depends on the step: a trigger shows its record type and, for status triggers, which specific statuses it fires on; a send action shows a template picker, recipient targeting, and a merge-variable browser; a condition shows its field, comparison, and value rows; a connector shows its own account and field mapping. Closing the panel or clicking elsewhere keeps whatever you set.

## Saving, testing, and going live

The header shows the workflow's name and a small status label (**draft**, **active**, or **paused**), plus this row of controls:

| Control      | What it does                                                              |
| ------------ | ------------------------------------------------------------------------- |
| Sparkle icon | Opens the AI assistant                                                    |
| Play icon    | Opens **Test run**                                                        |
| Save         | Saves the workflow. Grayed out until you've changed something             |
| History      | Opens **Execution History**                                               |
| Settings     | Opens settings for the whole workflow                                     |
| Play / Pause | Activates or pauses the workflow. Saves first if you have unsaved changes |
| ⋯            | Duplicate, Execution History, Settings, Activate/Pause, and Delete        |

Leaving with unsaved changes prompts you to save, discard, or cancel rather than losing them silently.

### Testing before you activate

**Test run** needs a saved workflow, and gives you two starting points:

<Steps>
  <Step title="Sample Data">
    Runs against sample data you edit by hand, pre-filled with realistic values for a lead, loan, or contact. This mode never touches a real record and never sends anything, no matter what you type in it.
  </Step>

  <Step title="Real Record">
    Search for and pick an actual lead, loan, or contact, then choose how the run behaves against it.
  </Step>
</Steps>

Picking a real record still defaults to **Dry run**: the workflow simulates against that record's real data, and no email, SMS, task, or field update actually happens. Switching to **Live run** is a separate, clearly marked choice, shown in red, that will actually fire everything in the workflow against that record — and a second confirmation box repeats the warning before anything sends. A live run also lets you override who the messages appear to send from, and optionally skip delay steps so you're not waiting on a real timer to see the rest of the workflow run.

<Warning>
  Only run a live test against a record you actually own and are comfortable contacting for real. It sends for real.
</Warning>

A failed test names the step that failed, an explanation, and, where Leaf360 has one, a suggested fix.

### If a step fails once it's live

An action step that fails — a bad phone number or a provider error — is marked failed and the workflow moves on to the next step; it isn't retried. A step that can't run at all, most often a missing phone or email on the recipient, is marked skipped rather than failed, and the workflow still continues. A branching, delay, or data step that fails is different: since Leaf360 can't know which path to take next, the entire run stops there. Every run's step-by-step outcome — success, failed, or skipped — is visible afterward in Execution History.

### Execution History

The clock icon opens a running list of this workflow's own runs: status, whether it was a test, how long it took, and a breakdown of which steps succeeded, failed, or were skipped, with the specific error on any failure. A run that's paused partway through — usually because it's waiting on a response from an outside system — can be resumed from here.

### Workflow settings

The gear icon opens description, category, and two behaviors that apply to the whole workflow rather than one step:

* **When the client responds** — a call or text reply from the record — you choose to keep the workflow running, pause it for that person, or stop it for that person outright.
* **Stop when record leaves trigger status** cancels the workflow for a record once its status no longer matches what the trigger originally fired on. This only applies to workflows triggered by a status change.

## Common problems

<AccordionGroup>
  <Accordion title="Test run says Save the workflow first">
    Testing needs a saved workflow. Press Save, then open Test run again.
  </Accordion>

  <Accordion title="I can't find Send Test or Live Run">
    Live run only appears once you switch **Real Record** mode to **Live run** and pick a record; Sample Data mode never offers it, on purpose.
  </Accordion>

  <Accordion title="A step I dragged snapped back to where it was">
    The trigger and anything inside a branch cannot be reordered by dragging. Only steps in a straight chain move.
  </Accordion>

  <Accordion title="My workflow won't activate">
    Activation needs a saved workflow with no unsaved changes; the builder saves for you first if needed, but a validation error on a step will still block it. Check the step the error names.
  </Accordion>

  <Accordion title="A loop never seems to stop">
    Set Max Iterations on the Loop step. Left blank, it has no built-in ceiling.
  </Accordion>
</AccordionGroup>

## Related

* [Workflows and Automation](/mortgage-crm/workflows)
* [Workflow Templates](/mortgage-crm/workflow-templates)
* [Email Templates](/mortgage-crm/email-templates)
* [SMS Templates](/mortgage-crm/sms-templates)
* [Leaf360 Mortgage CRM](/mortgage-crm/overview)
