Automations
Delay
Pause an automation for a fixed duration before continuing to the next step.
A delay step pauses the automation for a specified duration before continuing to the next step. See Using automations for how steps chain together.
Common use cases:
- Email sequences — space out emails in an onboarding series.
- Cooldowns — prevent sending too many emails in a short period.
- Follow-ups — give users time to take action before sending a reminder.
How it works
In the dashboard you configure a delay duration in natural language. Over the API, the delay step accepts a single duration field with a human-readable time value.
import { MailBlastr } from 'mailblastr';
const mb = new MailBlastr('mb_xxxxxxxxx');
const { data, error } = await mb.automations.create({
"name": "Welcome series",
"domain": "yourdomain.com",
"steps": [
{
"key": "start",
"type": "trigger",
"config": { "event_name": "user.created" }
},
{
"key": "wait_1_day",
"type": "delay",
"config": { "duration": "1 day" }
}
],
"connections": [
{ "from": "start", "to": "wait_1_day", "type": "default" }
]
});
console.log({ data, error });Example durations: "30 minutes", "1 hour", "12 hours", "1 day", "3 days", "1 week".
The maximum delay is 30 days.
Configuration
config.durationstringrequiredThe delay duration in natural language (e.g. "1 hour", "3 days"). Maximum: 30 days.
{
"key": "wait_1_hour",
"type": "delay",
"config": {
"duration": "1 hour"
}
}