---
title: "Repository Binding: Create Repository Model Entities from a Log Event"
description: "Reference for the ExtendedProperties/1.0#RepositoryBinding context key: the JSON structure that creates Integrations, Services, Systems, Contracts, and Service relations in the Nodinite Repository Model from a Log Event, plus the legacy individual keys."
---

# <i class="fal fa-sitemap" aria-hidden="true"></i> Repository Binding

Repository Binding lets a [Log Event][] create and bind [Repository Model][] entities ([Integrations][], [Services][], [Systems][], [Contracts][]) when the [Logging Service][] processes it. Put the JSON structure as a string in the `ExtendedProperties/1.0#RepositoryBinding` [context key][Context Options - RepositoryBinding], or use the [individual (legacy) keys](#individual-keys).

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p>You must enable the <a href="https://docs.nodinite.com/administration/settings/system-parameters/allowrepositoryautomapping/">AllowRepositoryAutomapping</a> <a href="https://docs.nodinite.com/administration/settings/system-parameters/overview/">System Parameter</a> for the <a href="https://docs.nodinite.com/core-services/logging-service/overview/">Logging Service</a> to honor Repository Binding data.</p></div>
</aside>

<i class="fal fa-history" aria-hidden="true"></i> Available from <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> 4.3.0.72+

![Search the O2C order ORD-10001, open the newest run, open the Details of Order Received, open the Repository Model tab with its Transport Contract, Service, Contract and Integration, and click INT1337 - Order-to-Cash to reach the Integration's view page with the automatic-creation description, animated walkthrough (7.12)][Hero]  
*Animated walkthrough: see what a binding created. Open an event's Details, then the **Repository Model** tab. It lists the Transport Contract, [Service][Services], Contract, and [Integration][Integrations], with cards for the Integration, [System][Systems], and Service below; each name links to its view page.*  

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>An Integration, Service, or System that a binding created gets the description <em>The system created this entry automatically due to a Log Event with content using the context-options feature. Therefore, if you change this name, it may reappear with future Log Events</em>. Rename it in the binding, not in the <a href="https://docs.nodinite.com/repository-model/overview/">Repository Model</a>: the next event with the old name creates it again.</p></div>
</aside>

## <i class="fal fa-table" aria-hidden="true"></i> Reference

<h3 id="structure">Structure</h3>

One `RepositoryBinding` value creates the complete structure and replaces the [individual keys](#individual-keys).

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>The structure documented below is for <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> v7. Earlier versions may have different field requirements.</p></div>
</aside>

The outline below is a fragment that shows the allowed values; see [Examples](#examples) for valid JSON.

```text
{
  "Name": "Transport Contract Name",
  "Service": {
    "Name": "Service Name",
    "Direction": "Send|Receive|TwoWaySend|TwoWayReceive",
    "System": { "Name": "System Name" },
    "Integration": { "Name": "Integration Name" },
    "ExternalServiceRelations": [{
      "Name": "Service",
      "Direction": "Send|Receive",
      "System": { "Name": "System" }
    }],
    "InternalServiceRelations": [{
      "Name": "Service",
      "Direction": "Send|Receive"
    }],
    "BPMs": [ BPM objects, see BPM Binding ]
  }
}
```

![Repository Binding - Service relations][1]  
*Diagram showing External and Internal Service Relations in a Repository Binding structure.*  

<h3 id="root-object">Root Object</h3>

|Field|Required|Purpose|Example|
|---|---|---|---|
|<span id="root-name"></span>`Name`|✅ Yes|[Transport Contract][Transport Contracts] name (can be the same for all services)|`Default`, `Standard Transport Contract`|
|<span id="root-service"></span>`Service`|✅ Yes|Service definition|[Service object](#service-object)|

<h3 id="service-object">Service Object</h3>

|Field|Required|Purpose|Example|
|---|---|---|---|
|<span id="service-name"></span>`Name`|✅ Yes|Service name|`Bank - Loan Request`, `INT1337-RCV-Order-Incoming`|
|<span id="service-direction"></span>`Direction`|✅ Yes|Direction of the Service; it draws the direction arrows on connectors in the [Integration Landscape][] ([values](#service-direction-values))|`Send`, `Receive`, `TwoWaySend`, `TwoWayReceive`|
|<span id="service-system"></span>`System`|✅ Yes|Hosting System|`{ "Name": "Mule" }`|
|<span id="service-integration"></span>`Integration`|✅ Yes|Parent Integration|`{ "Name": "INT004 - Bank (2 Way)" }`|
|<span id="service-externalservicerelations"></span>`ExternalServiceRelations`|❌ No|Cross-system connections|Array of [external relation objects](#external-service-relations)|
|<span id="service-internalservicerelations"></span>`InternalServiceRelations`|❌ No|Same-system connections|Array of [internal relation objects](#internal-service-relations)|
|<span id="service-bpms"></span>`BPMs`|❌ No|Business process positioning|Array of [BPM][BPMs] objects, see [BPM Binding][]|

<h3 id="external-service-relations">ExternalServiceRelations (Cross-System)</h3>

Links to services in **different systems**. Used to show cross-system integration flows.

|Field|Required|Purpose|Example|
|---|---|---|---|
|<span id="externalservicerelation-name"></span>`Name`|✅ Yes|Target service name|`Bank Service`, `Broker A - Get Quote`|
|<span id="externalservicerelation-direction"></span>`Direction`|✅ Yes|Target service direction|`Send`, `Receive`|
|<span id="externalservicerelation-system"></span>`System`|✅ Yes|Target system|`{ "Name": "Bank System" }`|

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p><strong>Direction</strong> refers to the <strong>direction of the target service</strong>, not the current service. For example, if the current service is "Receive" and points to a downstream "Send" service, set <code>Direction = "Send"</code>.</p></div>
</aside>

<h3 id="internal-service-relations">InternalServiceRelations (Same-System)</h3>

Links to services in the **same system**. Used to show internal routing or transformation steps.

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>The <code>System</code> field is not required for Internal Service Relations. The system is assumed to be the same as the parent Service's system. If the target service does not exist, it will be created within the parent Service's system.</p></div>
</aside>

|Field|Required|Purpose|Example|
|---|---|---|---|
|<span id="internalservicerelation-name"></span>`Name`|✅ Yes|Target service name (same system)|`Receive Quotes`, `Order Router`|
|<span id="internalservicerelation-direction"></span>`Direction`|✅ Yes|Target service direction|`Send`, `Receive`|

<h3 id="individual-keys">Individual Keys (Legacy)</h3>

Use these [Context Options][] when you don't use the complete JSON structure.

|Context Key|Value|Purpose|
|---|---|---|
|<span id="integrationname"></span>`ExtendedProperties/1.0#IntegrationName`|`string` (e.g., `INT001 - X to Y`)|[Integration][Integrations] name|
|<span id="servicename"></span>`ExtendedProperties/1.0#ServiceName`|`string`|[Service][Services] name|
|<span id="servicesystemname"></span>`ExtendedProperties/1.0#ServiceSystemName`|`string`|[System][Systems] name of the [Service][Services] (auto-created)|
|<span id="servicedirection"></span>`ExtendedProperties/1.0#ServiceDirection`|`string` / `int`|Direction of the [Service][Services] ([values](#service-direction-values))|
|<span id="externalservicerelationname"></span>`ExtendedProperties/1.0#ExternalServiceRelationName`|`string`|Target [Service][Services] in another [System][Systems]|
|<span id="externalservicerelationsystemname"></span>`ExtendedProperties/1.0#ExternalServiceRelationSystemName`|`string`|Target [System][Systems] name|
|<span id="internalservicerelationname"></span>`ExtendedProperties/1.0#InternalServiceRelationName`|`string`|Target [Service][Services] in the same [System][Systems]|
|<span id="internalservicerelationdirection"></span>`ExtendedProperties/1.0#InternalServiceRelationDirection`|`string` / `int`|Direction of the target [Service][Services] ([values](#service-direction-values))|
|<span id="contractname"></span>`ExtendedProperties/1.0#ContractName`|`string`|[Contract][Contracts] name|
|<span id="contractsystemname"></span>`ExtendedProperties/1.0#ContractSystemName`|`string`|[System][Systems] name of the [Contract][Contracts] (optional)|

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>The Integration is created only when a Service or Contract is also created. The Contract keys require the <a href="https://docs.nodinite.com/administration/settings/system-parameters/usecontracts/">UseContracts</a> system parameter = <code>true</code>.</p></div>
</aside>

<h3 id="service-direction-values">Service Direction Values</h3>

`ServiceDirection` and `InternalServiceRelationDirection` accept the string or the integer.

|String|Integer|
|---|---|
|<span id="direction-none"></span>`None`|`-2`|
|<span id="direction-unknown"></span>`Unknown`|`-1`|
|<span id="direction-receive"></span>`Receive`|`0`|
|<span id="direction-send"></span>`Send`|`1`|
|<span id="direction-twowayreceive"></span>`TwoWayReceive`|`10`|
|<span id="direction-twowaysend"></span>`TwoWaySend`|`11`|

<h2 id="examples"><i class="fal fa-code" aria-hidden="true"></i> Examples</h2>

### Repository Binding JSON

```json
{
  "Name": "Receive Quotes via JSON",
  "Service": {
    "Name": "Receive Quotes",
    "Direction": "TwoWayReceive",
    "System": { "Name": "Mule" },
    "Integration": { "Name": "INT004 - Bank (2 Way)" },
    "ExternalServiceRelations": [{
      "Name": "Broker A - Get Quote",
      "Direction": "Send",
      "System": { "Name": "Broker A" }
    }],
    "InternalServiceRelations": [{
      "Name": "Bank - Loan Request",
      "Direction": "Receive"
    }]
  }
}
```

<h3 id="escaped-string">For Scalar, Swagger, and the Log API</h3>

The context value is a string, so escape the JSON. This is the same example as one `Context` entry:

```json
"ExtendedProperties/1.0#RepositoryBinding": "{\"Name\":\"Receive Quotes via JSON\",\"Service\":{\"Name\":\"Receive Quotes\",\"Direction\":\"TwoWayReceive\",\"System\":{\"Name\":\"Mule\"},\"Integration\":{\"Name\":\"INT004 - Bank (2 Way)\"},\"ExternalServiceRelations\":[{\"Name\":\"Broker A - Get Quote\",\"Direction\":\"Send\",\"System\":{\"Name\":\"Broker A\"}}],\"InternalServiceRelations\":[{\"Name\":\"Bank - Loan Request\",\"Direction\":\"Receive\"}]}}"
```

To try it, [explore the operations in Scalar or Swagger][Explore operations in Scalar or Swagger]. For a Repository Binding with a BPM position, see the [BPM Binding][] example.

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-diagram-project" aria-hidden="true"></i> [BPM Binding][]  
* <i class="fal fa-sliders" aria-hidden="true"></i> [Context Options][]  
* <i class="fal fa-brackets-curly" aria-hidden="true"></i> [JSON Log Event][]  
* <i class="fal fa-gear" aria-hidden="true"></i> [AllowRepositoryAutomapping][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-bolt" aria-hidden="true"></i> [Log Event][]  
* <i class="fal fa-cogs" aria-hidden="true"></i> [Logging Service][]  
* <i class="fal fa-sitemap" aria-hidden="true"></i> [Repository Model][]  
* <i class="fal fa-puzzle-piece" aria-hidden="true"></i> [Integrations][]  
* <i class="fal fa-gear" aria-hidden="true"></i> [Services][]  
* <i class="fal fa-cube" aria-hidden="true"></i> [Systems][]  
* <i class="fal fa-file-contract" aria-hidden="true"></i> [Contracts][]  
* <i class="fal fa-database" aria-hidden="true"></i> [Let Log Events Build the Model][Build from Log Events]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/LogAgents/LogEvent/RepositoryBinding_ServiceRelations.png

[AllowRepositoryAutomapping]:https://docs.nodinite.com/administration/settings/system-parameters/allowrepositoryautomapping/
[BPM Binding]:https://docs.nodinite.com/core-services/log-event/features/bpm-binding/
[BPMs]:https://docs.nodinite.com/repository-model/bpms/overview/
[Build from Log Events]:https://docs.nodinite.com/getting-started/repository/documentation-strategy/let-log-events-build-the-model/
[Context Options]:https://docs.nodinite.com/core-services/log-event/features/context-options/
[Context Options - RepositoryBinding]:https://docs.nodinite.com/core-services/log-event/features/context-options/#repositorybinding
[Contracts]:https://docs.nodinite.com/getting-started/repository/contracts/overview/
[Explore operations in Scalar or Swagger]:https://docs.nodinite.com/core-services/log-api/features/log-using-rest/#explore-operations
[Hero]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/CoreServices/LogAPI/RepositoryBinding_Event.gif
[Integration Landscape]:https://docs.nodinite.com/getting-started/repository/integrations/integration-landscape/
[Integrations]:https://docs.nodinite.com/repository-model/integrations/overview/
[JSON Log Event]:https://docs.nodinite.com/core-services/log-event/features/json-log-event/
[Log Event]:https://docs.nodinite.com/core-services/log-event/overview/
[Logging Service]:https://docs.nodinite.com/core-services/logging-service/overview/
[Repository Model]:https://docs.nodinite.com/repository-model/overview/
[Services]:https://docs.nodinite.com/repository-model/services/overview/
[System Parameters]:https://docs.nodinite.com/administration/settings/system-parameters/overview/
[Systems]:https://docs.nodinite.com/repository-model/systems/overview/
[Transport Contracts]:https://docs.nodinite.com/repository-model/services/overview/#fa-microchip-transport-contracts-the-heart-of-service-definitions
[UseContracts]:https://docs.nodinite.com/administration/settings/system-parameters/usecontracts/