Is there a way to create a true function?

What I mean here is a “flow-like thing” with inputs and outputs that I can call from multiple places AND that once I employ that function in several other flows, if I change the function itself, all the existing flows where it was used will call the changed function?

I have seen how I can create flow functions and trigger custom events, but these miss the mark I am searching for.

Here’s an example: I write some Javascript that only outputs console.log(“My JS”) and I copy it to 3 other flows. If I use the UI or CTL-C/CMD-C then I am making a copy of the original which is self-explanatory and fine. Any changes I want to make have to be made to all four versions as they are just copies disconnected from each other.

If I make this into a flow function (by adding another flow like a toast and selecting them both so the create Flow Function shows in the rightmost panel), I will be able to reuse this flow function, but if I use it in 3 different flows, and change the flow function (by going into isolation mode from one of the copies), I am only changing that one copy’s internals. The other 3, if I want the changes, need to be modified the same way as again, they are disconnected from each other. That is not what I want.

If I create the same console.log(“MyJS”) as an action and create an event in the Page Layout area, I can call that event from multiple flows. If I modify the event’s flow, all the other flows that call this event will get the new working of the event. Nice! However, I cannot pass in parameters, nor does the event allow for a return value or any return of control

So I would like to create a flow that, once created, will be callable multiple times from other flows, have parameters passed to it, and return a result, and any changes to this called will be automatically used by all the existing calling flows.

Now that is probably unclear and possibly unreasonable, but I find I need to change the called flow functions often and I use them in several places. My ability to know where they all are, and make identical changes is a problem and seems unintuitive, but I will do so if no other process like I tried to describe is available.

Thanks for reading this long-winded mess of an explanation.

I think you can do exactly what you’re wanting. Create a custom flow function containing all the logic you want to reuse in multiple places. Drag additional copies from the Logic / By Me section. If, later, you want to edit the logic in these blocks, open any of them, make your changes (in isolation mode), and then use the ADVANCED / Overwrite local template (see below) to make that change in all the other instances of this flow function.

If you forget to do this step, then you are only editing this one copy of the flow function, and then they are out of sync.

I’ve got a custom function I use all over the place, and I’ve done the described method and it works great.

1 Like

Hey @Marty_Flickinger ! Thank you for the note!

I have used that but I guess I didn’t check it out thoroughly. I took the wording “Overwrite local template” to mean the templates as it exists in the “By Me”, meaning all subsequent uses of this flow function would have the change. I am going to confirm that all existing copies get updated, but if that is your situation I am delighted, delighted! My worry is that changes to in and out would break but that makes sense anyway and would need to be re-linked wherever currently being used.

What an unfortunate way to name this feature! “Update All copies” would be more descriptive

Thanks again. I will report back.

Wowsa! It worked: 2 existing flows updated from a single flow’s isolation mode edit when I did Advanced > Overwrite local template!

I think I have some rewriting to do. It’s a big app already but it suddenly became more manageable.

Many thanks for the clarification, @Marty_Flickinger !