> ## Documentation Index
> Fetch the complete documentation index at: https://docs.melonly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CAD Blocks

> Learn how CAD Blocks work.

***

## Overview

CAD Blocks allow workflows to interact directly with your Computer-Aided Dispatch (CAD) system.\
They provide automation, monitoring, and logic control for units, users, calls, records, radio channels, timers, and more.

All CAD blocks are **teal-colored** in the workflow editor.

CAD Blocks fall into three categories:

* **Triggers** - Start workflows when CAD events occur.
* **Actions** - Perform tasks or modify CAD data.
* **Conditions** - Check CAD states and return true/false.

These blocks are designed to help automate dispatch operations, enforce policies, synchronize systems, and build advanced logic around CAD activity.

***

## Triggers

Triggers fire automatically when something happens inside CAD.\
They are ideal for logging, notifications, automation, or enforcing rules.

<Expandable title="CAD Triggers">
  ### Unit and User Activity

  * unit\_status\_set - Fires when a unit's status changes (Available -> Busy).
  * unit\_used - Fires when a unit is selected or activated.
  * user\_logged\_into\_cad - Fires when a user logs into CAD.
  * user\_logged\_out\_of\_cad - Fires when a user logs out of CAD.
  * user\_blocked - Fires when a user becomes blocked.
  * user\_unblocked - Fires when a user is unblocked.
  * user\_joined\_from\_code - Fires when a user joins using a CAD join code.
  * panel\_entered - Fires when a user enters a CAD panel.
  * panel\_left - Fires when a user leaves a CAD panel.

  ### Audio and Signals

  * tone\_played - Fires when a tone is played.
  * signal\_played - Fires when a signal is played.
  * signal\_ended - Fires when a signal ends.

  ### Timers

  * timer\_started - Fires when a timer begins.
  * timer\_paused - Fires when a timer pauses.
  * timer\_resumed - Fires when a timer resumes.
  * timer\_cancelled - Fires when a timer is cancelled.

  ### Calls

  * call\_created - Fires when a new call is created.
  * call\_edited - Fires when a call is updated.
  * call\_ended - Fires when a call ends.
  * unit\_assigned\_to\_call - Fires when a unit is assigned to a call.
  * unit\_removed\_from\_call - Fires when a unit is removed from a call.
  * call\_note\_created - Fires when a note is added to a call.

  ### Panic and Bodycam

  * panic\_pressed - Fires when a panic button is pressed.
  * panic\_ended - Fires when panic ends.
  * bodycam\_started - Fires when bodycam recording starts.
  * bodycam\_ended - Fires when bodycam recording stops.

  ### Records

  * record\_created - Fires when a record is created in CAD.
  * record\_edited - Fires when a record is edited in CAD.
  * record\_deleted - Fires when a record is deleted in CAD.

  ### Radio Channels

  * user\_joined\_radio\_channel - Fires when a user joins a radio channel.
  * user\_left\_radio\_channel - Fires when a user leaves a radio channel.

  ### Bail and Court

  * civ\_held\_for\_bail - Fires when a civilian is held for bail.
  * civ\_bail\_denied - Fires when bail is denied.
  * civ\_bail\_set - Fires when bail is set.
  * civ\_bail\_revoked - Fires when bail is revoked.
  * bail\_case\_created - Fires when a bail case is created.
  * bail\_case\_processed - Fires when a bail case is processed.

  ### Criminal Cases and Warrants

  * criminal\_case\_created - Fires when a criminal case is created.
  * criminal\_case\_processed - Fires when a criminal case is processed.
  * warrant\_requested - Fires when a warrant is requested.
  * warrant\_approved - Fires when a warrant is approved.
  * warrant\_denied - Fires when a warrant is denied.
  * warrant\_cancelled - Fires when a warrant is cancelled.

  ### Licensing

  * licence\_suspended - Fires when a licence is suspended.
  * licence\_demerited - Fires when demerit points are added.
  * licence\_demerit\_points\_removed - Fires when demerit points are removed.
  * licence\_suspension\_ended - Fires when a suspension ends.
