---
title: "surfaceRelationPolicy"
url: https://developers.dagio.ai/reference/surface-relation-policy/
---

# surfaceRelationPolicy

   
                              
                                                                                
                                         
                  
           
          
   

This reference describes the full structure of `surfaceRelationPolicy`. Paths include nested objects, list items and conditional branches. A branch selected by `kind`, `contract` or `mode` only admits its own properties.

## Structure and values

| Field | Options / expected values | Description |
| --- | --- | --- |
| `contract` | `"SurfaceRelationPolicy@1"` | **Required.** Exact discriminant of this contract variant. Match the literal value shown. |
| `key` | `string; /^[a-z][a-z0-9-]*$/; max length 120` | **Required.** Stable semantic identifier used by references; changing it changes identity. |
| `linkTypePath` | `string; min length 1; max length 600` | **Required.** Defines link Type Path for this object. Observe the type, variants and bounds in the Options column. |
| `source` | `closed object` | **Required.** Defines source for this object. Observe the type, variants and bounds in the Options column. |
| `source.definitionPaths` | `Array<string; min length 1; max length 600>; min length 1; max length 100` | **Required.** Defines definition Paths for this object. Observe the type, variants and bounds in the Options column. |
| `source.fields` | `Array<closed object>; max length 30` | **Required.** Typed value definitions or selections within the enclosing context. |
| `source.fields[].fieldKey` | `string; /^[a-z][a-zA-Z0-9-]*$/; max length 120` | **Required.** Key of a Field declared on the referenced Surface definition. |
| `source.fields[].values` | `Array<string; max length 20000 OR number OR true \| false>; min length 1; max length 30` | **Required.** Set of admitted or compared values according to the declared operation. |
| `target` | `closed object` | **Required.** Defines target for this object. Observe the type, variants and bounds in the Options column. |
| `target.definitionPaths` | `Array<string; min length 1; max length 600>; min length 1; max length 100` | **Required.** Defines definition Paths for this object. Observe the type, variants and bounds in the Options column. |
| `target.fields` | `Array<closed object>; max length 30` | **Required.** Typed value definitions or selections within the enclosing context. |
| `target.fields[].fieldKey` | `string; /^[a-z][a-zA-Z0-9-]*$/; max length 120` | **Required.** Key of a Field declared on the referenced Surface definition. |
| `target.fields[].values` | `Array<string; max length 20000 OR number OR true \| false>; min length 1; max length 30` | **Required.** Set of admitted or compared values according to the declared operation. |
| `maximumOutgoing` | `integer; ≥ 1; ≤ 10000; null` | **Required.** Cardinality or budget bound for the named resource. Exceeding the bound is refused; null denotes no bound only where admitted by the schema. |
| `maximumIncoming` | `integer; ≥ 1; ≤ 10000; null` | **Required.** Cardinality or budget bound for the named resource. Exceeding the bound is refused; null denotes no bound only where admitted by the schema. |
| `acyclic` | `true \| false` | **Required.** Defines acyclic for this object. Observe the type, variants and bounds in the Options column. |
| `deletion` | `"allow" \| "forbid"` | **Required.** Defines deletion for this object. Observe the type, variants and bounds in the Options column. |
| `maximumTraversalNodes` | `integer; ≥ 1; ≤ 10000` | **Required.** Cardinality or budget bound for the named resource. Exceeding the bound is refused; null denotes no bound only where admitted by the schema. |

## Reading the contract

A path ending in `[]` describes each list item; `{key}` describes each dictionary value. The `↻` marker refers to the same recursive expression. Closed objects reject additional properties. Semantic validation denotes an additional check: matching a type does not make a reference, permission or transition valid. References must resolve in the Model and the current user context.

An older variant cannot accept properties belonging to a newer variant. The compiler checks the version and consistency of the complete Model.

## Structural example

This fragment passes the schema for this section. Its business references must be defined in the enclosing Model.

```json
{
  "contract": "SurfaceRelationPolicy@1",
  "key": "current-attention-selection",
  "linkTypePath": "application/current-attention-selection",
  "source": {
    "definitionPaths": [
      "workspace/workshop/surface/impact-manifest/surface/attention"
    ],
    "fields": []
  },
  "target": {
    "definitionPaths": [
      "workspace/workshop/surface/impact-manifest/surface/attention/surface/decision"
    ],
    "fields": []
  },
  "maximumOutgoing": 1,
  "maximumIncoming": 1,
  "acyclic": true,
  "deletion": "allow",
  "maximumTraversalNodes": 100
}
```

## Related references

[Complete Model index](https://developers.dagio.ai/reference/) · [Build a Model](https://developers.dagio.ai/models/)

<!-- surface-examples:start -->

## Applied examples : One client, many quotes

The constraint governs links; the presentation group shows four results and access to the full list.

### Configuration

Contract object `surfaceRelationPolicy`. [Properties and accepted values](https://developers.dagio.ai/reference/surface-relation-policy/).

```json
{
  "contract": "SurfaceRelationPolicy@1",
  "key": "quote-client",
  "linkTypePath": "application/client",
  "source": {
    "definitionPaths": [
      "workspace/quotes/surface/quote"
    ],
    "fields": []
  },
  "target": {
    "definitionPaths": [
      "workspace/clients/surface/client"
    ],
    "fields": []
  },
  "maximumOutgoing": 1,
  "maximumIncoming": null,
  "acyclic": false,
  "deletion": "forbid",
  "maximumTraversalNodes": 1000
}
```

### Variation and connection

Fragment placed in `presentation.recordProfiles[].detail.relatedGroups[]`. [Properties and accepted values](https://developers.dagio.ai/reference/workspace-record-profile/).

```json
{
  "key": "quotes",
  "label": "Quotes",
  "queryBindingKey": "client-quotes",
  "maximumVisible": 4,
  "openAllLabel": "View all quotes",
  "rowIcon": null
}
```

### UI layout example

The illustrative layout below places this configuration in the Clients/Quotes app. Insert each fragment at the stated location, with Field, Query and Action references matching the Model declarations.

1. Selected client
2. Search
3. Quotes
4. View all quotes

<!-- surface-examples:end -->
