These recipes provide approval workflows for common customer service scenarios, designed to balance quick response times with appropriate oversight.
Complaint Escalation
Account Modifications
Service Credits
Bulk Updates
Complaint Escalation
Manage complaint escalations with intelligent routing based on severity and customer tier.const escalateComplaint = needsHumanApproval({
type: 'async',
title: 'Complaint Escalation',
ask: (args) => `Review escalation request for ticket #${args.ticketId}`,
autoApprove: async (args) => args.customerTier === 'VIP'
})
- Customer dissatisfaction escalations
- VIP customer issues
- Complex technical problems
- Multi-department issues
- Include full ticket history
- Set clear severity criteria
- Define compensation limits
- Document resolution attempts
Account Modifications
Handle sensitive account changes with appropriate verification.const modifyAccount = needsHumanApproval({
type: 'sync',
title: 'Account Modification',
ask: (args) => `Approve changes to account ${args.accountId}?`
})
- Billing changes
- Permission updates
- Profile modifications
- Security settings
Service Credits
Manage service credit approvals and compensation.const issueServiceCredit = needsHumanApproval({
type: 'sync',
title: 'Service Credit',
ask: (args) => `Approve service credit of $${args.amount} for account ${args.accountId}?`,
approvalArguments: {
amount: {
type: 'number',
value: args.amount,
label: 'Credit Amount',
editable: true
},
reason: {
type: 'string',
value: args.reason,
label: 'Credit Reason',
editable: true
}
},
// Auto-approve SLA violations within limit
autoApprove: async (args) => {
return args.isSlaViolation && args.amount <= 250;
}
})
- Set clear approval thresholds
- Document SLA violations
- Track compensation history
Bulk Customer Updates
Handle mass customer account updates safely.const bulkCustomerUpdate = needsHumanApproval({
type: 'sync',
title: 'Bulk Customer Update',
ask: (args) => {
const count = args.affectedAccounts.length;
return `Review bulk update affecting ${count} customer accounts`;
},
approvalArguments: {
updateType: {
type: 'string',
value: args.updateType,
label: 'Update Type',
editable: false
},
affectedAccounts: {
type: 'longString',
value: args.affectedAccounts.join('\n'),
label: 'Affected Accounts',
editable: true
}
}
})
Next Steps