Create Violation
The Create Violation action is the final step in most alert workflows. It officially records an incident in the system, stores evidence, and triggers notifications based on your organization's configured delivery methods.
Overview
When something requiring attention is detected—loitering, unauthorized access, safety violations—you need to:
- Create a permanent record of the incident
- Attach evidence (images, videos)
- Notify the appropriate people
This action handles all three responsibilities, serving as the "output" of detection workflows.
What It Does
1. Gathers Evidence
The action automatically collects all attachments generated by previous actions in the workflow:
- Images: Detection snapshots, annotated violation images, cropped views
- Videos: Short clips captured during detection
- Metadata: Timestamps, locations, object types, dwell times
2. Uploads Evidence
Before creating the database record, the action:
- Uploads local image files to cloud storage (Supabase/S3)
- Uploads video clips to cloud storage
- Generates accessible URLs for each attachment
This ensures evidence is accessible from the cloud-based RIME dashboard.
3. Creates Database Record
A violation record is created containing:
| Field | Description |
|---|---|
| Branch | Which location the violation occurred |
| Stream | Which camera captured the evidence |
| Timestamp | When the violation was detected |
| Type | Category of violation (loitering, intrusion, etc.) |
| Attachments | URLs to uploaded evidence |
| Rule | Which workflow rule triggered this |
| Status | Initial status (typically "New") |
4. Triggers Notifications
This is where the Smart Delivery system comes into play. The action itself doesn't send emails or webhooks directly. Instead, it signals that a violation was created, and the system checks Brand Rules to determine notification methods.
Key Feature: Smart Delivery
How It Works
You do not configure notification methods inside this action. Instead:
- This action creates the violation record
- The system checks the Brand Settings for this client
- Based on Brand configuration, notifications are triggered:
- Email to specified recipients
- Webhook to external systems
- SMS to phone numbers
- Zoho ticket creation
- Control room display update
Why This Matters
- Change Delivery Without Changing Workflows: Switch from email to Slack without modifying any rules
- Client-Specific Delivery: Different clients can have different notification methods
- Multi-Channel: Enable multiple delivery methods simultaneously
- Centralized Management: All notification settings in one place (Brand configuration)
Example
Your workflow is:
Detect Person → Create Violation
Client A has configured:
- Email notifications enabled → Emails go out
- Webhook disabled → No webhook called
Client B has configured:
- Email disabled → No emails
- Webhook to Slack → Slack notifications triggered
- Zoho integration enabled → Zoho tickets created
Same workflow, completely different delivery—all controlled by configuration.
Configuration
The action typically requires minimal direct configuration as it inherits context from the workflow:
| Parameter | Source | Description |
|---|---|---|
| Branch | Automatic | Current branch from workflow context |
| Rule | Automatic | Rule that triggered the workflow |
| Violation Type | Rule configuration | Category defined in the rule |
| Attachments | Previous actions | Images/videos collected during workflow |
Understanding Results
| Result | Meaning | Details |
|---|---|---|
| violation_created | Success | Returns new Violation ID |
| upload_failed | Evidence upload failed | Violation may still be created with limited attachments |
| no_attachments | No evidence to attach | Warning—violation created but no images/videos |
| database_error | Could not create record | Check database connectivity |
Attachment Handling
Multiple Attachments
The action can combine multiple attachments from different workflow stages:
- Full-frame detection image
- Cropped person image
- Annotated violation image
- Video clip
All are attached to the single violation record.
Attachment Types
| Type | Description | Typical Source |
|---|---|---|
| Image | Static snapshot | Object Detection, Snapshot actions |
| Annotated Image | Image with bounding boxes and labels | Zone Dwell Violation Snapshot |
| Video | Short clip (10-30 seconds) | Detection actions |
| Cropped Image | Focused view of detected object | Cashier Display, Person crops |
Common Use Cases
Loitering Alert
- Zone Dwell Reader finds events > threshold
- Zone Dwell Violation Snapshot creates annotated image
- Create Violation records with annotated evidence
Intrusion Detection
- Object Detection finds person in restricted area
- Create Violation records with detection images and video
Safety Compliance
- Object Detection finds person
- Mask Detection checks for PPE
- If no PPE: Create Violation records non-compliance
Vehicle Logging
- Object Detection finds vehicle
- ANPR reads license plate
- Create Violation records with plate information (or logs entry)
Troubleshooting
Upload Failed
-
Internet Connectivity: Verify server can reach cloud storage.
-
Storage Credentials: Check that API keys/credentials are valid.
-
Storage Quota: Ensure storage limit hasn't been exceeded.
-
File Size: Very large video clips may exceed upload limits.
No Attachments Warning
-
Previous Actions: Verify previous actions are capturing images successfully.
-
Workflow Connection: Ensure attachments are being passed between actions.
-
Storage Paths: Check that local image files exist at expected paths.
Notifications Not Sending
-
Brand Configuration: Check that notification methods are enabled in Brand Settings.
-
Email Configuration: For email, verify SMTP settings are correct.
-
Webhook URL: For webhooks, verify the URL is correct and accessible.
-
Service Status: External services (email provider, Zoho) may be down.
Duplicate Violations
-
Workflow Frequency: Very frequent workflow runs may create duplicates.
-
Duplicate Prevention: Use Zone Dwell Violation Snapshot's built-in duplicate checking.
-
Processing Flags: Ensure events are marked as processed after violation creation.
Database Errors
-
Connectivity: Check connection to cloud database.
-
Permissions: Verify write permissions to violations table.
-
Data Validation: Ensure all required fields have valid values.
Best Practices
-
Meaningful Violation Types: Configure descriptive violation types in your rules for clear reporting.
-
Evidence Quality: Ensure detection actions capture high-quality images for useful evidence.
-
Duplicate Prevention: Use appropriate mechanisms to prevent duplicate violations for the same incident.
-
Notification Testing: Test all notification channels when setting up a new Brand.
-
Storage Management: Monitor cloud storage usage and implement retention policies.
-
Violation Review Process: Establish a process for reviewing and resolving violations.
Integration Points
Incoming Data
- From Object Detection: Images, videos, bounding boxes
- From Zone Dwell Actions: Annotated evidence, dwell times
- From Snapshot Actions: Camera captures
- From ANPR: License plate data
Outgoing Notifications
- Email: Via configured SMTP
- Webhook: To external APIs, Slack, etc.
- Zoho: Ticket/record creation
- SMS: Via configured provider
- Dashboard: Real-time display in Control Room
Related Actions
- Object Detection: Primary source of detection evidence
- Zone Dwell Violation Snapshot: Prepares annotated loitering evidence
- Cashier Display: Provides cropped compliance images
- Stop: Alternative workflow ending when no violation needed