# What UJN is UJN (UI Journey Notation) is a draft notation for UI journeys: you write one text file, and the module turns it into a drawing, a list of checks and a model for tools. ## The problem UI journeys are usually drawn as boxes and arrows, which show the happy path. The rest ends up in notes, where no tool can check it: the trips out of the app to the inbox or the bank app and the ways back, the unhappy paths, and what is built or only planned. ## One file, three outputs A journey file runs from `@startujn` to `@endujn` and holds one journey: the journey line, then the nodes and the arrows between them, one statement per line (section 2). The module reads it once and gives you: - **A drawing**, as SVG or PNG (section 19). - **Warnings**, each with its line, in a box under the drawing (section 21). - **On request, a model:** a JSON file with every node and arrow and its meaning worked out, and the permanent ids that tests, code and other diagrams link to (section 20). This is the checkout from the home page: the user leaves for the bank app and comes back approved or declined, a refused card ends in failure, Pay later is planned and Bank transfer is legacy. ```ujn @startujn render { arrow_spacing: 24 } journey CHECKOUT "Checkout" description: "Pay by card and approve in the bank app. Pay later is planned." unique_id_friendly: checkout start from_cart { description: "From the cart" } view checkout { title: "Checkout"; description: "Address and card"; route: /checkout } action authorize { title: "Authorize payment"; description: "Asks the card issuer" } handoff bank_app { title: "Bank app"; description: "Approve the payment"; channel: bank app; timeout: 5 min } view confirmed { title: "Order confirmed" route: /orders/:id trace: [req:PAY-04, test:e2e/checkout.spec.ts] unique_id: bd51a9c2824 ' AUTO GENERATED - DO NOT CHANGE } end paid { type: success; description: "Order paid" } system psp { type: external; title: "Payment provider"; host: api.pay.example } end refused { type: failure; description: "Card refused" } view pay_later { title: "Pay later"; description: "Invoice in 30 days"; route: /checkout/later; flags: [future] } view transfer { title: "Bank transfer"; description: "IBAN and reference"; route: /checkout/transfer; flags: [legacy] } from_cart --> checkout checkout --> authorize : [Pay] { payload: [card, amount] } authorize --> bank_app : approval needed bank_app ..> confirmed : [Approve] confirmed -down-> paid : [Done] authorize -up-> psp { payload: [card, amount] } psp ..> authorize { payload: [result] } authorize -down-x-> refused : card refused bank_app .x.> checkout : [Decline] ' back to try another card checkout -down-> pay_later : [Pay later] { flags: [future] } checkout -up-> transfer : [Bank transfer] @endujn ``` ## How it differs - **A flowchart:** process boxes, decision diamonds and lines, so a screen and a system step are often the same box, told apart only by a convention the team agrees on. UJN's nine kinds of node and four kinds of arrow each have one meaning, and the guard on an arrow takes the place of a diamond (13.4). - **A user flow** in Figma, FigJam or Miro: boxes and arrows on a canvas, with notes for what the boxes cannot say. In UJN the handoff, the failure paths, the flags and the payloads are part of the text, and the module checks the journey against its rules. - **A customer journey map:** a person's experience across stages and channels, often with goals and feelings. UJN is narrower: the screens and steps of one journey through your app. UJN replaces none of them; it adds a diagram type made for UI journeys. [The comparison on the home page](https://ujn.b2bedge.com/index.html#compare) draws the same checkout as a user flow, a Mermaid flowchart and a PlantUML activity diagram, and compares them part by part. ## Where it runs today As a PlantUML extension, in a local build that is not public yet: there is no build to install. A Mermaid extension is planned. ## What the checks cannot catch The checks catch broken structure, not wrong intent. A journey with 0 warnings can still be the wrong journey: a screen your app does not have, a guard that names the wrong condition, a path the file leaves out. Nor does the module check that trace links resolve or that a unique id was never changed (7.5, 21). Read each journey with the people who know the product.