Showing everyone how the process works
Pick another answerDiagrams that match what runs
Flowcharts in wikis and slide decks go stale almost immediately, leaving engineers as the only people who know what happens when an approval times out. Trestle draws the diagram straight from the code, so everyone reviews the real process.
The code, 27 lines
const value = await act({
name: 'Appraise the claim',
body: () => surveyor.appraise(policy),
});
const isOver = await choice({
name: 'Over the appraisal?',
condition: amount > value,
});
if (isOver) {
const review = await wait({
name: 'Adjuster approves',
party: adjuster,
window: '3 days',
});
const isApproved = await choice({
name: 'Approved?',
condition: review.isAnswered && review.answer === true,
});
if (!isApproved) {
return 'refused';
}
}
await act({
name: 'Pay the claim',
body: ({ actKey }) => bank.pay(amount, actKey),
});
return 'paid';The claim, drawn
From the start, appraise the claim, then ask whether it is over the appraisal. Yes leads to the adjuster, who has 3 days to approve it; answered or not, the next question is whether it is approved: yes leads to paying the claim, no ends refused. A claim not over the appraisal goes straight to paying it, which ends paid. Appraising and paying each end failed if they fail.
no3 days, no answernofailsfailsyesansweredyesThe claim, drawn
From the start, appraise the claim, then ask whether it is over the appraisal. Yes leads to the adjuster, who has 3 days to approve it; answered or not, the next question is whether it is approved: yes leads to paying the claim, no ends refused. A claim not over the appraisal goes straight to paying it, which ends paid. Appraising and paying each end failed if they fail.
no3 days,no answernofailsfailsyesansweredyesHow the diagram stays current
Nobody maintains the chart by hand. Trestle produces the exact same diagram directly from the code without executing any steps, and each box links straight to its source line.
Every branch and who owns it
Every decision appears with all of its outcomes, including failures and timeouts, and each step names whether a person, team, system, or AI agent owns it. If code branches in a way the diagram cannot show, Trestle warns the author.
Where real runs stand right now
Open any active run to see where it is waiting and how it got there, or look across runs to spot where overdue approvals are backing up. Groups of steps fold and open in place so large processes stay readable.
What changed and what never ran
Compare two versions of a process to see what a change moved, or check run history to find branches no run has ever reached. You can export the diagram as text, structured data, or a Mermaid flowchart.
What Trestle does not do
- The diagram is read-only, with no drag-and-drop editor for building processes visually.
- There is no BPMN import or export, because Trestle reads your code directly instead of keeping a separate diagram file.
- Someone still writes the code for the process, though a coding agent can handle that while everyone else reviews the diagram.
- Static drawing can miss a condition that depends on two things at once, which Trestle catches if a live run steps off the map.
Your visit is running on Trestle.
This is the real Trestle engine running a live process in your browser tab, not a simulation. Each of the eight topic pages you open answers its question once, showing the path you have taken and the pages you have not opened yet—until you copy npm create @trestlerun to finish it.
Your path so far
npm create @trestlerunYou have opened all eight pages. Copy npm create @trestlerun whenever you are ready to finish the process.
You copied npm create @trestlerun, so this process has finished and recorded your full visit.
Show the code and detailsHide the code and details
export const visit = process({
name: 'visit',
body: async () => {
for (const _lap of Object.keys(CASES)) {
const next = await choice({
name: 'What do you care about?',
party: visitor,
cases: CASES,
});
if (next === START) {
return 'started a project';
}
}
return 'never started a project';
},
});export const visit = process({
name: 'visit',
body: async () => {
for (const _lap of Object.keys(
CASES,
)) {
const next = await choice({
name: 'What do you care about?',
party: visitor,
cases: CASES,
});
if (next === START) {
return 'started a project';
}
}
return 'never started a project';
},
});Your answers and the run are stored only in this browser.
npm create @trestlerun