Delay Action Step

Learn how to use the delay step to pause workflow execution for a specified duration

The delay step allows you to pause the execution of your workflow for a specified duration. This is useful for implementing features like follow-up notifications, reminder sequences, or cooldown periods.

Example Usage

// Wait for 24 hours
await step.delay('reminder-delay', async () => {
  return {
    amount: 24,
    unit: 'hours',
  };
});
 
// Send a follow-up email
await step.email('follow-up', async () => {
  return {
    subject: 'How are you liking our product?',
    body: 'We noticed you signed up yesterday. How has your experience been so far?',
  };
});

Delay Step Output

PropertyTypeRequiredDescription
amountnumberYesThe number of time units to delay
unit'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months'YesThe time unit for the delay duration

Delay Step Result

PropertyTypeDescription
durationnumberThe total delay duration in milliseconds

The delay step can be skipped conditionally using the skip option, allowing you to implement dynamic delay logic based on your workflow's needs.

Conditional Delay Example

await step.delay(
  'premium-user-delay',
  async () => {
    return {
      amount: 24,
      unit: 'hours',
    };
  },
  {
    // Skip the delay for premium users
    skip: async () => user.isPremium,
  }
);

On this page