What This Table Is

The cmdb_rel_ci table defines relationships between Configuration Items in ServiceNow's CMDB. Each record represents a directional connection between two CIs—one parent, one child—with metadata describing the relationship type. This table powers dependency mapping, impact analysis, and the visual CI relationship viewer in the platform.

Owned by the CMDB module, this table supports the entire Configuration Management process from discovery to impact analysis. Discovery tools populate it automatically when they detect infrastructure dependencies, while manual CMDB processes use it to document business service relationships and application dependencies.

This table extends cmdb_rel_type for the relationship definition and sits alongside the broader cmdb_ci hierarchy. No tables extend cmdb_rel_ci directly—it's the final table in the relationship chain. The type field references cmdb_rel_type records that define relationship semantics like 'Hosted on', 'Used by', or 'Contains'.

Large enterprises see millions of CI relationships from discovery tools scanning infrastructure every few hours. Table performance becomes critical around 500K+ records—queries without proper parent or child field filtering will timeout. The platform includes database indexes on these reference fields by default, but custom relationship queries often require additional indexing strategy.

When You'll Script Against This Table

Most scripting happens in Business Rules triggered by CI changes, Script Includes for impact analysis, and Scheduled Jobs for relationship cleanup. The cmdb_rel_ci table rarely appears in client-side scripting—relationship queries are too expensive for UI responsiveness.

Access requires cmdb_read role minimum for queries, cmdb_write for relationship creation. Discovery processes run with elevated privileges, but custom applications must request appropriate CMDB role grants through normal channels.

Common scripting patterns:

  • Finding all child CIs of a specific parent for impact analysis during incident creation
  • Traversing relationship chains to build dependency trees for change impact assessment
  • Creating relationships automatically when discovery identifies new infrastructure dependencies
  • Cleaning up orphaned relationships when CIs are decommissioned or marked inactive
  • Calculating relationship counts for CMDB health dashboards and metrics reporting
  • Validating relationship consistency during data imports or bulk CI updates
  • Building custom relationship views that filter by specific CI types or relationship patterns

Table Gotchas

⚠️

Relationships are directional but discovery tools often create duplicate reverse relationships. Always check both parent→child and child→parent queries when doing impact analysis.

  • The percent_outage field defaults to 0 but should be 100 for most dependencies—discovery doesn't populate this correctly
⚠️

Queries without parent.sys_id or child.sys_id filters will scan millions of records. Always include at least one CI reference in your query conditions.

  • The type field references cmdb_rel_type but displays as choice field—use getValue() not getDisplayValue() in queries
  • Business Rules on this table fire constantly during discovery—use condition scripts to avoid performance issues
⚠️

ACLs inherit from both parent and child CI permissions. Users need read access to BOTH CIs to see the relationship record.

  • Database views and reporting often join this table incorrectly—relationship counts get inflated when not using DISTINCT properly
Free Newsletter

Enjoying this? Get one deep-dive per week.

Join 1,000+ ServiceNow pros — scripts, GlideRecord patterns, Flow Designer techniques, and career moves. Free.

No spam · Unsubscribe anytime

The cmdb_ci table provides both parent and child CI details—every relationship query joins against cmdb_ci twice to get CI names, states, and types. The cmdb_rel_type table defines relationship semantics and determines which relationship types are valid between specific CI classes.

Impact analysis scenarios commonly join with incident and change_request tables through their cmdb_ci field. Discovery processes link relationship data with discovery_status and sys_object_source tables to track which tools created specific relationships and when they were last verified.

Service mapping applications frequently query relationships alongside cmdb_ci_service and cmdb_ci_appl tables to build complete application dependency maps. Custom CMDB integrations often cross-reference this table with sys_user when implementing ownership-based relationship visibility or assignment group-based CI access controls.