In late 2024 I built a small flowchart editor with React Flow. I wanted to see whether people could program directly on a diagram. I looked at sequence diagrams and other UML diagrams and ultimately found flowcharts the easiest place to start. Follow the arrows and you can see what happens first and which way a condition sends you. That was something I wanted to borrow for my workflow engine.1
Many workflow canvases I encountered also had boxes and arrows, yet every time I changed tools I had to learn how to read the lines again. Sometimes even after connecting the boxes I had to open several panels to find out what the program would do next. Reinventing the wheel can be valuable. My first question is what the new notation expresses that the old one could not. Steps, branches, and loops already have familiar symbols. Reusing them lets readers focus on the problem at hand.
What does an arrow back to the same node mean?
I once searched for reactflow self edge and found a GitHub discussion. Someone had connected a node’s output back to its input, but the line ran underneath the node. They asked, “Is there any way to have the connection go around the node?” The question was about drawing the line. When a canvas can execute, the same loop poses a different question: what should the engine do when it follows the line back?2
Example retry flow. The limit of three includes the first attempt.
Consider a self-loop on a request node. For a retry, the next attempt uses the same input and runs only if the error is retryable and attempts remain. If each trip around the loop advances to the next item in a list, it is iteration. If each trip calculates a new value from the previous output, we also need an initial value and a stopping condition. All three fit the same circle but execute differently. Labeling the edge “retryable and fewer than three attempts” makes the return condition visible. The delay and the precise list of retryable errors can live in settings.
Sequence diagrams also have arrows that return to their starting point. A self message goes to a participant on the same lifeline, as when an object calls one of its own methods. A loop fragment can mark the scope and condition for a repeated message. On a flowchart, a back edge takes the reader straight to an earlier step. These notations answer different questions: who interacts with whom, and where do we go after this step?3
Does the line carry data or schedule the next step?
A React Flow edge records its endpoints with source and target and can identify specific handles when needed. I used these components in my standalone prototype to make circular nodes, diamonds, and arrows. Connecting two endpoints gets a line onto the canvas. The editor still has to give that line a meaning its users can read.14
In one version of PuppyFlow, the workflow JSON uses blocks for data and edges for operations and their inputs and outputs. An LLM call, a text chunking step, or code execution can all appear in edges. The backend finds edges with available inputs and runs their operations. That representation can express “chunk this document into fragments, then vectorize the fragments.” To see which decision selected a path, I find the familiar flowchart diamond with labeled exits helpful. The engine can still use its own structures for execution.56
There is a good reason to add another layer to the canvas when readers need to understand how data connects. Suppose an LLM node needs both a user question and retrieval results. Two ordinary arrows show only that there are two inputs. Connect them to ports labeled “Question” and “Reference material” and you can see which parameter receives each value. The ports explain data flow while branches can retain ordinary flowchart semantics.4
| What should I be able to read from the canvas? | A readable representation |
|---|---|
| Where data comes from and where it goes | Name the ports to show whether they carry a document, fragments, or vectors. |
| Which step runs first and what changes its destination | Draw operations and decisions as nodes and put conditions on exits. |
| Where a particular execution went | Highlight the branch actually taken and show the cause beside a failed step. |
Drawing two-way and multiway branches
Take a batch asset import. We can use the symbols in Lucid’s flowchart tutorial: rounded boxes for start and end, parallelograms for input and output, rectangles for operations, and diamonds for decisions. “All required fields present?” is an if/else, with exits labeled “Yes” and “No.” When an arrow returns to “More rows to process?”, the next iteration reads the next row.6
A possible batch import design. Only records with missing fields go to manual review. Other queued records keep moving.6
The diagram also uses visual grouping, a familiar idea from UI design. All three decisions are pale yellow diamonds. At a glance you can find where the flow branches, then read each question and its exit labels. Shape and color identify a class of node, while spacing can group nodes of different kinds. The “Output import summary” and “End” nodes in the upper right have different shapes, but they sit together and apart from the row-processing section. It is easy to see that both belong to the finish.
After a run I want to click “Send for manual review” and see which record lacked which field. Clicking “Record write error” should let me trace why the creation request failed. To check the frontend request and when the backend committed the transaction, compare the sequence diagram for creating an asset.
If different asset types require different fields, label one diamond “Asset type” and its exits “Computer,” “Monitor,” and “Other.” This is a switch/case: each case tests the same field. “Other” is the default for unmatched values. In this example, missing and unrecognized types both go to manual review.
Routing by asset type. The two equality conditions are mutually exclusive, so each row takes just one exit.
If an editor lets you write independent conditions for each exit, one record may match several. Readers need to know whether the engine takes only the first match in order or all matching exits. The n8n Switch node, for example, provides separate settings for this rule and for what happens when nothing matches.7
I test an editor with a small workflow that has a branch or a loop. Before running it, I trace the lines and say what happens next, what data it uses, and where failure goes. Then I compare that account with the engine’s actual path. A readable canvas makes the two accounts agree.
Footnotes
-
CaiBorui. (2025, January 2–5). reactflowtest/vite-project [React Flow 原型,本地 Git 仓库]。自定义连线见
91bafaf,菱形节点见5be1d44。关于 2024 年 12 月 30 日的流程图编辑器对话,见当时的 Vite 开发笔记。 ↩ ↩2 -
DovahBrownies. (2021, March 18). Circular Connection (Loop back) to same element? [Issue #1014,正文末句]. GitHub. 原讨论。Firefox 于 2024 年 12 月 30 日访问,时间见自定义边一文的来源记录。 ↩
-
Visual Paradigm. (n.d.). What is Sequence Diagram? Visual Paradigm. Self Message,Sequence Fragments(
loop)。Firefox 于 2024 年 12 月 30 日访问。 ↩ -
PuppyAgent. (2025, January 2). PuppyAgent-Engine [本地 Git 快照
5d8c4527]。前端见PuppyFlow/app/components/hooks/useWholeWorkflowJsonConstructUtils.ts的工作流 JSON 构造,后端见PuppyEngine/Server/WorkFlow.py的process_all和_execute_batch。条件出口的画布交互可参考边与配置菜单。 ↩ -
Lucid. (2026, November 17). What is a flowchart? Lucid. Flowchart symbols。日期为现页标注的更新日期。Firefox 于 2024 年 12 月 30 日访问 Lucidchart 旧地址,旧地址现在跳转到这个版本。 ↩ ↩2 ↩3
-
n8n. (n.d.). Switch. n8n Docs. Rule options,见 Fallback Output 与 Send data to all matching outputs。 ↩