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

# Routines

> Create, test, import, export, and manage FDD routines using the logic builder and debugger to define custom fault detection rules for your equipment.

FDD routines define the logical rules that monitor your building equipment for specific fault conditions. Cloud BMS provides a pre-configured library of routines and a logic builder for creating custom rules.

<Info>
  Navigate to `FDD` from the left sidebar, then select `Routines` from the secondary sidebar.
</Info>

## Routines list

The Routines list displays routines built in your client environment. Use the search bar and `Filters` button to find specific routines.

<Note>
  Global routines from the FDD library are not available on this page. Access library routines through [FDD configuration](/products/fdd/configuration).
</Note>

<Frame caption="The Routines page lists all routines with search, filters, and action buttons for creating, exporting, and importing">
  <img src="https://mintcdn.com/kodelabs/i9tCc_I6OZNqDXAw/images/kode-os/fdd/kode-os-fdd-routines-list-full.png?fit=max&auto=format&n=i9tCc_I6OZNqDXAw&q=85&s=67fa3d79c7ef62b277654a2e1c6d8d0d" alt="Routines page showing the FDD secondary sidebar with Events, Faults, Routines, Policies, Configs, and Settings, a search bar, Filters button, Create Routine button, Export and Import buttons, and a table listing routines like Heating Fully Open for Long Periods FCUs CV6-Way and Cooling Fully Open for Long Periods with columns for Name, Description, Domain, Priority, Grouping Policy, and Recommended Type, showing 507 routines across 11 pages" width="1024" height="597" data-path="images/kode-os/fdd/kode-os-fdd-routines-list-full.png" />
</Frame>

| Column            | Description                                        |
| ----------------- | -------------------------------------------------- |
| `Name`            | Routine name                                       |
| `Description`     | Summary of the fault condition the routine detects |
| `Domain`          | Equipment domain the routine applies to            |
| `Priority`        | Default priority level for generated events        |
| `Grouping Policy` | How related events are consolidated                |

### Row actions

Select the three-dot menu on any routine row to access available actions:

* **Edit Routine**: Open the routine in the logic builder
* **Export Routine**: Download the routine as a file for sharing or backup
* **Duplicate Routine**: Create a copy of the routine with a new name
* **Delete Routine**: Permanently remove the routine

<Frame caption="The three-dot menu on each routine row provides Edit, Export, Duplicate, and Delete actions">
  <img src="https://mintcdn.com/kodelabs/i9tCc_I6OZNqDXAw/images/kode-os/fdd/kode-os-fdd-routine-row-actions.png?fit=max&auto=format&n=i9tCc_I6OZNqDXAw&q=85&s=5c95cd0c98042e70956b1e8dfe2cd482" alt="Routines page with a search filtered to temperature gr showing Temperature Greater Than Set Point While Occupied routine with domain Cooling Operation Failure, priority Alert, grouping policy None, and an open three-dot menu displaying Edit Routine, Export Routine, Duplicate Routine, and Delete Routine options" width="1024" height="297" data-path="images/kode-os/fdd/kode-os-fdd-routine-row-actions.png" />
</Frame>

## Create a routine

