ocelkitDocs

Get started

Quickstart

Install ocelkit, point it at your data, and open your first map.

In this quickstart, you'll map how the customers of an online shop pay for their orders. You'll install ocelkit, download a public sample of the shop's events, and describe the process in one short file.

You need Node.js 24.

Install ocelkit

In your project's folder, add ocelkit as a dev dependency:

Install
$ npm install -D ocelkit

Download a sample log

ocelkit reads event logs in the OCEL 2.0 format, saved as SQLite. The Order Management log is a public sample of an online shop, with 2,000 orders and everything that happened to them. Save it in a data folder:

Terminal
$ mkdir data$ curl -L -o data/orders.sqlite https://zenodo.org/api/records/8337464/files/order-management.sqlite/content

Add a config file

Create ocelkit.config.ts at the root of your project. It tells ocelkit where the log is and where your process files go:

ocelkit.config.ts
import { defineConfig } from 'ocelkit'export default defineConfig({  data: './data/orders.sqlite',  processes: './processes',})

Both paths are relative to the config file. Run ocelkit from the folder it's in.

Describe a process

Create processes/payments.ts. It names three events of an order and the order you expect them in: a customer pays once their order is confirmed, or after a payment reminder.

processes/payments.ts
import { defineProcess } from 'ocelkit'export default defineProcess({  name: 'Order payments',  activities: {    confirmOrder: 'confirm order',    paymentReminder: 'payment reminder',    payOrder: 'pay order',  },  flows: {    orders: [      ['confirmOrder', 'payOrder'],      ['confirmOrder', 'paymentReminder'],      ['paymentReminder', 'payOrder'],    ],  },})

Every .ts file in the processes folder is one process.

Open the map

Start the workspace:

Terminal
$ npx ocelkit dev

The map opens in your browser, at http://localhost:4747. All 2,000 orders were confirmed. 1,557 of them went straight to payment, and the other 443 got a reminder first.

Leave it running. The map redraws each time you save the file.

Check your file

In a second terminal, run the check:

Terminal
$ npx ocelkit check

It compares every name in your file with the log:

Output
processes/payments.ts  no problems0 errors, 0 warnings

Now make a mistake on purpose. In payments.ts, change 'pay order' to 'pay ordr', save, and run the check again:

Output
processes/payments.ts  error  activities.payOrder  "pay ordr" is not an event type in the data. Closest: "pay order".1 error, 0 warnings

The check exits with code 1 when a file has an error, so it can fail a CI job or tell your agent to try again. Change the name back before you go on.