# Workflows

Workflows are Bento's automation engine. They respond to events and conditions, executing actions automatically. When something happens, a Workflow can send emails, add tags, update fields, route people to Sequences, and more.

## What is a Workflow?

A Workflow is a visual automation that starts with a trigger and executes a series of steps. Think of it as "when this happens, do that" with the ability to branch, delay, and make decisions.

A simple Workflow might look like:

1. **Trigger**: Someone submits a signup form
2. **Action**: Add the tag "newsletter-subscriber"
3. **Action**: Add to welcome Sequence
4. **Wait**: 14 days
5. **Condition**: Did they purchase?
6. **If yes**: Add tag "customer"
7. **If no**: Add to re-engagement Sequence

## Workflow Components

### Triggers

Triggers start a Workflow. Common triggers include:

- **Event received**: A specific event is tracked
- **Form submitted**: A Bento form is completed
- **Tag added**: A tag is applied to a person
- **Segment entered**: Someone matches a segment's criteria
- **Webhook received**: An external system sends data

### Actions

Actions are what the Workflow does. Available actions include:

- **Send email**: Queue an Email Template to the person
- **Add to Sequence**: Start them in an email Sequence
- **Add tag**: Apply a tag to their profile
- **Remove tag**: Remove a tag from their profile
- **Set field**: Update a field value
- **Trigger event**: Create an internal event
- **Send webhook**: Notify an external system

### Delays

Delays pause the Workflow for a specified time:

- Wait 1 hour before the next step
- Wait 3 days before sending a follow-up
- Wait until a specific time of day

### Conditions

Conditions branch the Workflow based on criteria:

- If they have the tag "customer", go left
- If they don't have the tag "customer", go right
- If their field "plan" equals "premium", take this path


> A person can be in multiple Workflows simultaneously. Each Workflow runs independently.


## Workflows vs Sequences

Workflows and Sequences serve different but complementary purposes:

| Workflows                  | Sequences                 |
| -------------------------- | ------------------------- |
| Decision and routing logic | Linear email delivery     |
| Event and condition-based  | Time-based progression    |
| Can do many actions        | Focused on sending emails |
| Branches and conditions    | Straightforward series    |

**Workflows orchestrate**, **Sequences deliver**.

A typical pattern:

1. Workflow triggers on signup
2. Workflow checks conditions and adds tags
3. Workflow adds person to appropriate Sequence
4. Sequence delivers emails over time
5. Workflow continues monitoring and routing

## Common Workflow Patterns

**Welcome Automation**

- Trigger: Form submitted (signup form)
- Add tag "subscribed"
- Add to welcome Sequence
- Wait 14 days
- Check: Are they a customer?
- If yes: Add to customer Sequence
- If no: Add to nurture Sequence

**Purchase Follow-up**

- Trigger: Event "$purchase"
- Send thank you email
- Set field "customer" to "yes"
- Add tag "customer"
- Wait 7 days
- Send review request email

**Cart Abandonment**

- Trigger: Event "added_to_cart"
- Wait 1 hour
- Check: Did they purchase?
- If no: Send reminder email
- Wait 1 day
- Check: Did they purchase?
- If no: Send discount email

**Lead Scoring Response**

- Trigger: Segment entered (high-engagement segment)
- Add tag "hot-lead"
- Send webhook to CRM
- Send internal notification email

## Building Workflows

The Workflow builder is a visual canvas where you:

1. Add a trigger to start
2. Drag in actions, delays, and conditions
3. Connect steps in sequence or branches
4. Configure each step's settings
5. Activate when ready

Workflows can be as simple as two steps or as complex as multi-branch journeys with dozens of decision points.

## Workflow Status

Workflows can be:

- **Draft**: Being built, not active
- **Active**: Running and processing people
- **Paused**: Temporarily stopped
- **Archived**: No longer in use

People already in a Workflow continue through it even if you pause or archive. Only new entries are affected.

## How Workflows Connect to Other Concepts

Workflows orchestrate everything:

- **Events** trigger Workflows
- **People** move through Workflows
- **Tags** are added/removed by Workflows
- **Fields** are updated by Workflows
- **Email Templates** are sent by Workflows
- **Sequences** are entered via Workflows
- **Segments** can trigger Workflow entry

Workflows are where automation happens. They turn your data and events into timely, relevant actions and communications.