# Workflows Overview

> Automate what happens before and after voice calls with Edesy workflows - triggers, steps such as voice call, WhatsApp, SMS, email, CRM update, Google Sheets and payment links, and execution history with retry.

Source: https://edesy.in/docs/voice-agent/workflows

A workflow is an automation that starts on a trigger and runs a sequence of steps. Triggers include a call ending, data being extracted, an API request, a schedule or a CRM webhook. Steps include placing a voice call, sending WhatsApp, SMS or email, updating a CRM or Google Sheet, sending a payment link, booking a calendar slot, and branching with conditions and delays.

## At a glance

| Item | Value |
|------|-------|
| Triggers | Call ended (filter by outcome), Data extracted, Manual, API call, Scheduled, CRM webhook |
| Steps | 15 step types. See [triggers and steps](https://edesy.in/docs/voice-agent/workflows/triggers-and-steps) |
| Variables | Call fields and extracted fields as `{{variable}}`, for example `{{recipientPhone}}`, `{{disposition}}` |
| Statuses | Draft, Active, Paused, Archived |
| History | Every execution with step-by-step status, retry and backfill |
| As a tool | A workflow can be published as a tool the agent calls mid-call |
| Templates | Appointment confirmation, lead follow-up, order status, callbacks, loan collection by DPD bucket. See [templates](https://edesy.in/docs/voice-agent/workflows/templates) |

## Build a workflow

1. Open **Workflows** and click to create one, or start from a [template](https://edesy.in/docs/voice-agent/workflows/templates).
2. Pick a trigger. For call-based triggers, choose which agents it listens to (all agents, one or several).
3. Add steps on the canvas. Use **Condition** to branch and **Delay** to wait.
4. Use variables in each step, for example a WhatsApp template with `{{recipientName}}` and `{{callSummary}}`.
5. Save as **Draft**, test it, then set it to **Active**.
6. Watch runs in the execution history.

## Execution history, retry and backfill

| Feature | What it does |
|---------|--------------|
| Execution history | Lists each run with its trigger data and the status of every step (completed, failed, skipped) |
| Retry | Re-runs a failed execution after you fix the cause |
| Backfill | Runs a new or changed workflow over past calls that would have matched its trigger |

## Example: hot lead follow-up

```text
Trigger:  Data extracted (agent: Real Estate Lead)
Step 1:   Condition  buying_intent == "high"
Step 2:   CRM update   status = "Hot", notes = {{callSummary}}
Step 3:   WhatsApp template  "site_visit_options" to {{recipientPhone}}
Step 4:   Google Sheets append  name, phone, budget_range
```

## FAQs

**Should I use "Call ended" or "Data extracted"?**
Use **Call ended** for actions that only need the call result. Use **Data extracted** when a step needs fields from your extraction template.

**Can a workflow place another call?**
Yes. The **Voice call** step calls a number with any agent and can wait until that call ends or its data is extracted.

**Can my agent run a workflow during a call?**
Yes. Publish the workflow as a tool. See [built-in tools](https://edesy.in/docs/voice-agent/tools#run-workflow).

**Can I trigger a workflow from my own system?**
Yes. Use the API trigger: `POST /api/v1/workflows/{id}/trigger` with a server API key. Grant the key `workflows:write`; scope checks are not yet enforced on this endpoint, but will be.

## Related

- [Triggers and steps reference](https://edesy.in/docs/voice-agent/workflows/triggers-and-steps)
- [Workflow templates](https://edesy.in/docs/voice-agent/workflows/templates)
- [Outcome actions](https://edesy.in/docs/voice-agent/post-call/outcome-actions)
