Skip to content

Farkitect is in early access. New features arrive most weeks, and these pages are updated with them. See What's New for the latest.

Relationship Constraints Reference

Constraints restrict which element types a relationship type can connect. They are defined as a list of valid pairs — each specifying a source element type and a target element type.

"constraints": {
"validPairs": [
{ "source": "application-component", "target": "application-service" },
{ "source": "application-component", "target": "application-component" }
]
}

Each pair references element types by their $id.

  • When drawing a relationship on the Canvas, only valid source/target pairs are allowed
  • The relationship type picker only shows types that have a valid pair for the selected source and target
  • Invalid attempts are silently prevented — no relationship is created

A relationship type’s constraints are edited as a grid in the Constraints section of its Properties: rows are sources, columns are targets. Changes to the grid are held until you click Save; Discard puts it back. See How to create a relationship type.

A relationship type with no constraints (empty validPairs or omitted constraints) can connect any two elements. This is useful for general-purpose relationships like Association.

"constraints": {}

Some built-in relationship types use "*" as a wildcard for one end:

{ "source": "note", "target": "*" }

This means the source must be a Note, but the target can be any element type.

The integrity checker can detect M1 relationships that violate their M2 type’s constraints. This can happen when:

  • An M2 constraint is added or tightened after M1 relationships were already created
  • A .farki file is imported with relationships that don’t match the available M2 constraints

Violations are reported as warnings — existing relationships are not automatically deleted.

Farkitect

Model anything.

“Welcome back — your diagrams have been plotting without you.”


Release 385 · 27 Nov 2026

Top packages: Inclusion and Sharing; Create New Version; Delete from Project

Release
385
Released
27 Nov 2026, 21:29 UTC
Built
27 Nov 2026, 21:30 UTC
Environment
Production
Surface
Docs
Commit
a5968f3
Branch
main