Mark workflow as a custom node to be re-used in other workflows

My use case:

When creating more complex workflows, especially when using HTTP Request nodes very quickly you find yourself duplicating nodes (or groups of nodes) that do almost the same thing over and over again.

Example use cases:

  • Create a custom paginated HTTP request that uses predefined credentials, contains a base URL and accepts path parameter, then uses a Split Out node to return all items from all pages for a particular endpoint
  • Post Slack Update node that posts to a particular Slack channel using predefined credentials and already defines a complex message template using Block Kit, accepting only some fields that will be substituted
  • Many, many others…

These use cases could be solved by writing my own custom nodes using code, but that is not available on the Cloud offering plus it requires programming knowledge, so it kind of defeats the purpose of a low-code tool.

Any resources to support this?

My idea on how this should work is as follows:

  1. In Workflow settings, there should be a “Use as a function” option
  2. All workflows marked with that option should appear when adding a new node under a new section called “Custom functions”
  3. Add a new trigger called When called as a function that triggers when this workflow is called from another workflow. It should let you define a list of input fields that this function will accept
  4. When user adds a custom function node in their target workflow, this should result in a single custom node that’s similar to Execute Workflow node but already has the correct workflow selected and also accepts parameters that were defined in the When called as a function of that function workflow.

This I believe would make it really easy to re-use logic across workflows and cover many use cases people have when creating complex workflows.

Are you willing to work on this?

I’m definitely willing to test this feature when it’s in alpha/beta.

Workarounds

Currently I’m using Execute Workflow nodes to achieve the same effect, but it has several disadvantages:

  • It requires you to supply workflow id every time, which requires you to visit the workflow list, copy the URL and extract the workflow id every time you want to use it
  • It doesn’t accept any parameters, so in order to supply parameters I have to use an additional superficial Code node that just returns an object with the parameters I want to pass
  • There is no hint as to what parameters the sub-workflow accepts, so if I don’t remember their names I need to open that workflow and inspect it before I can use it

Prior art

I found at least two topics where people asked about a similar feature and I believe the described change would cover their use cases:

(I plan on writing up this properly but in a hurry)

I was looking for something along the lines of this as well except a little more simple, this person I think was asking what I was thinking

Basically having the main flow and multiple executable “functions” in that work flow using the Execute workflow trigger

As OP said there is a use case for having reusable “functions” that can be run and processed. Personally I’d like it within the main workflow and not another workflow (which is currently easy to do)

tldr: “Execute Workflow Trigger” node gets an ID to targeted with “Execute Workflow” node so multiple subworkflows within a main workflow can be run

I am the original author of the message that wgicio suggested and months on im still struggling to find a suitable solution. Multiple functions sounds ideal