</Expandable>

***

## Actions

Actions let workflows modify CAD data or perform CAD operations.\
They are used to automate dispatch tasks, update records, manage users, and control timers and signals.

<Expandable title="CAD Actions">
  ### Unit and User Management

  * set\_unit\_status - Sets a unit's status.
  * get\_unit\_status - Retrieves a unit's current status.
  * get\_user\_active\_unit - Gets the unit a user is currently assigned to.
  * kick\_user\_from\_panel - Forces a user out of a CAD panel.
  * edit\_unit - Updates unit information.
  * block\_user - Blocks a user from CAD.
  * unblock\_user - Unblocks a user.
  * get\_user\_joined\_from\_code - Retrieves the join code used by a user.

  ### Audio and Signals

  * play\_tone - Plays a tone.
  * play\_signal - Plays a signal.
  * end\_active\_signal - Stops an active signal.

  ### Timers

  * create\_timer - Starts a timer.
  * pause\_timer - Pauses a timer.
  * resume\_timer - Resumes a timer.
  * cancel\_timer - Cancels a timer.

  ### Calls

  * get\_call\_by\_incident - Retrieves a call by incident number.
  * assign\_unit\_to\_call - Assigns a unit to a call.
  * remove\_unit\_from\_call - Removes a unit from a call.
  * get\_call\_count\_by\_status - Counts calls with a specific status.
  * create\_call\_note - Adds a note to a call.

  ### Records

  * delete\_record - Deletes a record.
  * get\_record\_pdf\_link - Gets a PDF link for a record.

  ### Radio Channels

  * kick\_user\_from\_radio\_channel - Removes a user from a radio channel.
  * get\_user\_radio\_channel\_count - Gets number of users in a channel.
  * get\_radio\_channel\_user\_count - Gets number of users across channels.

  ### CAD Statistics

  * get\_cad\_user\_count - Counts users currently in CAD.
  * get\_panel\_user\_count - Counts users currently on panels.

  ### Panic

  * set\_user\_panic - Sets panic state on or off.
</Expandable>

***

## Conditions

Conditions evaluate CAD states and return true or false.\
They are used to control workflow logic, enforce rules, or check user and unit status.

<Expandable title="CAD Conditions">
  ### Unit and User Status

  * is\_unit\_status\_set\_to - Checks if a unit's status matches a value.
  * is\_user\_in\_cad - Checks if a user is logged into CAD.
  * is\_user\_on\_panel - Checks if a user is on a panel.
  * is\_user\_blocked - Checks if a user is blocked.

  ### Join Codes and Panic

  * did\_user\_join\_from\_code - Checks if a user joined using a specific code.
  * is\_user\_currently\_panicked - Checks if a user's unit is panicked.

  ### Bodycam

  * is\_user\_bodycam\_activated - Checks if bodycam is active.

  ### Radio Channels

  * is\_user\_in\_radio\_channel - Checks if a user is in a specific channel.
  * is\_user\_in\_a\_radio\_channel - Checks if a user is in any channel.

  ### Calls

  * is\_user\_assigned\_to\_call - Checks if a user is assigned to a specific call.
  * is\_user\_assigned\_to\_a\_call - Checks if a user is assigned to any call.

  ### Timers

  * is\_user\_assigned\_to\_timer - Checks if a user is assigned to a timer.
</Expandable>

***

## Additional Notes

CAD Blocks are designed to be flexible and powerful.\
Some common use cases include:

* Automating dispatch workflows
* Enforcing department policies
* Creating advanced panic systems
* Building radio channel automations
* Managing unit availability
* Generating logs and audit trails
* Integrating CAD with external systems
* Creating custom call routing logic
* Automating bail and court workflows
* Tracking bodycam usage
* Monitoring user activity for moderation

CAD Blocks can be combined with collections, persistent variables, and other workflow blocks to build complex systems.

***

<Card title="Need help?" icon="headset" href="https://melonly.xyz/discord">
  Still have questions? Join our Discord server for support.
</Card>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.