lumnik. / scenarios All scenarios · Français

An open freezer door and a silent sensor

Goal Be alerted when a freezer door stays open past one minute, with the laboratory and the owner.

Sensors publish freezer door states on Kafka. FZ-17 opens and goes quiet. FZ-18 opens and closes again.

freezers.csv
freezer_id,laboratory,room,contents,nominal_temperature_c,criticality,owner
FZ-17,Cryobiology Lab,Cryostorage A,Patient-derived cell lines,-70,critical,Dr. Lina Moreau
FZ-18,Analytical Chemistry Lab,Cold Room 2,Reference standards,-80,high,Marc Vidal
open-events.jsonl
{"event_id":"EV-17-OPEN","door_incident_id":"DOOR-17","freezer_id":"FZ-17","door_state":"OPEN","temperature_c":-67.4,"occurred_at":"2026-10-15T08:00:00Z"}
{"event_id":"EV-18-OPEN","door_incident_id":"DOOR-18","freezer_id":"FZ-18","door_state":"OPEN","temperature_c":-78.0,"occurred_at":"2026-10-15T08:00:05Z"}
manifests/30-enriched-door-event.yaml
kind: Entityname: ScenarioFreezerDoorEventFdescription: "A freezer-door sensor event enriched with the laboratory registry."match: [event_id]scopes: [cold-chain]columns:  event_id: { label: "Event" }  door_incident_id: { label: "Door incident" }  freezer_id: { label: "Freezer" }  door_state: { label: "Door state" }  temperature_c: { label: "Temperature (°C)" }  laboratory: { label: "Laboratory" }  room: { label: "Room" }  contents: { label: "Contents" }  criticality: { label: "Criticality" }  owner: { label: "Owner" }sources:  - table: t_scenario_freezer_events_f    map:      event_id: event_id      door_incident_id: door_incident_id      freezer_id: freezer_id      door_state: door_state      temperature_c: temperature_c      occurred_at: occurred_atjoins:  - table: t_scenario_freezer_registry_f    from: freezer_id    to: freezer_id    map:      laboratory: laboratory      room: room      contents: contents      nominal_temperature_c: nominal_temperature_c      criticality: criticality      owner: owner
manifests/40-door-workflow.yaml
apiVersion: apps.lumnik.io/v1kind: Workflowmetadata:  name: scenario-freezer-door-fspec:  scope: cold-chain  provenance: declared  on:    table: connector.v_scenariofreezerdooreventf    column: door_state    key: door_incident_id    order: occurred_at  dormancy:    after: 1m    message: "{freezer_id} ({laboratory}): door {state} since {since}. Owner: {owner}"    fields: [contents, criticality]  states:    - code: OPEN      label: "Open"      initial: true    - code: CLOSED      label: "Closed"      terminal: true
safe-close.jsonl
{"event_id":"EV-18-CLOSED","door_incident_id":"DOOR-18","freezer_id":"FZ-18","door_state":"CLOSED","temperature_c":-78.8,"occurred_at":"2026-10-15T08:00:25Z"}
$ lm observations list --workflow scenario-freezer-door-f
WORKFLOW                 DOC      STATE   SINCE             ALERTED
scenario-freezer-door-f  DOOR-17  OPEN    2026-10-28 16:52  2026-10-28 16:53
scenario-freezer-door-f  DOOR-18  CLOSED  2026-10-28 16:52  

$ lm inbox --process workflow:scenario-freezer-door-f
ID     WHEN      PROCESS                           MESSAGE                                                                      ENTITY_KEY
20093  just now  workflow:scenario-freezer-door-f  FZ-17 (Cryobiology Lab): door OPEN since 2026-10-28. Owner: Dr. Lina Moreau  DOOR-17
late-close.jsonl
{"event_id":"EV-17-CLOSED","door_incident_id":"DOOR-17","freezer_id":"FZ-17","door_state":"CLOSED","temperature_c":-69.1,"occurred_at":"2026-10-15T08:02:10Z"}

Limits

  • Workflow knows the last message received, not the door. A lasting OPEN may be a CLOSED lost before Kafka.
  • Dormancy counts from the message's arrival in lumnik, not from the sensor's occurred_at.
  • Demonstration: sweep every 5 seconds. Default: every 15 minutes. Business threshold: 1 minute, the minimum accepted.
  • Synthetic data.

Cold chain · laboratory

A freezer door stays open.

The sensor sends nothing more.

FZ-17 holds patient-derived cell lines.

Fictional laboratory · synthetic data

The problem

The information exists, in two systems.

  • Kafka receives the door state: FZ-17, OPEN.
  • A CSV file gives the laboratory, the contents and the owner.
  • Neither one reports a door left open.

Nothing is changed

The sensor, Kafka and the file stay in place.

  • The Kafka producer does not change.
  • The CSV file stays where it is.
  • No application to build.

What had to be written

dormancy:
  after: 1m

This line sets the delay: 1 minute.

The whole scenario fits in 4 declaration files, 83 lines.

What the team receives

The decision names the laboratory and the owner.

Decision inbox
FZ-17 (Cryobiology Lab): door OPEN since 2026-10-28. Owner: Dr. Lina Moreau

Real message, replay of 26 October 2026.

Who sees what

The scope bounds what is read.

scope: cold-chain
  • Every file declares the scope cold-chain.
  • Keycloak grants the role scope:cold-chain.
  • Other users see neither this data nor these decisions.

The limit

lumnik reports a silence, not an open door.

  • The last state received is OPEN.
  • The CLOSED message may have been lost before Kafka.
  • The decision says what lumnik observed.

Try it

The scenario replays end to end.

Kafka, CSV, entity, workflow: every step is published with its output.

This scenario needs lumnik Pro.

See the editions →