Hi @kuema, thank you for breaking down those approaches so clearly. I'm like you in that I use both link calls and subflows, but I use them for different things. Bear in mind, I'm still learning.
Link-call approach
I started out using a single flow to contain all of my "function" link-calls: all of the logic that gets constantly reused. In my case, it's mostly things like data reformatting (link return) or iterating through elements/arrays (do this thing to all of these) that publish out MQTT instead of returning anything.
I also use link calls for querying states of various things. I handle global variables by storing the latest message for each topic in a large constant global.
One use for this approach is querying the state of all sensors within a group whenever any individual sensor triggers; this gets fed to a bayesian filter that judges if a room is occupied and responds yay or nay.
The link-call approach has served me well for these kinds of use-cases.
Subflow approach
Then I discovered subflows. I can't speak to intention, but from my perspective as a user, it seemed like subflows were an accessible way for people of my basic skill level to create reusable nodes.
A subflow, for example, turned out to be the best way to handle the data inputs of a security camera. All messages related to that camera go into a subflow, which judges what to do, and critically, responds on different outputs.
Is it a human? Do the stuff that should be done if it's a human, might be functions, might be link-calls, and then send the result out of output 1.
Is it a cat? Do cat stuff, send out of output 2.
Is it a dog? Do dog stuff, which is different to cat stuff, but also send out of output 2.
That's pretty versatile.
Since you mentioned error catching, I link strategic points within a subflow to a final output that I'll connect to a debug node outside the subflow. I don't know if that's optimal or not, but it's worked so far.
I use them for different things
Broadly, it's to do with number of outputs.
- I use link-calls for stuff that will do a lot of thinking and then return a single piece of data.
- I use sub-flows for things that will process data and then send it via multiple outputs; in practise very much like writing a custom node.