Enbbox Docs

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

OptionTypeDescription
amountnumberDuration value
unitstringseconds, 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

On this page