What is the best way to trigger an (application/experience) workflow from another workflow and have it return data

I am making modular workflows, basically like functional programming, so I can trigger one workflow from another, so we don’t duplicate functionality. Currently I am using the Workflow output node, combined with the Virtual Button Trigger node for that. This works like a charm for event driven architecture, if you want to send data to another node, and let it process that data. But as far as I can see, there is no way to return data from the other workflow, for instance for looking up data, and use the result in the calling workflow. Like one workflow triggering a second workflow, which returns data, analogous to one function calling another function that returns data. Is anything like this possible in Losant?

I already found the solution, it’s building a custom node. Custom nodes basically allow you to squash a workflow into a single node, with inputs and outputs. It works nicely!

Yup, for modularity custom nodes is exactly what you are looking for. As you discovered, the Workflow Output Node triggers a whole new workflow run (a new payload is queued with its own 60-second timeout independent of the flow that invoked it) and it does not return a result to the calling workflow. It serves much different use cases than yours.

Glad you found the solution. Let us know if you have any questions about custom nodes.