Docs Studio guide Worked example

Worked example: "Northwind Robotics" (a CRM)

This mirrors the bundled CRM & Sales Pipeline template's shape (Company / Contact / Deal / Activity) but is written as literal build-it-yourself steps, so you actually practice schema design and linking rather than just clicking "use template." Using the template directly is a perfectly good shortcut once you've done this once — see the note at the end.

Scenario: you run sales for Northwind Robotics. You want to track the companies you sell to, the people you talk to at each one, the deals in flight, and the calls/emails/meetings behind each deal.

Step 1 — Collection

New collection → Blank → name it Northwind Sales.

Step 2 — Schema

Edit schema → create four types:

Company

FieldTypeNotes
Industrytext 
Websiteurl 

Contact

FieldTypeNotes
Titletext 
Emailemail 
Phonephone 

Deal

FieldTypeNotes
StageselectOptions: Prospecting, Qualified, Proposal, Negotiation, Closed Won, Closed Lost
ValuecurrencyUSD
CloseDatedate 

Activity

FieldTypeNotes
TypeselectOptions: Call, Email, Meeting
Datedate 
Notesrichtext 

Then add four Relationship Types so the link picker has clean labels instead of freehand text: WORKS_FOR (Contact → Company), FOR_COMPANY (Deal → Company), WITH_CONTACT (Deal → Contact), FOR_DEAL (Activity → Deal).

Step 3 — Files and rows

Create four files, one per type: companies, contacts, deals, activities.

In companies, add two rows:

In contacts, add two rows:

In deals, add two rows:

In activities, add a couple of rows per deal, e.g.:

Step 4 — Look at what you built

Step 5 — Share it

Open Explorer, find Northwind Sales, and grant a teammate Editor access so they can log activities without being able to change your schema.

Shortcut. Everything above is exactly what the bundled CRM & Sales Pipeline template gives you in one click (New collection → Templates → CRM & Sales Pipeline). Once you understand why it's shaped this way, the template is the fast path for the next one.

Appendix: raw KGL syntax

Everything above can also be edited as text, via the toolbar's Edit File button — the same content the grid renders, in the underlying .kgl format:

# companies.kgl

@Company Initech
Industry: Manufacturing
Website: https://initech.example
---
Mid-sized manufacturer evaluating a platform upgrade.
# contacts.kgl

@Contact Maria Lopez
Title: VP of Operations
Email: maria@initech.example
Phone: 555-0201
[WORKS_FOR] → companies.kgl#Initech
---
Economic buyer for the Initech deal.

A link line is [REL_TYPE] → target_file.kgl#Target Node Name. Everything below --- is the free-text body (Markdown). See the full KGL format reference for the complete spec.