Check Business Hours Flow Notation for Business Hours V2

Check Business Hours: Sends a request to check for business hour rules. For example, this can be used to find out if a call is made during or outside of business hours. An exclusive gateway can then be used as a decision point to handle it appropriately.

 These instructions are for configuring the Check Business Hours notation for Business Hours V2. This information is now available in the Flow Designer Reference here.

Params

  • Search By: Select how you want to identify the business hours being checked. By default, Id is selected.

    • Id: Enables you to select from the list of available business hours on the tenant and shared with the tenant. You can also specify which version of the business hours you want checked.

      • Inherited business hours display the tenant name in brackets in this format:  Business Hours Name [Tenant Name].

      • Inactive Business Hours show (Disabled) with the business hours name.

    • Name: Enables you to enter the name of the business hours being checked. You cannot specify which version of the business hours being checked. Only the Active Version is checked.

       
      • As a best practice, use the Name option when you are sharing the flow with child tenants that have business hours by the same name.

      • If your tenant has access to multiple business hours by the same name, the business hours for the tenant closest to your current tenant is checked. For example, if your current tenant has business hours called "Operating Hours" and you also inherit business hours called "Operating Hours" from a parent tenant, the business hours for your current tenant are checked. The business hours inherited from the parent tenant are not checked in this scenario.

  • Business Hours (Id only): Select the business hours name from the drop-down menu.

  • Name (Name only): Enter the name of the business hours in quotation marks. The name is not case sensitive, but it must be an exact match.

    For example, if the business hours are named US Holidays, the following will match: “us holidays”, “US holidays”, “Us Holidays”, etc. These terms will not match: “holidays”, “USHolidays”, “us”.

    Alternatively, you can enter the name as a variable.

  • Version: (Id only) Select which version of the business hours you want checked. By default, the Active Version is selected.

  • When: Select when to check the business hours are being checked:

    • Now (Default): Checks if the business is open right now.

    • Future Time from Now: Checks if the business is open in the specified length of time from now.

      • Time from Now: In the first drop-down menu, select the unit of time -either Minutes or Hours. In the second field, enter the number of hours or minutes.

    • Timestamp: A timestamp expression, in ISO 8601 format, that you want to check the business hours. In this example, the expression checks hours at 8 PM today and is adjusted for the UTC-7:00 offset:

      (timestamp (str (format-date :year-month-day (minus (now) (hours 7))) "T20:00:00.00-07:00"))

      If the flow needs a hard-coded value, enter the timestamp between quotation marks (“ ”). For example, to check the business hours at 2 PM on January 25, 2020, enter (“2020-01-25T14:00:00:000”). Optionally, add a timezone offset. For example, (“2020-01-25T14:00:00:000-07:00”). If an offset isn’t entered, the business hours are checked in UTC time.

  • Scope: Select what you want to check with this notation:

    • Regular Hours & Blackout Exceptions (Default): Checks all rules in the Business Hours. First, the Blackout One Time Exceptions and Blackout Exceptions types of rules are checked. If a match is found, the Result binding is false (closed). Next, the "One-Time extended Hours" and "Regular Hours" types of rules are checked. If a match is found, the Result binding is true (open). Otherwise, the Result binding is false (closed).

    • Regular Hours only: Ignores the Blackout Exceptions and Blackout One Time Exceptions type of rules. Only the One-Time extended Hours and Regular Hours types of rules are checked. If a match is found, the Result binding is true (open). Otherwise, the Result binding is false (closed).

    • Blackout Exceptions only: Ignores One-Time Extended Hours and Regular Hours types of rules. Only Black Out One-Time Exceptions and Blackout Exceptions types of rules are checked. If a match is found, the Result binding is false (closed). Otherwise, the Result binding is true (open).

       

      If there are overlapping business hours rules of different types, they are checked according to the following priority:

      1. Blackout One-Time Exceptions

      2. Blackout Exceptions

      3. One-Time Extended Hours

      4. Regular Hours

  • Return False if Business Hours Disabled: When false (default), the enablement status of the Business Hours doesn’t matter. The Business Hours are checked according to the hours and exceptions configured in it. If it is true (green toggle), if the Business Hours is disabled, the Result binding is false (closed).

Bindings

  • Result: This field contains a binding variable so that the business hour rule results can be attached to another flow object. For example, you may enter "hours" and use that same variable in a later gateway condition statement so that the interaction follows the appropriate path based on the business hour rule results.

    When the result is true, the business is open.

    When the result is false, the business is closed.

    When the result is nil, there is an error. For example, if the Business Hours Name is not found or the When timestamp is not valid.

  • Result Object: This field contains an output binding variable that contains details about the lookup (for example, whether Business Hours is disabled, or if it is outside of regular hours, or a blackout exception). For example, you can use this to retrieve the description for the business hours rule or whether the business is open. Later in the flow, you can reference this result object to play it to the customer.

    Enter the result object as {{resultObj}}.{{propertyName}} . For example, if you named your Result binding openObj , and you wanted to retrieve the description, you would enter openObj.description .

    The properties that are available are from the Check Business Hours API request when the request is successful:

    • name: The name of the matching business hours rule. If there isn’t a match, this property isn’t present.

    • description: The description of the matching business hour rule. If there isn’t a match, this property isn’t present.

    • type: The type of thematching business hours rule (recurring-hours, blackout-recurring-exceptions, blackout-one-time-exceptions, or one time-extended-exceptions). If there isn’t a match, this property isn’t present.

    • date: The date, time, and timezone that the hours were checked.

    • open: Whether the business was open (true or false).

    • version: The unique identifier (UUID) of the version of business hours checked.

    • active: Whether the business hours are enabled (true or false).

    If the request fails, the error object is returned with the code and message properties which contain information about the error.

      If there aren’t any rules that match for the time checked, there won’t be any results for certain properties. For example, if you only have business hours for Monday to Friday and you check on the weekend, a name, description, and type aren't returned because there aren’t any business hours rules for those days.

    Examples: