How do I provision a second tenant with Northwind Traders?
Table of Contents
Northwind Traders is the second demonstration tenant. It is a fictional UK trading company built from the classic Northwind Traders sample. The system needs more than one tenant for the grid's per-tenant attribution, for the scheduler's per-tenant work, and for any screen that must not leak across tenants. Northwind serves that purpose without a second ACME-sized dataset.
Northwind is lighter than
Acme Corporation. It has one
legal entity, one party, nine staff, six portfolios and seven books. It also
carries its own report configuration documents. Its reports are therefore
configured with the documents they read, and not only defined. The
ores-shell block below is tangled into the runnable script library as
northwind_traders_provision.ores.
1. Question
How do I add a second, ready-to-run tenant to a system that already holds ACME?
2. Answer
Log in as super_admin. Provision northwind from the northwind starting
point. Then log in as its administrator and set the party the account works in.
The starting point runs eight steps on the server:
system_provisionpublishes the installation's own data.publish_bundlepublishes the base reference data and the GLEIF counterparties.import_lei_hierarchycreates the tenant's party from its synthetic LEI.provision_partypublishes the party's conventions and CRM topology.load_staffpublishes the organisation, staff and report data.set_staff_passwordsgives every staff account its password.attach_photosattaches each account's picture.generate_tradeswrites two bond populations.
load's stop-on-error semantics guarantee that an error-free run ends fully
provisioned.
Expectations:
- The services are up (
compass services start). - The database is fresh. Run
compass services stop, thencompass db recreate -y -k, then start the services again. The stop is required. A service that survives a recreate keeps a session that the recreate invalidates. - ACME is already provisioned. This script runs the tenant stage only, so the system's first administrator and the system tenant's data must exist.
The tenant details are passed explicitly. The shell sends what it is given. The browser's form is prefilled from the profile, and the shell is not. The values below match the profile's own prefill.
connect takes the endpoint from $ORES_NATS_URL. It inherits the subject
prefix and the TLS context that the shell was started with.
2.1. Which company the data is
The nine staff accounts, their addresses, phone numbers, cities and reporting
line come from the sample's Employees table. It is vendored under
projects/ores.seeder/datasets/northwind_traders/source/. The party countries
come from the countries that the sample's customers and suppliers trade from.
The company's own details are Northwind's. The sample states no registered
office, so the London office its London staff work from is the company's
address. Its LEI is synthetic: 9695NORTHWIND0000065. The LEI is checksum
valid on the test prefix that ACME uses, because a fictional company has no
entry in the public register.
The business units, portfolios and books are Northwind's own. The sample's food categories do not describe an ORE book. The books are named for what ORE's trade population writes into them.
The staff photographs are Northwind's own image templates. Each template is a
facestudio face under the code northwind_staff_photo:*. The attach_photos
step copies a template into the tenant and attaches it to the account.
2.2. Running it again
The tenant stage refuses a tenant code that it already holds. A second run against the same database therefore fails before it creates anything. Reset the database with the stop, recreate and start sequence above. Then provision ACME, and run this script again.
connect $ORES_NATS_URL login super_admin Secure-Password-123 provision tenant --tenant-code northwind --tenant-name "Northwind Traders" --tenant-hostname northwind --tenant-admin-email admin@northwind --tenant-admin-password Secure-Password-123 --profile northwind logout login tenant_admin@northwind Secure-Password-123 accounts set-default-party "Northwind Traders Ltd" logout exit
Run it from a connected shell, or load the generated script:
./ores.shell ${log_args} ${connect_args} << 'EOF'
<<northwind-traders-provision>>
EOF
3. Script
projects/ores.shell/scripts/library/provisioning/northwind_traders_provision.ores
is generated from this recipe's ores-shell block by compass build --direct
tangle_shell_scripts. Do not edit the .ores by hand.
4. Tested by
Manual: compass shell -f northwind_traders_provision.ores against a freshly
recreated database with ACME present.
Proven on 2026-10-24 against brave_hopper. The tenant run completed all eight
steps. Northwind Traders Ltd came out active under the synthetic LEI
9695NORTHWIND0000065. The party carried:
- 6 business units and 6 portfolios.
- 7 books.
- 9 staff accounts with their manager chain from the sample, each with a picture.
- 24 report definitions. Each one binds its conventions and the five configuration documents.
- 16 generated bonds.
The tenant's own run is the child run that the parent hands its work to. A caller that cannot read the parent's progress read sees a timeout, and the script stops while the tenant's setup continues. Reconnect and follow the child instance that the parent's step result names.
5. See also
- How do I provision the system with Acme Corporation (holding group)? is the first tenant.
- How do I provision the system with Barclays (GLEIF)? is the GLEIF variant.
projects/ores.seeder/datasets/northwind_traders/is the generator that writes the company's populate SQL.