Automation Rules
Configure automatic actions based on events in Kuviq.
Overview
Automation rules allow you to:
- Trigger actions automatically
- Reduce manual work
- Ensure consistent processes
- React to events immediately
How Rules Work
Rule Components
Every rule has:
- Trigger - What starts the rule
- Conditions - When to apply (optional)
- Actions - What to do
Example Rule
WHEN inspection is completed
IF result is "Failed"
THEN create corrective action AND notify manager
Creating Rules
Accessing Automation
- Go to Admin > Automation
- Click Create Rule or New Rule
- Configure rule components
- Save and activate
Rule Builder
The visual rule builder:
- Select trigger type
- Add conditions (optional)
- Define actions
- Name and save
Trigger Types
Inspection Triggers
| Trigger | Fires When |
|---|---|
| Inspection Completed | Any inspection finishes |
| Inspection Failed | Inspection result is fail |
| Inspection Passed | Inspection result is pass |
| Inspection Started | Someone begins inspection |
| Inspection Overdue | Due date passes |
Item Triggers
| Trigger | Fires When |
|---|---|
| Item Created | New item added |
| Item Updated | Item details changed |
| Item Status Changed | Status transitions |
| Item Moved | Location changed |
| Item Deleted | Item removed |
Corrective Action Triggers
| Trigger | Fires When |
|---|---|
| Action Created | New corrective action |
| Action Overdue | Past due date |
| Action Completed | Marked complete |
| Action Escalated | Escalation occurs |
User Triggers
| Trigger | Fires When |
|---|---|
| User Joined | New user activated |
| User Deactivated | User access removed |
| User Role Changed | Role updated |
Schedule Triggers
| Trigger | Fires When |
|---|---|
| Daily | Every day at configured time |
| Weekly | Specific day and time each week |
| Monthly | Specific day and time each month |
Schedule Configuration
When using schedule triggers, configure:
| Setting | Options |
|---|---|
| Frequency | Daily, Weekly, Monthly |
| Time | Hour and minute (24-hour format) |
| Day of Week | For weekly schedules (Monday-Sunday) |
| Day of Month | For monthly schedules (1-31) |
Schedule Preview
When configuring a schedule trigger, the rule builder shows:
- Next 5 executions: Preview when the rule will run
- Timezone display: Times shown in your local timezone
- Validation: Ensures schedule configuration is valid
This helps verify the schedule is set correctly before activating the rule.
Conditions
Adding Conditions
Conditions filter when rules apply:
- Click Add Condition
- Select field to check
- Choose operator
- Enter value
Condition Operators
| Operator | Description |
|---|---|
| Equals | Exact match |
| Not equals | Doesn't match |
| Contains | Includes text |
| Greater than | Numeric comparison |
| Less than | Numeric comparison |
| Is empty | No value |
| Is not empty | Has value |
Common Conditions
| Condition | Example Use |
|---|---|
| Priority equals | Only critical items |
| Location equals | Specific site |
| Item type equals | Certain equipment |
| User role equals | Specific roles |
Multiple Conditions
Combine conditions:
- AND - All must be true
- OR - Any can be true
Example:
IF Priority is Critical AND Location is Building A
Action Types
Notification Actions
| Action | Description |
|---|---|
| Send email | Email to specified users |
| Send in-app notification | Notify within Kuviq |
| Send SMS | Text message (if configured) |
Assignment Actions
| Action | Description |
|---|---|
| Assign to user | Set specific assignee |
| Assign to role | Assign to role members |
| Assign by location | Location-based assignment |
Data Actions
| Action | Description |
|---|---|
| Update field | Change a value |
| Create record | Create new item/action |
| Tag item | Add tags |
Integration Actions
| Action | Description |
|---|---|
| Webhook | Send data to external URL |
| Create calendar event | Add to calendar |
| Log to audit | Record in audit log |
Common Rule Examples
Failed Inspection Alert
Purpose: Notify manager when inspection fails
WHEN: Inspection Completed
IF: Result = Failed
THEN: Send email to [Location Manager]
Overdue Inspection Reminder
Purpose: Alert when inspection becomes overdue
WHEN: Inspection Overdue
THEN: Send notification to [Assignee]
Send notification to [Manager]
Critical Item Assignment
Purpose: Auto-assign critical corrective actions
WHEN: Corrective Action Created
IF: Priority = Critical
THEN: Assign to [Safety Manager]
Send email to [Leadership]
New Item Welcome
Purpose: Set up new items
WHEN: Item Created
IF: Item Type = Fire Extinguisher
THEN: Create inspection schedule
Send notification to [Location Inspector]
Weekly Summary
Purpose: Send weekly status report
WHEN: Weekly (Monday 8 AM)
THEN: Generate compliance report
Send email to [Management Team]
Managing Rules
Viewing Rules
- Go to Admin > Automation
- See all rules listed
- View status (active/inactive)
Rule List Details
| Column | Description |
|---|---|
| Name | Rule name |
| Trigger | What starts it |
| Status | Active or inactive |
| Last Run | When last executed |
| Run Count | Times executed |
Editing Rules
- Find rule in list
- Click Edit
- Modify components
- Save
Activating/Deactivating
Toggle rules on/off:
- Find rule
- Click toggle switch
- Or use Activate/Deactivate button
Deleting Rules
- Find rule
- Click Delete
- Confirm deletion
Testing Rules
Test Mode
Before activating:
- Create rule
- Click Test
- Select sample data
- Review what would happen
- Adjust if needed
Test Results
Test shows:
- Would rule trigger?
- Which conditions matched
- What actions would run
- Preview of results
Rule History
Execution Log
View past executions:
- Go to Admin > Automation
- Select a rule
- Click History or View Executions
- See execution history
Log Details
Each execution record shows:
| Field | Description |
|---|---|
| Executed At | When the rule ran |
| Trigger | What triggered execution |
| Status | Success, partial, or failed |
| Duration | How long execution took |
| Actions | List of actions performed |
| Results | Outcome of each action |
Action Results
For each action in an execution:
- Success: Action completed successfully
- Failed: Action failed with error message
- Skipped: Action was skipped due to conditions
Manual Execution
You can manually trigger a scheduled rule:
- Open the rule
- Click Execute Now
- Rule runs immediately with current data
- View results in execution history
This is useful for testing or running a scheduled rule outside its normal schedule.
Best Practices
Rule Design
- Start simple - Basic rules first
- Be specific - Use conditions to target
- Test thoroughly - Before activating
- Monitor - Check execution logs
- Document - Clear names and descriptions
Performance
- Avoid overly broad triggers
- Use conditions to filter
- Don't create duplicate rules
- Disable unused rules
Maintenance
- Review rules periodically
- Clean up obsolete rules
- Update for process changes
- Monitor for errors
Troubleshooting
Rule Not Triggering
Check:
- Rule is active
- Trigger event occurred
- Conditions are met
- No errors in log
Wrong Actions Executed
Check:
- Conditions are correct
- Action configuration
- Target recipients
Rule Errors
Common issues:
- Invalid email addresses
- Permission issues
- External service unavailable
- Invalid field values
Permissions
Who Can Manage Rules
Typically:
- Super Admins
- Admins (organization rules)
- May require specific permission
Rule Scope
Rules can be:
- Organization-wide
- Location-specific
- User-specific
Next Steps
- Email Notifications - Configure notifications
- Webhooks - External integrations
- Corrective Actions - Action workflows