Skip to main content

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:

  1. Create a permanent record of the incident
  2. Attach evidence (images, videos)
  3. 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:

FieldDescription
BranchWhich location the violation occurred
StreamWhich camera captured the evidence
TimestampWhen the violation was detected
TypeCategory of violation (loitering, intrusion, etc.)
AttachmentsURLs to uploaded evidence
RuleWhich workflow rule triggered this
StatusInitial 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:

  1. This action creates the violation record
  2. The system checks the Brand Settings for this client
  3. 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:

ParameterSourceDescription
BranchAutomaticCurrent branch from workflow context
RuleAutomaticRule that triggered the workflow
Violation TypeRule configurationCategory defined in the rule
AttachmentsPrevious actionsImages/videos collected during workflow

Understanding Results

ResultMeaningDetails
violation_createdSuccessReturns new Violation ID
upload_failedEvidence upload failedViolation may still be created with limited attachments
no_attachmentsNo evidence to attachWarning—violation created but no images/videos
database_errorCould not create recordCheck 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

TypeDescriptionTypical Source
ImageStatic snapshotObject Detection, Snapshot actions
Annotated ImageImage with bounding boxes and labelsZone Dwell Violation Snapshot
VideoShort clip (10-30 seconds)Detection actions
Cropped ImageFocused view of detected objectCashier Display, Person crops

Common Use Cases

Loitering Alert

  1. Zone Dwell Reader finds events > threshold
  2. Zone Dwell Violation Snapshot creates annotated image
  3. Create Violation records with annotated evidence

Intrusion Detection

  1. Object Detection finds person in restricted area
  2. Create Violation records with detection images and video

Safety Compliance

  1. Object Detection finds person
  2. Mask Detection checks for PPE
  3. If no PPE: Create Violation records non-compliance

Vehicle Logging

  1. Object Detection finds vehicle
  2. ANPR reads license plate
  3. Create Violation records with plate information (or logs entry)

Troubleshooting

Upload Failed

  1. Internet Connectivity: Verify server can reach cloud storage.

  2. Storage Credentials: Check that API keys/credentials are valid.

  3. Storage Quota: Ensure storage limit hasn't been exceeded.

  4. File Size: Very large video clips may exceed upload limits.

No Attachments Warning

  1. Previous Actions: Verify previous actions are capturing images successfully.

  2. Workflow Connection: Ensure attachments are being passed between actions.

  3. Storage Paths: Check that local image files exist at expected paths.

Notifications Not Sending

  1. Brand Configuration: Check that notification methods are enabled in Brand Settings.

  2. Email Configuration: For email, verify SMTP settings are correct.

  3. Webhook URL: For webhooks, verify the URL is correct and accessible.

  4. Service Status: External services (email provider, Zoho) may be down.

Duplicate Violations

  1. Workflow Frequency: Very frequent workflow runs may create duplicates.

  2. Duplicate Prevention: Use Zone Dwell Violation Snapshot's built-in duplicate checking.

  3. Processing Flags: Ensure events are marked as processed after violation creation.

Database Errors

  1. Connectivity: Check connection to cloud database.

  2. Permissions: Verify write permissions to violations table.

  3. Data Validation: Ensure all required fields have valid values.


Best Practices

  1. Meaningful Violation Types: Configure descriptive violation types in your rules for clear reporting.

  2. Evidence Quality: Ensure detection actions capture high-quality images for useful evidence.

  3. Duplicate Prevention: Use appropriate mechanisms to prevent duplicate violations for the same incident.

  4. Notification Testing: Test all notification channels when setting up a new Brand.

  5. Storage Management: Monitor cloud storage usage and implement retention policies.

  6. 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

  • 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