Personal Email After-Hours Auto-Reply
When an email arrives in Outlook.com outside business hours, send an auto-reply indicating when you'll respond next.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
FlowLibs - Personal Email After-Hours Auto-Reply is a polling-based Outlook.com automation that watches your personal Inbox and, whenever a message arrives outside configured business hours (or on a weekend), sends the sender a friendly auto-reply letting them know when you'll respond next. Business hours, time zone, reply body, and subject prefix are all driven by Dataverse environment variables, so the same flow re-targets per environment without any flow edits.
The flow ships in Stopped (Off) state with 0 Flow Checker errors / 0 warnings. Activation requires only authorizing the Outlook.com connection reference and (optionally) tuning the env vars.
Use Case
You want personal-mailbox auto-reply behavior that respects your actual schedule — not Outlook's binary "I'm Out of Office" toggle.
The flow is ideal for teams that:
- After 5 PM on weekdays, anyone who emails you gets an immediate "I'll get back to you next business morning" reply.
- All day Saturday and Sunday, senders are told you'll respond Monday.
- Holidays — bump flowlibs_BusinessHoursEnd to 0 for the day to make every hour "after hours."
- Different time zone? Change flowlibs_TimeZone to your Windows TZ ID (e.g. Pacific Standard Time, GMT Standard Time) and the comparisons follow.
Flow Architecture
When a new email arrives
shared_outlook/OnNewEmailPolling trigger with frequency Minute, interval 5. Watches Inbox, importance Any, no attachment filter. Polling triggers require an explicit recurrence block.
Init varBusinessHoursStart
Initialize variableInteger var = `@int(parameters('flowlibs_BusinessHoursStart'))`. Converts string env var to int for numeric comparison.
Init varBusinessHoursEnd
Initialize variableInteger var = `@int(parameters('flowlibs_BusinessHoursEnd'))`.
Init varTimeZone
Initialize variableString var = `@parameters('flowlibs_TimeZone')`.
Init varAutoReplyMessage
Initialize variableString var = `@parameters('flowlibs_AutoReplyMessage')` (HTML body).
Init varAutoReplySubjectPrefix
Initialize variableString var = `@parameters('flowlibs_AutoReplySubjectPrefix')`.
Calculate Local Hour
Compose`@int(formatDateTime(convertTimeZone(triggerOutputs()?['body/DateTimeReceived'], 'UTC', variables('varTimeZone')), 'HH'))`. Returns 0–23 in the configured local TZ.
Calculate Day Of Week
Compose`@dayOfWeek(convertTimeZone(triggerOutputs()?['body/DateTimeReceived'], 'UTC', variables('varTimeZone')))`. Returns 0–6 (0=Sunday, 6=Saturday).
Check If Outside Business Hours
If condition`or` over four operands: hour < start OR hour >= end OR dow == 0 (Sunday) OR dow == 6 (Saturday).
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_BusinessHoursStart | String | 9 | Hour of day (24h) when business hours begin. Compared with the email's received hour in the configured time zone. |
| flowlibs_BusinessHoursEnd | String | 17 | Hour of day (24h) when business hours end. Emails received at or after this hour trigger the auto-reply. |
| flowlibs_TimeZone | String | Eastern Standard Time | Windows time zone identifier used to compute the local hour and day-of-week from the trigger's UTC timestamp. |
| flowlibs_AutoReplyMessage | String | <p>Thanks for your message. Our business hours are 9:00 AM to 5:00 PM Eastern, Monday through Friday. We will respond on the next business day.</p><p>For urgent matters, please call our main line.</p> | HTML body sent in the auto-reply. Wrap text in <p> tags; inline <strong>, <em>, <a href="..."> are supported. |
| flowlibs_AutoReplySubjectPrefix | String | [Auto-Reply] | Prefix prepended to the original email subject in the auto-reply. Set to empty string to skip. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Outlook.com | shared_outlook | OnNewEmail (trigger) SendEmailV2 |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Change business hours
- Update flowlibs_BusinessHoursStart / flowlibs_BusinessHoursEnd to the start/end hour in 24-hour format. Examples: 8 and 18 for 8 AM–6 PM; 7 and 15 for 7 AM–3 PM.
- Change time zone
- Update flowlibs_TimeZone to any Windows time zone identifier. Common values: Eastern Standard Time, Central Standard Time, Mountain Standard Time, Pacific Standard Time, GMT Standard Time, Central European Standard Time, India Standard Time, China Standard Time, Tokyo Standard Time, AUS Eastern Standard Time. The full list is the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones (or tzutil /l in PowerShell).
- Change reply body
- Update flowlibs_AutoReplyMessage to any HTML string. Wrap text in <p> tags; inline <strong>, <em>, <a href="..."> are all supported by the Outlook.com SendEmailV2 action.
- Change subject prefix
- Update flowlibs_AutoReplySubjectPrefix. The flow concatenates the prefix with the original subject, e.g.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Local hour (0–23) in configured TZ
Used in the Calculate Local Hour Compose action to derive a numeric hour for the If comparison.
EXPR.02Day of week (0=Sun, 6=Sat) in configured TZ
Used in the Calculate Day Of Week Compose action; powers the weekend operands in the If.
EXPR.03Outside-business-hours boolean (used inside the If)
The If condition: true when the email lands before business hours, after business hours, or on a weekend.
EXPR.04Auto-reply subject (concatenates prefix + original)
Builds the outgoing Subject by prepending the configured prefix to the original subject.
EXPR.05Reply recipient (echo back to sender)
Sends the auto-reply back to whoever emailed in.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.