Recovery

Subscription cancellation exit survey

An hour after a cancellation, one question: why? “Too expensive” gets a discount to stay, “missing feature” reaches the product team in Slack, and everyone who answers is thanked.

EmailSlacktrigger.eventdelaywaitUntilbranchrunperformedreentry: after_exitSlack
import { eq, performed, trigger, workflow } from 'sendwend';
import { issueCoupon } from './actions';
import { e, u } from './contract';
import { email, slack } from './templates';

/**
 * This survey's answer, read from the event log: the window leaves out
 * an earlier cancellation's.
 */
const answered = (reason: 'too_expensive' | 'missing_features') =>
  performed(e.exit_survey_answered, (p) => eq(p.reason, reason), {
    within: '6 days',
  });

/**
 * Cancellation exit survey: an hour after a cancellation, one question
 * (why?); whoever answers gets a response that fits the answer. Too
 * expensive: a discount to stay. A missing feature: the product team
 * hears about it in Slack. Everyone who answered is thanked.
 *
 * The answer arrives after the journey started, so it is not in the
 * trigger's payload: the branch tests the event log with
 * `performed(e.exit_survey_answered, where)`. No answer in five days
 * ends the journey (`onTimeout: 'exit'`): a second ask after a
 * cancellation is one too many.
 */
export const cancellationExitSurvey = workflow({
  id: 'cancellation_exit_survey',
  name: 'Cancellation exit survey',
  trigger: trigger.event(e.subscription_canceled),
  reentry: { mode: 'after_exit' },
})
  .delay('1 hour')
  .email(email.exitSurvey, { name: u.name })
  .waitUntil(performed(e.exit_survey_answered), {
    timeout: '5 days',
    onTimeout: 'exit',
  })
  .branch(
    'by answer',
    [
      answered('too_expensive'),
      (w) =>
        w
          .run(issueCoupon, { code: 'STAY30', email: u.email })
          .email(email.offer, {
            coupon: 'STAY30',
            expiresIn: '7 days',
          }),
    ],
    [
      answered('missing_features'),
      (w) => w.slack(slack.featureGap, { email: u.email }),
    ]
  )
  .email(email.exitThanks, { name: u.name });
Compiled canvasDrag to pan

When to use it

When customers cancel and you do not know why. The reason is the most useful thing a leaving customer can give you, and for some answers there is still something to offer. Ask once, close to the moment, and act on the answer.

How it works

  1. 1A subscription_canceled event starts it.
  2. 2An hour later, the survey email asks one question.
  3. 3waitUntil waits up to five days for an exit_survey_answered event. With no answer, the journey exits.
  4. 4A branch on the answer: “too expensive” runs a custom action that creates a coupon, then offers it; “missing features” posts to the product team’s Slack.
  5. 5Everyone who answered gets a thank-you email.

Why it's built this way

The answer is a later event

The answer arrives after the journey started, so it cannot come from the trigger’s payload. The branch tests the event log with performed(e.exit_survey_answered, where), limited to the last six days so a past cancellation’s answer does not count.

No reminder

onTimeout: 'exit': a second request after someone canceled is one too many. Silence is an answer too.

Not every answer gets an offer

A discount answers “too expensive”, not “missing features”. Offering one to everyone teaches customers that canceling is how to get a discount.

Make it yours

  • Add an arm per reason your survey offers; answers without one simply get the thank-you.
  • Make the offer a downgrade to a cheaper plan instead of a coupon.
  • Feed every answer to your own tooling with a custom action.

What to measure

Survey response rate, and the share of “too expensive” answers that resubscribe within 7 days.

Also see Failed payment dunning email sequence.