Automations

Email automations that start on your own events.

Send an event and every enabled email automation that listens for it starts a run for that contact: send an email, wait, branch, update the contact. You write the flow as steps and connections, in the API or in the dashboard.

Free plan with 100 emails a day. No credit card.

import { BillionSend } from "@billionsend/node";
const bs = new BillionSend(); // reads BILLIONSEND_API_KEY
const { data, error } = await bs.automations.create({
name: "Welcome",
steps: [
{ key: "start", type: "trigger", config: { event_name: "user.signed_up" } },
{ key: "welcome", type: "send_email", config: { template: { id: "welcome" } } },
{ key: "wait", type: "wait_for_event",
config: { event_name: "user.activated", timeout: "3 days" } },
{ key: "nudge", type: "send_email", config: { template: { id: "reminder" } } },
],
connections: [
{ from: "start", to: "welcome" },
{ from: "welcome", to: "wait" },
{ from: "wait", to: "nudge", type: "timeout" },
],
});
if (error) throw error;
await bs.automations.update(data.id, { status: "enabled" });
await bs.events.send({ event: "user.signed_up", email: "ana@example.com" });

// 200 { "object": "automation", "id": "7d2e9a14-…" }

  • 8step types
  • 100steps in one automation
  • 30days is the longest wait
  • 500automations per team

How it works

From an email automation on paper to a run for a contact.

Three steps. A new email automation starts disabled, so nothing runs by accident.

  1. 01

    Write the flow

    Describe the email automation's steps and connections in the dashboard or with POST /automations. Each step has a key, a type and a config.

  2. 02

    Check, then enable

    Validate the draft or simulate one contact's pass without sending anything. Enabling checks every template, sender domain, topic and segment against your account.

  3. 03

    Send an event

    POST /events/send starts a run for every enabled email automation that listens for that event name. Follow each run, step by step, in the dashboard or the API.

Steps

8 step types, one job each.

A flow branches only at conditions and waits.

StepWhat it doesLimits
triggerWhere the flow starts: the event whose arrival starts a run.One per automation, and nothing connects into it.
delayRests for a duration such as 2 hours or 1 day 12 hours.From 1 second to 30 days.
send_emailSends a published template to the contact, as transactional email.The sender domain must be verified. Opt-outs and suppressions skip the step.
wait_for_eventRests until the contact gets an event, or the timeout passes, with an optional filter on the payload.Without a timeout it waits 30 days.
conditionGoes one way when a rule on the event or the contact holds, the other when it does not.Rules can be nested and combined.
contact_updateChanges a contact's names, its team-wide unsubscribed switch or its properties.A property must already be defined for the team.
contact_deleteDeletes the contact.The contact's other runs are canceled.
add_to_segmentAdds the contact to a segment.The segment must exist, or the step fails.

In your code

Read a run, then fix the step.

Every run and every step has a status, and a failed step carries an error code and a message.

  • runningThe run is on a step or resting in a delay or a wait. Nothing to do.
  • completedNo connection leaves the last step, so the run is done.
  • skippedA send_email step skipped a recipient who unsubscribed or is suppressed. output.reason says why, and the run goes on.
  • failedA step failed or the run passed 90 days. Read the step's error code, fix the cause and send the event again.
  • cancelledYou canceled the run, or its contact was deleted.
GET https://api.billionsend.com/automations/{id}/runs/{run_id}
{
"object": "automation_run",
"id": "…",
"status": "completed",
"started_at": "2026-11-18T09:00:00.000Z",
"completed_at": "2026-11-18T09:00:01.000Z",
"steps": [
{ "key": "start", "type": "trigger", "status": "completed" },
{ "key": "welcome", "type": "send_email", "status": "skipped",
"output": { "reason": "domain_unsubscribed" } }
]
}

Where it fits

Use email automation for automated emails that follow what people do.

  1. 01

    Welcome and onboarding drip campaign

    Build an email automation that sends a welcome on sign-up, waits for the activation event, and nudges only the people who have not activated.

  2. 02

    Trials and renewals

    Start a run on an event from your billing system and branch on a plan property or an amount in the payload.

  3. 03

    Carts and follow-ups

    Wait for a purchase event with a timeout, and send a reminder only when the timeout branch is taken.

  4. 04

    Housekeeping

    Update a contact's properties, add them to a segment or delete them when an event says so, in the same flow as the email.

Before you enable

Plan for checks, edits and cost.

  • HTTP 422Checked before it runs

    Enabling checks the whole flow against your account. Each problem comes back with the JSON Pointer of the field to change, such as /steps/2/config/duration.

  • HTTP 409Enabled flows are fixed

    An enabled email automation's steps cannot change. Stop it, or duplicate it and change the copy. A run keeps the version it started on.

  • HTTP 403People enable

    An agent key or an MCP connection can write a draft and stop an automation, but only a person in the dashboard, or an integration's own API key, can enable it.

  • CostEmails count, runs do not

    An automation's email counts against your plan like any transactional email. Runs are not metered. A contact can have 20 open runs of one automation, and a run lasts at most 90 days.

Around the flow

Feed it, or let an agent write it.

Events start the flow, and agents write drafts for a person to enable.

  • Custom events

    Send an event with one call, type its payload with a schema and retry safely with an idempotency key.

    Custom events
  • MCP server

    An agent can validate a draft, simulate a contact's pass and stop an automation. Enabling stays with a person.

    MCP server

FAQ

Questions, answered.

Something missing? Ask us at support@billionsend.com.

Send your first email in five minutes.