Decide when an onboarding agent nudges a stalled account
Your task
New customers stall during onboarding because nobody notices they are stuck on step 3 of 8. An agent tracks each account's checklist and decides who to nudge, without ever spamming a customer.
Write decide_onboarding_nudge(days_since_progress, ignored_nudges, days_since_last_nudge, agent_silenced): the rule your agent follows for each account, each day.
days_since_progress(int): days since the account last completed a step.ignored_nudges(int): nudges sent so far that got no response.days_since_last_nudge(int): days since the last nudge, or -1 if there has never been one.agent_silenced(bool): the account's owner has muted the agent for this account.
It returns one of the values in the rules below. Apply them in order. The first one that matches decides:
agent_silenced:"silenced".ignored_nudgesof 2 or more:"escalate_human".days_since_progressbelow 3:"wait", because the account is not stalled.days_since_last_nudgefrom 0 to 6:"wait". At most one nudge a week, and -1 means there is no cooldown.ignored_nudgesof 0:"nudge_internal", a message to your own account owner.- Otherwise:
"queue_customer_email", a template email waiting for a person's approval.
Examples
decide_onboarding_nudge(days_since_progress: int, ignored_nudges: int, days_since_last_nudge: int, agent_silenced: bool) -> strExample 1
Input
decide_onboarding_nudge(5, 0, -1, False)Output
"nudge_internal"Example 2
Input
decide_onboarding_nudge(5, 1, 9, False)Output
"queue_customer_email"Example 3
Input
decide_onboarding_nudge(1, 0, -1, False)Output
"wait"