# Workflows

Workflows define a proactive GTM playbook for your agents to execute. Instead of waiting for leads to reach out, workflows let Spara take action — sending emails, making calls, and routing leads through multi-step sequences based on their data and behavior.

For example, a Voice agent deployed to a phone number picks up incoming calls. Add a **Call Phone** step to a workflow and that same agent dials leads proactively — turning an incoming tool into an outgoing engine.

<figure><img src="/files/2uJIiRtB82n39o7nUPDs" alt=""><figcaption><p>A workflow with triggers, conditions, branching logic, calls, emails, and waits.</p></figcaption></figure>

## Core Concepts

### Triggers

Every workflow starts with a **Trigger** — the criteria that defines which leads enter the workflow. Triggers can include multiple condition groups combined with AND/OR logic, giving you precise control over which leads are enrolled.

Any field in Spara's [Data Model](/platform/data-model.md) is available as trigger criteria — including fields captured by your agents, synced from your CRM, or tracked from website activity.

<figure><img src="/files/8kcSfQWnQFfQZHsPjoHo" alt=""><figcaption><p>Trigger criteria with multiple conditions combined using AND logic.</p></figcaption></figure>

{% hint style="info" %}
A workflow continues to operate on a lead even if that lead no longer matches the trigger criteria after entering. Triggers only control entry.
{% endhint %}

{% hint style="info" %}
Spara evaluates leads who have been active within the **past 365 days** for new-lead workflows. A lead active in the last year but not the last month will still be eligible to enter.
{% endhint %}

### Steps

Steps are the individual actions in a workflow. Each step executes in sequence — when one finishes, the next begins. Use **Wait** steps to introduce delays and **Condition** steps to branch logic.

| Step                                                | What it does                                                                    |
| --------------------------------------------------- | ------------------------------------------------------------------------------- |
| [**Send Email**](/agents/workflows/send-email.md)   | Sends a personalized email to the lead or their assigned rep                    |
| [**Send Text**](/agents/workflows/send-text.md)     | Sends an SMS to the lead's phone number                                         |
| [**Call Phone**](/agents/workflows/call-phone.md)   | Uses a Voice agent to call the lead's phone number                              |
| [**Notify**](/agents/workflows/notify.md)           | Sends a Slack or Microsoft Teams notification to your team                      |
| [**Wait**](/agents/workflows/wait.md)               | Pauses execution for a set duration (minutes, hours, or days, up to 30 days)    |
| [**Time of Day**](/agents/workflows/time-of-day.md) | Holds leads until a specific clock time is reached (in your account's timezone) |
| [**Condition**](/agents/workflows/condition.md)     | Branches workflow logic based on lead data                                      |
| [**API**](/agents/workflows/api.md)                 | Makes an HTTP request to an external system and can extract data                |
| [**Prompt**](/agents/workflows/prompt.md)           | Runs a custom AI prompt and extracts structured data from the response          |

{% hint style="warning" %}
If a step cannot execute (e.g., a **Call Phone** step for a lead with no phone number), the workflow skips it and continues to the next step.
{% endhint %}

### Workflow Settings

Workflow settings control when a lead should automatically exit a workflow based on engagement. These are configurable per workflow:

* **End on email reply** — Lead exits when they reply to an email from a Send Email step
* **End on text reply** — Lead exits when they respond to a text from a Send Text step
* **End on call answer** — Lead exits when they pick up a call from a Call Phone step

All three are enabled by default. Disable them if you want leads to continue through the workflow even after engaging.

{% hint style="info" %}
For a step-by-step walkthrough of building a workflow, see the [https://docs.spara.com/guides/building-your-first-workflow](https://docs.spara.com/guides/building-your-first-workflow "mention") guide.
{% endhint %}

### Workflow Execution

**A lead only enters a workflow once.** Updating trigger criteria does not cause leads who already entered to re-enter.

**Unpublishing pauses execution.** Leads already in the workflow will not continue until you republish. Republishing resumes from where each lead left off — it does not restart the workflow.

**Misconfigured steps don't stop the whole workflow.** If a published step becomes misconfigured (e.g., a disconnected Twilio account), leads that reach that step are paused there. Other steps continue to execute normally. Fix the configuration and paused leads will resume.

**Engagement-based exits.** When workflow settings are enabled, leads automatically exit the workflow when they reply to an email, respond to a text, or answer a call from a workflow step.

## FAQ

### Can a lead be in multiple workflows at the same time?

Yes. A lead can be enrolled in multiple workflows simultaneously. Each workflow operates independently.

### What happens if I change a workflow that already has leads in it?

Unpublished changes do not affect leads currently in the workflow. When you publish, new leads will follow the updated workflow. Leads already in progress continue from their current step.

### How do I test a workflow before going live?

Save the workflow as a draft without publishing. When you open the **Test** panel from the workflow editor, Spara automatically generates a test lead pre-filled with values that satisfy your trigger criteria and any condition branches on the happy path — so you can start a test immediately without filling in fields manually. You can adjust individual field values before running the test. When ready, publish to start enrolling leads.

### Can workflows send messages to the assigned sales rep?

Yes. The **Send Email** and **Notify** steps can target the lead's assigned sales rep. Use **Send Email** to CC or send directly to the rep, and **Notify** to alert them via Slack or Teams.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spara.com/agents/workflows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