<Steps>
  <Step title="Set routine details">
    Select `+ Create Routine` from the toolbar. The `Workflow Details` tab opens.

    <Frame caption="The Workflow Details tab contains the routine name, description, recommended type, domains, grouping, priority, and device configuration">
      <img src="https://mintcdn.com/kodelabs/i9tCc_I6OZNqDXAw/images/kode-os/fdd/kode-os-fdd-routine-workflow-details.png?fit=max&auto=format&n=i9tCc_I6OZNqDXAw&q=85&s=c00c5d75924a8c57f63dff5e7ddf4baf" alt="Workflow Details tab for Heating Fully Open for Long Periods FCUs CV6-Way showing Name field, Description field with detailed routine logic explanation, Recommended Type set to Event, Domains set to Heating Issue, Events Grouping set to Reference Based, Priority set to Alert, a Base device group with Add Devices button, and an Add 1st Solution button, with Cancel and Save buttons" width="1024" height="688" data-path="images/kode-os/fdd/kode-os-fdd-routine-workflow-details.png" />
    </Frame>

    Complete the following fields:

    | Field             | Description                                       |
    | ----------------- | ------------------------------------------------- |
    | `Name`            | A descriptive name for the fault condition        |
    | `Description`     | Explanation of what the routine detects           |
    | `Domains`         | Equipment domains this routine applies to         |
    | `Events Grouping` | How events from this routine are grouped          |
    | `Priority`        | Default priority level for generated events       |
    | `Canonical Types` | Equipment types for base and reference devices    |
    | `Entities`        | Entity definitions for base and reference devices |

    When you select entities in **Add Devices**, the first click includes the entity as a required field. A second click marks the entity in red. A red (excluded) entity means the routine looks for devices that have the other required entities and do **not** contain that excluded entity. Use exclusion when you need to filter out devices that carry an unwanted field.

    <Frame caption="The Add Devices dialog lets you select Canonicals and Entities for base and reference devices">
      <img src="https://mintcdn.com/kodelabs/i9tCc_I6OZNqDXAw/images/kode-os/fdd/kode-os-fdd-routine-add-devices.png?fit=max&auto=format&n=i9tCc_I6OZNqDXAw&q=85&s=b3d5efab3bf591b83fbab980d599af0a" alt="Add Devices dialog with Name As set to Base, a Canonicals section showing selectable tags for fcu, vav, ahu, fan, radiantDevice, and uh with a search field, and an Entities section showing selectable tags for OM, ZTS, ZTSS, CLGUM, COUNTER, CSM, DAF, DFC, DFCS, DFEN, DFFREQ, DFM, DFMODE, DFRPC, DFRPS, DFS, DFSS, DFSTAGE, DFSTATS, DSM, DTS and more with a search field, Cancel and Save buttons" width="1024" height="655" data-path="images/kode-os/fdd/kode-os-fdd-routine-add-devices.png" />
    </Frame>
  </Step>

  <Step title="Build the logic">
    Open the `Logic` tab. The left panel contains available logic blocks organized by category: Read (String Point, Number Point, Boolean Point, Enum Point, arrays), Parameters (Number, Boolean, String), Organize (Folder), and Constants (Result).

    Drag blocks from the left panel onto the canvas to build the detection logic. Connect blocks in sequence to create the logical path from data input to alarm output. Each routine must start with at least one Read block and end with an Alarm Trigger block.

    <Frame caption="The Logic tab provides a visual canvas for connecting blocks into a detection sequence">
      <img src="https://mintcdn.com/kodelabs/i9tCc_I6OZNqDXAw/images/kode-os/fdd/kode-os-fdd-routine-logic-builder.png?fit=max&auto=format&n=i9tCc_I6OZNqDXAw&q=85&s=1f75dfb4e8d4a7d9962fc68b6c81eef4" alt="Logic tab for Heating Fully Open for Long Periods FCUs CV6-Way showing the left panel with block categories including Read, Parameters, Organize, and Constants, and a visual canvas with connected blocks: Enum Point for Discharge Fan Status, Enum Builder with On Off Unknown values, Number Point for CV6 with primary_loop_valve_position, Parameters block with Start Delay, Alarm On Delay, Return to Normal Delay, and Heating Valve Cmd, a Delayed Check block, Less Than Equal comparison, And logic gate, and a Delayed Alarm Trigger ending in an Alarm Trigger block" width="1024" height="691" data-path="images/kode-os/fdd/kode-os-fdd-routine-logic-builder.png" />
    </Frame>

    <Note>
      See [Routine logic blocks](/products/fdd/routine-logic-blocks) for a complete reference of available block types and their functions.
    </Note>
  </Step>

  <Step title="Test with the debugger">
    Open the `Debugger` tab. The left sidebar displays `PARAMS` (adjustable parameter values) and `INPUTS` (simulated device data). The main screen shows the Simulator output.

    <Frame caption="The Debugger tab shows parameters and inputs on the left, with the Start Simulation button in the center">
      <img src="https://mintcdn.com/kodelabs/SxbaONoYYoMWCQfA/images/kode-os/fdd/kode-os-fdd-debugger-start.png?fit=max&auto=format&n=SxbaONoYYoMWCQfA&q=85&s=fb70b55f5726369d8ea8e41381aafa4f" alt="Debugger tab for Heating Fully Open for Long Periods FCUs CV6-Way showing PARAMS section with Start Delay 30, Alarm On Delay 60, Return to Normal Delay 15, and Heating Valve Cmd -90, INPUTS section with CV6 value field and Status ok, Discharge Fan Status with Select Value dropdown and Status ok, a Send button, and the main Simulator area displaying a Start Simulation button with Stop and Restart controls" width="1024" height="679" data-path="images/kode-os/fdd/kode-os-fdd-debugger-start.png" />
    </Frame>

    1. Review the `PARAMS` section and adjust parameter values as needed.
    2. Select `Start Simulation` to begin the test.
    3. Update `INPUT` values to simulate different conditions, then select `Send`.

    <Frame caption="After sending input values, the Simulator logs actions with timestamps">
      <img src="https://mintcdn.com/kodelabs/SxbaONoYYoMWCQfA/images/kode-os/fdd/kode-os-fdd-debugger-send.png?fit=max&auto=format&n=SxbaONoYYoMWCQfA&q=85&s=25f812499df33ad763fa8bba1dcf1fc9" alt="Debugger tab with PARAMS showing Start Delay 30, Alarm On Delay 60, Return to Normal Delay 15, and Heating Valve Cmd -90, INPUTS showing CV6 value 50, Status ok, Discharge Fan Status set to On, Status ok, and the Simulator showing Starting status with Action Heating Fully Open for Long Periods FCUs CV6-Way logged at 10:09 AM" width="1024" height="683" data-path="images/kode-os/fdd/kode-os-fdd-debugger-send.png" />
    </Frame>

    4. Verify that the routine produces the expected response for each scenario.

    <Tip>
      Delay times run in real time during simulation. To speed up testing, temporarily change time units to seconds on timer logic blocks. Return to the correct units before deploying.
    </Tip>

    <Tip>
      Test boundary values thoroughly. Verify conditions that should trigger events and conditions that should not. This catches threshold errors before deployment.
    </Tip>
  </Step>

  <Step title="Save the routine">
    Select `Save`. The routine appears in the Routines list and becomes available for configuration in the Configs page.
  </Step>
