The Trestle guide
Trestle runs business processes written as ordinary async TypeScript, durably, and draws each one as a graph of its choices. This guide shows how to write a process, run it and test it.
What a process is made of
A process is a function whose body calls a few statements. Each statement is saved before it starts, so a run picks up where it stopped after a crash, and each one is drawn as a node in the graph.
| Statement | What it does |
|---|---|
act | Does a piece of work, such as calling an API, and keeps its result. |
choice | Decides which way the process goes, drawing an edge for each answer. |
wait | Waits for a person to answer, for as long as its window allows. |
A process ends by returning the name of one of its ends, such as 'paid' or 'refused'.
Where to start
Start with your first process, then read how a process waits on a person and how to test a process.