Goal Merge the four flows to know whether each line is ordered, confirmed or delivered, and be alerted when a confirmed date passes without delivery.
A manufacturer and its logistics partner exchange four flat files around one order line: the order, the acknowledgement, the confirmed date, the delivery note. Sales administration asks, line by line:
kind: Entityname: order_line_cycle_blabel: Cycle d'une ligne de commandedescription: "One order line across the four flows: ordered, acknowledged, confirmed, delivered — the stage is the most advanced flow that names the line."match: [line_id]scopes: [logistics-b]columns:line_id: { label: "Ligne" }order_no: { label: "Commande" }customer_name: { label: "Client" }article: { label: "Article", prefer: t_scenario_cycle_cc_b }ordered_qty: { label: "Commandé" }confirmed_date: { label: "Livraison confirmée" }delivered_qty: { label: "Livré" }bl_no: { label: "Bon de livraison" }stage: { label: "Étape", conflicts: false } # the flows progress, they do not disagreesources: # the order is the priority: the furthest flow names the stage-table: t_scenario_cycle_bl_bmap: { line_id: line_id, article: article, delivered_qty: delivered_qty, bl_no: bl_no, stage: stage }-table: t_scenario_cycle_c1_bmap: { line_id: line_id, article: article, confirmed_date: confirmed_date, stage: stage }-table: t_scenario_cycle_cc_bmap: { line_id: line_id, order_no: order_no, customer_name: customer_name, article: article,ordered_qty: ordered_qty, stage: stage }joins:-table: t_scenario_cycle_ca_b # the acknowledgement is per order, not per linefrom: order_noto: order_nomap: { po: acknowledged_po }
apiVersion: apps.lumnik.io/v1kind: Workflowmetadata:name: order-line-cycle-bspec:scope: logistics-bprovenance: declaredon:table: connector.v_order_line_cycle_b # the fused view: the stage only exists therecolumn: stagekey: line_id # one document per order linestates: - { code: ORDERED, label: "Commandée", initial: true } - { code: CONFIRMED, label: "Date confirmée" } - { code: DELIVERED, label: "Livrée", terminal: true }due: # the deadline is a date the data carries, not a first sightingcolumn: confirmed_datestates: [CONFIRMED]zone: Europe/Paris # a date-only column: due at the end of that day in Parismessage: "Ligne {doc_key}: livraison confirmée pour le {due}, toujours pas livrée"
$ lm inbox --type decision.overdue.order-line-cycle-fID WHEN PROCESS MESSAGE ENTITY_KEY
20367 just now workflow:order-line-cycle-f Ligne 6880012: livraison confirmée pour le 2026-10-22, toujours pas livrée 6880012
decision.overdue.order-line-cycle-f
Ligne 6880012: livraison confirmée pour le 2026-10-22, toujours pas livrée
no alert
6880011 (delivered, same date), 6880021 (no confirmed date)