🔄 Reverse to better reign
on September 7, 2025
For nearly ten years, a conceptual blockage held back my experiments: how to properly manage the order of execution in a visual workflow? The answer eventually emerged in a simple but decisive form: invert the blocks to better reign. This blockage, experienced in my work with Uniflow, pushed me to explore numerous concepts from Flow-Based Programming to Lambda Calculus, including monads and Wave Function Collapse. All these detours finally converged on a clear solution: once a block is executed, it must remain immutable.
⏱️ The problem with Canvas and Function blocks
In Uniflow, each step of a workflow is represented by a block. Some are very operational, others more abstract. Two of them crystallized my blockage: * the Canvas block, which instantiates a drawing surface; * the Function block, which manipulates data. For a long time, I executed the Canvas before the Function. As a result, the function could return to modify a state already written in the Canvas. It was as if a reader came across the conclusion of a book before even having read the development, or worse, as if an author could rewrite a page already published. This mode of execution violated a fundamental principle: immutability. In a pipeline, each step must produce data that can no longer be altered, but only used in the following steps.
🧠 The solution: inversion and immutability
The fix consisted of reversing the order: first the Function, then the Canvas. Thus: * the function defines and passes the Canvas variable as input to the Canvas block, * the Canvas block executes its role from its own context, at the precise moment it is called, * and above all, once the Canvas is executed, it can no longer be rewritten. This reversal restores a clear logic, comparable to reading a text: from top to bottom, each line is added to the previous one, but none of them changes what has already been written.
💡 Why this changes everything
This simple reversal unlocks three essential dimensions: * Immutability: each block remains fixed once executed, which guarantees the consistency of the flow. * Conciseness: thanks to functional programming and currying, each pipe can pop the data produced by the previous ones, without ever rewriting the history. * Clarity: the pipeline becomes readable and predictable, each step naturally feeding the next. With this framework, Uniflow no longer manipulates fragile states, but stable and reproducible flows.
⏱️ Concepts explored along the way
To overcome this blockage, I had to dive into several concepts that, each in their own way, allowed me to build a broader understanding: * Railway Flow-Based Programming: thinking of pipes as rails where packets of information circulate. * Monads: guaranteeing the reproducibility of input and output types. * Y Combinator: introducing recursion into a language that doesn't have it natively. * Lambda Calculus: theoretical framework for expressing functions and their composition. * Chunk computing: cutting a calculation or an image into pieces, to then reconstitute the whole. * Wave Function Collapse: exploring all possible states and gradually reducing them by constraints. * Lambda Interpreter in PHP: experimenting with a minimal functional language to directly manipulate lambdas. * Flow: the culmination, combining visual orchestration, functional programming and asynchronous execution.
💫 Conclusion
“Invert and conquer” isn’t just a technical trick, but the resolution of a long-standing blockage: accepting that immutability is key. By reversing the order of block execution, Uniflow gains a consistency that makes it more like reading and writing text: each step builds on the previous one without ever rewriting it. This journey, fueled by years of exploring various concepts, has paved the way for more robust, concise, and powerful workflows.
🎁 I offer free 30-minute coaching sessions to help creators like you automate their processes and save time ⏱️
👉 Book your free session here: https://www.bonzai.pro/matyo91/lp/4471/je-taide-a-automatiser-tes-process
⚡Thank you for reading! Let's create smart, fast, and automated workflows together