Delay
Add delay steps to Enbbox notification workflows. Schedule notifications with time-based delays, digest windows, and conditional timing in TypeScript.
Delay Step
The Delay step pauses workflow execution for a specified duration.
const reminderWorkflow = workflow(
"task-reminder",
async ({ step, payload }) => {
await step.inApp("immediate-notification", async () => ({
subject: "New task assigned",
body: `You've been assigned: ${payload.taskName}`,
}));
await step.delay("wait-for-action", async () => ({
amount: 24,
unit: "hours",
}));
await step.email("reminder-email", async () => ({
subject: `Reminder: ${payload.taskName} is still pending`,
body: `Hi ${payload.name}, this task needs your attention.`,
}));
},
);Options
| Option | Type | Description |
|---|---|---|
amount | number | Duration value |
unit | string | seconds, minutes, hours, days, weeks |
Use Cases
- Email follow-ups — Send a reminder if in-app notification wasn't read
- Escalation — Notify a manager if a task isn't completed within X hours
- Scheduled delivery — Send a follow-up email 3 days after sign-up
- Cool-down periods — Prevent notification spam by spacing messages
Digest
Aggregate and batch notifications with Enbbox digest steps. Reduce notification fatigue by combining multiple events into a single summary notification.
Custom Step
Create custom notification steps in Enbbox workflows. Extend the framework with custom logic, external API calls, and data transformations.