Onboarding

Activation nudge email and push

Waits for a new user’s first document, nudges once by push or email if a day passes without it, gives up after four days, and sends the next step to those who did it.

EmailPushtrigger.eventdelaytimeWindowwaitUntilprefersegmentsreentry: never
import { trigger, workflow } from 'sendwend';
import { e, u } from './contract';
import { activated } from './segments';
import { email, push } from './templates';

/**
 * Activation nudge: wait for the one action that makes a new user stick
 * (here, a first document), nudge once if a day passes without it, and
 * give up quietly after four. Whoever does it gets the next step
 * instead.
 *
 * Both of `waitUntil`'s timeout behaviors, one after the other: the
 * first runs a sub-flow and rejoins the main line, the second exits.
 * Activation is what the workflow waits for, not its goal: a goal would
 * end the journey at the very moment the next-step email is due.
 */
export const activationNudge = workflow({
  id: 'activation_nudge',
  name: 'Activation nudge',
  trigger: trigger.event(e.sign_up),
  reentry: { mode: 'never' },
})
  // A day to find it alone. If not, one nudge, in daytime, by push if
  // they have the app.
  .waitUntil(activated, {
    timeout: '1 day',
    onTimeout: (w) =>
      w
        .timeWindow({ between: ['09:00', '21:00'] })
        .prefer([push.firstDoc, email.firstDoc], { name: u.name }),
  })
  // Three more days. Still nothing: stop here rather than nag.
  .waitUntil(activated, { timeout: '3 days', onTimeout: 'exit' })
  // Only the activated reach this line, whether they needed the nudge
  // or not.
  .delay('1 hour')
  .email(email.nextSteps, { name: u.name });
Compiled canvasDrag to pan

When to use it

When one action separates users who stay from users who drift: a first document, a first project, a first connected account. Rather than a fixed schedule of messages, this workflow reacts to that action, so the people who need a push get one and the people who do not, do not.

How it works

  1. 1A sign_up event starts it, once per account.
  2. 2waitUntil(activated) waits up to one day. If the user activates, the journey moves on at once.
  3. 3If a day passes, the timeout sub-flow runs: it holds until daytime and sends one nudge, by push or email. Then it rejoins the main line.
  4. 4A second waitUntil gives three more days. If they pass, onTimeout: exit ends the journey.
  5. 5Users who activated, with or without the nudge, get the next-steps email an hour later.

Why it's built this way

Waiting, not a goal

A goal ends the journey when it is reached. Here, activating is what should trigger the next message, so it is the condition of a waitUntil rather than the workflow’s goal.

Two timeouts, two behaviors

The first timeout runs a sub-flow and rejoins, so a nudged user still gets the next step if they then activate. The second exits: four days without a first document is the point where more messages do more harm than good.

One nudge

A single nudge, held to daytime and sent on one channel, reads as help. Several read as pressure.

Make it yours

  • Replace activated with your own key action, as a segment or an inline performed(e.x).
  • Tune the windows to how long the action usually takes: hours for a sign-up flow, days for an integration.
  • Make the second timeout a sub-flow too, ending with a feedback email instead of silence.
  • Add a goal for the step after activation (a second document, an invite) to measure the whole path.

What to measure

The share of sign-ups that activate within four days, split by whether they received the nudge.

Also see Team invite reminder email.