# Build your first workflow in the console

Create a workflow, choose its trigger, add a Send Email step, set re-entry and limits, publish it, then watch a run complete step by step.

A workflow waits for an event and then does something. This guide builds one
for Acme Analytics: each new contact in the audience gets a welcome email.
Nothing in your app changes, because adding a contact already emits the
event the workflow listens for.

> **Note:**
  A [sender](/email/connect-a-sender) and an [email
  template](/email/create-a-template) (here **Welcome to Acme Analytics**). A
  console role that can create workflows, and to see the run, read workflow
  runs.

## 1. Open Workflows

[Open Workflows in the console](https://console.buildbase.app/dashboard/admin/workflows)

In the left rail choose **Workflows**. **All workflows** lists each one with
its status, its runs and when it last changed. Press **New workflow**.

![The Workflows page, with the Workflows menu item highlighted as step 1 and the New workflow button as step 2](/images/workflows/build-your-first-workflow/list.webp)

## 2. Name it

In **Create workflow**, fill **Name** (here **Welcome new contacts**) and, if
you like, a description, then press **Create**. The builder opens on the new
draft. A draft never runs.

![Create workflow: Name Welcome new contacts highlighted as step 2, the description, and the Create button](/images/workflows/build-your-first-workflow/create-dialog.webp)

## 3. Add the trigger

The empty canvas has one button, **Add trigger**. Press it.

![The empty builder with the Add trigger button highlighted as step 3](/images/workflows/build-your-first-workflow/add-trigger.webp)

## 4. Choose what starts it

**Choose trigger** lists every event a workflow can start from. Search for
`member created` and pick **Audience Member Created**: it fires when a contact
is added to your audience, from the console, from your server through the
API, or when someone signs up to your app. A contact imported from a file does
not fire it. Every trigger is in [Triggers and
actions](/workflows/triggers-and-actions).

![Choose trigger, searched for member created, with Audience Member Created highlighted as step 4](/images/workflows/build-your-first-workflow/choose-trigger.webp)

## 5. Add a step after it

Press the **+** under the trigger, search for `send email` and pick **Send
Email**.

![The trigger on the canvas, with the + under it highlighted as step 5](/images/workflows/build-your-first-workflow/add-step.webp)

## 6. Set up the email

The step's panel opens beside the canvas. Leave **Email Mode** on **Use
Template**, keep **Email type** on **Transactional**, then pick the **Email
Template** and the **Sender**. For **Recipient Email** press `{ }` (Use data
from a previous step), then **Select from previous step...**, and pick
**Email** under the trigger: the address of the contact who was added. The
field offers contacts from your audience or data from earlier steps; it does
not take a typed address. The builder saves the draft as you go.

![The Send Email step: Email Mode Use Template, Email type Transactional, Email Template Welcome to Acme Analytics, Sender Acme mail, and Recipient Email set to the trigger's email, highlighted as step 6](/images/workflows/build-your-first-workflow/send-email-config.webp)

A **Marketing** email needs an unsubscribe link and your postal address in its
template, or the step is skipped, and it is never sent to anyone who
unsubscribed.

## 7. Check its settings

Press **Settings** in the header. **Workflow settings** holds:

- **Frequency cap**: at most this many emails, and push notifications, a day to one contact from this workflow. `0` is no limit.
- **Re-entry prevention**: **Allow always**, **Once only**, or **Cooldown** with its minutes ([re-entry](/workflows/overview#re-entry)).
- **Execution limits**: **Max concurrent** runs, **Max duration (hours)** of one run and **Max triggers / min**.
- **Exit conditions**: end a run early, once something becomes true ([exit conditions](/workflows/versions-and-history#exit-conditions)).

A welcome email goes once per contact, so choose **Once only** and press
**Save settings**.

![Workflow settings: Frequency cap, Re-entry prevention, Execution limits, and the Save settings button highlighted as step 7](/images/workflows/build-your-first-workflow/settings.webp)

## 8. Publish it

Press **Publish**. **Publish workflow** counts the steps and connections it
will publish. Add a **Message** if you like, saying what changed, and press
**Publish**.

![Publish workflow: 2 nodes and 1 connection will be published, the message, and the Publish button highlighted as step 8](/images/workflows/build-your-first-workflow/publish-dialog.webp)

## 9. It is live

The header now shows the **Live** switch, on. Turn it off to pause the
workflow, and on again to resume it. Each later publish saves a new
[version](/workflows/versions-and-history#versions).

![The builder header with the Live switch on, highlighted as step 9, beside Publish](/images/workflows/build-your-first-workflow/live.webp)

## 10. Add a contact

Choose **Audience**, press **Add member** and add one. Each contact added from
now on starts a run.

## 11. Find the run

Under **Workflows**, choose **Runs**. **Workflow runs** has one row per run,
with its status, its workflow, the trigger that started it and how long it
took.

![Workflow runs, with the View button and the Completed status of the Welcome new contacts run highlighted as step 11](/images/workflows/build-your-first-workflow/runs.webp)

## 12. Open it

Press **View** on the row. The run shows its flow on the left and each step's
status, input and output on the right. A failed step shows its error here, and
**Retry failed** runs it again ([monitoring](/workflows/monitoring)).

![The run: the trigger and the Send Email step, each completed, with the Send Email step highlighted as step 12](/images/workflows/build-your-first-workflow/run-detail.webp)

## Check it works

The run is **Completed**, both steps are completed, and **Messaging**, then
**Email history**, has the welcome email to the contact you added.

## Things to watch out for

- **A draft never runs,** however many events arrive. Publish it.
- **Editing a published workflow changes only its draft.** What runs stays the same until you publish again.
- **There is no test button.** To run a draft without a real event, call [`/test`](/workflows/overview#testing-before-publishing).
- **Once only needs someone to key on.** It reads the contact from the event; an event naming no one starts a run every time ([re-entry](/workflows/overview#re-entry)).
- **A run that failed does not count for Once only,** so the contact enters again at the next event, once you fix the step.
- **Your plan caps workflows,** and some steps belong to higher plans.

## If something goes wrong

| What you see                     | What it means                                                                                                                                                  |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Required fields missing          | A step misses a required field: the builder marks it. Fill it and publish again.                                                                               |
| Broken references found          | A merge tag names a step or field that is not there. Fix the tag and publish again.                                                                            |
| Nothing to publish               | The draft is the same as the published version.                                                                                                                |
| No run appears                   | The workflow is a draft or paused, or the event never arrived: look in **Failed jobs** ([the dead-letter queue](/workflows/monitoring#the-dead-letter-queue)). |
| The run **Failed** at Send Email | Open the step: its error says why, such as a sender that cannot send. Fix it and press **Retry failed**.                                                       |

## Next Steps

- [Templates](/workflows/templates) - start from a working workflow instead of a blank canvas.
- [Triggers and actions](/workflows/triggers-and-actions) - every trigger, action and condition.
- [Monitoring](/workflows/monitoring) - runs, retries and the dead-letter queue.
- [Versions and history](/workflows/versions-and-history) - compare and restore versions, exit conditions and frequency caps.
