--- title: "Compliance Rules" slug: "compliance-rules-1" updated: 2025-06-03T09:17:51Z published: 2025-09-03T06:22:32Z canonical: "docs.powerworker.com/compliance-rules-1" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.powerworker.com/llms.txt > Use this file to discover all available pages before exploring further. # Compliance Rules Setting up the Compliance Rules ensures that criteria such as maximum working hours, minimum breaks between shifts, and maximum weekend hours are automatically considered without the Workforce Planner needing to worry about every requirement. These rules alert Workforce Planners to potential compliance issues, ensuring that all rosters align with organisational policies. Built-in checks provide peace of mind by preventing breaches and ensuring compliance is maintained, so planners can confidently create rosters without worrying about breaching regulations. Example for Compliance Rules: - Maximum of shift type. - Maximum Working Hours. - Minimum Break between shifts. #### Navigate Rules Compliance rules are generally created by developers. Customers who use compliance rules are encouraged to work with Microsoft Partner/ Velrada to set up their initial rules, which can then be further refined using Compliance constraints. To navigate the Rules: 1. Navigate to PowerRoster App > **Settings** > Go to the Compliance section and select **Rules**. 2. Fill in the required fields and **Save**. | **Field** | **Description** | | --- | --- | | Name | Name of the Rule | | Lambda Expression | Formula expression used to interact with the C# model and define the rule | | Metadata | Metadata script JSON formula is used to break down bigger statements into smaller logical expressions as parameters within a rule definition. | | Parameters | Parameters used within the Rule | #### **PowerRoster Compliance Rule Example** In this example, we will create a Compliance Rule when the Shift has a particular Type. | **Field** | **Description** | | --- | --- | | Name | Shift is particular type | | Lambda Expression | ExpressionExtensions.CheckContains(input1.ShiftType, "\|Shift Type\|") | | Metadata | { "SuccessEvent":"Has shifts", "ErrorMessage":"shift is not of type \|Shift Type\|" } | ![A screenshot of a computer Description automatically generated](https://cdn.document360.io/7abff6c0-4eeb-4bb0-a6a4-8718bf640435/Images/Documentation/navigate-rules-image-sunldjka.png) Go to the second tab and navigate the parameters associated with the Compliance Rule as shown below: ![A screenshot of a computer Description automatically generated](https://cdn.document360.io/7abff6c0-4eeb-4bb0-a6a4-8718bf640435/Images/Documentation/navigate-rules-image-k44x5ymt.png) > [!NOTE] > Note > > The Night Compliances runs are created by Power Automate and run every night.