public void execute(String customerId) { activities.sendWelcomeEmail(customerId); try { boolean trialPeriod = true; while (true) { Workflow.sleep(Duration.ofDays(30)); activities.chargeMonthlyFee(customerId); if (trialPeriod) { activities.sendEndOfTrialEmail(customerId); trialPeriod = false; } else { activities.sendMonthlyChargeEmail(customerId); } } } catch (CancellationException e) { activities.processSubscriptionCancellation(customerId); activities.sendSorryToSeeYouGoEmail(customerId); } }