A Business-Calendar Service for Indian Automation Flows: Working Hours, Holidays and Regional Festivals
说明与用途
印度自动化流程的日历服务处理可变工作时间、地区节假日和临时关闭,替代硬编码时间检查,确保提醒和升级的及时性。
问题
Automations that send reminders, escalations or promise replies depend on knowing when the business is actually open, but in India working days, weekly offs, and festivals vary by business, city, state and community, making hard‑coded hours unreliable.
结果
Automations become polite and reliable by querying a calendar service that accounts for variable working hours, regional festivals, and ad‑hoc closures, preventing promises such as "reply by tomorrow" from being made at inappropriate times.
工作流
- Define business schedule in a YAML file with timezone, weekly hours, holiday source, and ad‑hoc closures.
- Implement a service exposing
is_open(business_id, datetime),next_open(business_id, datetime), andadd_business_minutes(business_id, datetime, minutes). - Replace hard‑coded hour checks in all automation flows with calls to the calendar service.
- Add a WhatsApp command (e.g., "CLOSED TODAY") that records an ad‑hoc closure and shifts pending reminders to the next open slot.
- Ship a starting list of regional festivals per state and require owner confirmation to keep the list accurate.
- Write tests for edge cases such as the day before a long weekend, a closure announced at 9 am, and a reminder scheduled across a festival.
- Audit existing flows (e.g., 72‑hour workflow audit) to identify those that depend on timing and refactor them to use the calendar service.
证据
Automations that send reminders, escalates unanswered leads or promise "we will reply by tomorrow" all depend on one thing: knowing when the business is actually open.
The usual first version is if 10 <= hour < 19 and weekday < 6. It breaks immediately: ...
Keep one small service that answers three questions: is_open(business_id, datetime), next_open(business_id, datetime), add_business_minutes(business_id, datetime, minutes)
The most useful feature is a single command the owner can send, such as "CLOSED TODAY". The service records an ad‑hoc closure, and every pending reminder shifts to the next open slot.
If a flow promises "reply within 2 business hours", compute the deadline with add_business_minutes. Escalations then fire at a sensible time, not at midnight.
- 记录日期: 2026-10-27T04:26:29.501Z