</Steps>

## Export and import routines

Transfer routines between environments as `.json` files. Export downloads proven rules. Import uploads them without rebuilding logic.

<Tabs>
  <Tab title="Export" icon="download">
    The export feature lets you download routines as files for sharing or transferring to other environments.

    <Steps>
      <Step title="Select routines to export">
        Select the checkboxes next to the routines you want to export. The `Export` button at the bottom right shows the count of selected routines.

        <Frame caption="Select routines from the list using checkboxes, then select Export">
          <img src="https://mintcdn.com/kodelabs/i9tCc_I6OZNqDXAw/images/kode-os/fdd/kode-os-fdd-routines-export-select.png?fit=max&auto=format&n=i9tCc_I6OZNqDXAw&q=85&s=4fb40dfda8c191fecf3c636fbfdec727" alt="Routines page with two routines selected via checkboxes, with Cancel and Export buttons at the bottom showing a count of 2 selected" width="1024" height="681" data-path="images/kode-os/fdd/kode-os-fdd-routines-export-select.png" />
        </Frame>
      </Step>

      <Step title="Name the export file">
        Enter a name for the export file in the `File Name` dialog and select `Save`.

        <Frame caption="Assign a name to the export file">
          <img src="https://mintcdn.com/kodelabs/i9tCc_I6OZNqDXAw/images/kode-os/fdd/kode-os-fdd-routines-export-name.png?fit=max&auto=format&n=i9tCc_I6OZNqDXAw&q=85&s=25cd049164695ebd759bdfc82f8abf6f" alt="File Name dialog with a Name field and Cancel and Save buttons" width="410" height="236" data-path="images/kode-os/fdd/kode-os-fdd-routines-export-name.png" />
        </Frame>
      </Step>

      <Step title="Download the file">
        The file downloads to your computer as a `.json` file.

        <Frame caption="The exported routines download as a JSON file">
          <img src="https://mintcdn.com/kodelabs/i9tCc_I6OZNqDXAw/images/kode-os/fdd/kode-os-fdd-routines-export-download.png?fit=max&auto=format&n=i9tCc_I6OZNqDXAw&q=85&s=c44e3fd81a20304e7f4913092747b795" alt="Browser download bar showing exported JSON file" width="344" height="125" data-path="images/kode-os/fdd/kode-os-fdd-routines-export-download.png" />
        </Frame>
      </Step>
    </Steps>
  </Tab>

  <Tab title="Import" icon="upload">
    The import feature lets you upload routines from exported files to add proven rules without rebuilding them.

    <Steps>
      <Step title="Open the import dialog">
        Select `Import` at the top right of the Routines page. The Import Routines dialog opens with a file upload area.

        <Frame caption="The Import Routines dialog accepts a file upload or drag and drop">
          <img src="https://mintcdn.com/kodelabs/i9tCc_I6OZNqDXAw/images/kode-os/fdd/kode-os-fdd-routines-import-upload.png?fit=max&auto=format&n=i9tCc_I6OZNqDXAw&q=85&s=5eff61a2372d68ec63653ae80b67274d" alt="Import Routines dialog with a dashed border upload area" width="1024" height="683" data-path="images/kode-os/fdd/kode-os-fdd-routines-import-upload.png" />
        </Frame>
      </Step>

      <Step title="Upload and review routines">
        Select a file from your computer or drag and drop it into the upload area. The dialog displays the imported routines with editable fields for name, description, priority, and grouping policy.

        In the `Replace` column, choose how to handle conflicts with existing routines:

        * **Replace** overwrites the existing routine with the imported version
        * **Keep both** retains the existing routine and adds the imported version
        * **Keep old** ignores the imported routine and retains the existing version

        <Frame caption="Review imported routines, edit details, and choose how to handle conflicts">
          <img src="https://mintcdn.com/kodelabs/i9tCc_I6OZNqDXAw/images/kode-os/fdd/kode-os-fdd-routines-import-review.png?fit=max&auto=format&n=i9tCc_I6OZNqDXAw&q=85&s=9f03ccfb25d3a64a9cd0cd8fe1545203" alt="Import Routines review page with editable routine fields and conflict resolution options" width="1024" height="563" data-path="images/kode-os/fdd/kode-os-fdd-routines-import-review.png" />
        </Frame>
      </Step>

      <Step title="Complete the import">
        Select `Import` to finalize. The imported routines appear in your routines list. Select `Discard` to cancel without importing.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Data and permissions

Routines are the intellectual property of the party that created them. Neither KODE Labs nor partners hold exclusive rights over general fault detection concepts.

Export and import permissions are managed at the role level. Only super admins can access these features. Backend logs track who created, exported, and imported each routine.

<Note>
  This feature works for both FDD routines and FTT workflows. The same export and import process applies to both module types.
</Note>

## Next steps

<CardGroup cols={2}>
  <Card title="Routine logic blocks" icon="puzzle" href="/products/fdd/routine-logic-blocks" arrow={true}>
    Explore the available block types for building routine detection logic.
  </Card>

  <Card title="Routine library" icon="library" href="/products/fdd/routine-library" arrow={true}>
    Browse pre-configured routines for airside, chilled water, and hot water systems.
  </Card>

  <Card title="FDD configuration" icon="cog" href="/products/fdd/configuration" arrow={true}>
    Apply routines to your devices and configure monitoring parameters.
  </Card>
</CardGroup>
