Given that we already have a plain HTTP Request node and many possible nodes are just plain “Make an HTTP GET/POST request to an endpoint”, what if there was a way to make a “Template Node” which users could make in order to make custom nodes.
Example: the current discord webhook node does not allow the usage of Embeds or modifying the author’s name. What if I could take an HTTP Request Node, add in the JSON body for the payload, and then use that request as a “saved template node” for future requests. This way if people wanted to work with obscure APIs they could make template nodes to save alot of time and effort.
I’ve always been a fan of templates/code reuse and this sounds like another version of that so…!
While it is not a built in “feature” of n8n, you could do something similar to this by creating a flow with just a single node that you want to become your “template”. You can then configure the node and then download it as JSON.
Now, whenever you wanted to use that “template”, all you would have to do is copy and paste the JSON into the webUI and it would pre-build your node. Simply tweak and enjoy!
That is a really nifty way to do this. It does remind me of a similar issue which I think is probably the proper modification.
When creating workflows, there is no way to specify start node inputs. If I make a sub-workflow whose job is to post whatever is in parameterName=message to discord, I have to guess that the parent workflow has provided that parameter to me.
What if the start node for a workflow had a “providesInputs” parameter which could be used to define “these are the inputs for the workflow”. I think that may also solve this issue in a clean manner.
Probably for more clarity, adding a menu like appears in “set” to the “Start” node
While that would possibly have similar execution, it wouldn’t easily document what the inputs of the workflow are. If multiple people are modifying these workflows that would get confusing. The way I see it is “functionalizing” the workflows with defined input parameters so you could essentially “call” a sub-workflow like a function where you know exactly what it should take as an input.
Say I make a workflow that goes to my inventory system and grabs the owner of an IP Address, I could make a workflow called “grab_owner” with parameter “ip_address” which I can define when using the “workflow” node. This way the person who uses my “grab_owner” workflow would explicitly know what parameters my workflow expects instead of having to find my workflow and deduce the correct parameters.
It could be that I am misunderstanding how other people have used the “workflow” node, but if that is the case then an example of using a “workflow” node with expected inputs would be greatly appreciated
So agree that some kind of easier and better way should exist and it will be created in the future. The Set-Node is for sure a good work-around for now but not a permanent and good solution also for the reasons you did give.
About Template-Nodes. What is planned in the future is to allow people to fuse a node-network into a single node on which then the needed inputs and parameters can be exposed. For the users it would look almost identical to a regular node but underneath the hood will not be regular-code, like under every normal node, it will be a kind of sub-workflow. This “fused-nodes” are then supposed to be easily shareable with and so reusable by other people in the community .
Okay, so it sounds like what I think the current use case of the “workflow” node is currently planned. This would be super useful as it would allow for the “functional” process as I’m thinking of it.
I think Tines offers a similar function here. Collections can be made by putting templates on top of base nodes.
E.g. to integrate with a specific API you just add request settings and placeholder values on top of the generic HTTP node - Action Templates | Tines
It would be cool if we could augment base nodes in n8n and then add those augmented nodes back into the node library/browser. A lighter weight version of creating a full node integration.
I’d really like to see the ability to save a node to a library for later use. Not sure if that’s what this feature request is about but it sounds similar.
Configure a node with data / setitngs
Save it to a templates library (could be kept in the same section as the other nodes under the existing Add Node (+) button, just under it’s own tab)
Add that node to another workflow
This way, I don’t have to go hunt through my workflows to find that node to copy / paste it - I can simply give it a name that I would remember and type it in when searching under the Add Nodes dialogue
Depending on your use-case, the n8n API allows you to build a rough “library.” You can create a template-holding workflow of a collection of nodes or all of your custom nodes. Using the API, you could generate either a replica workflow to carve away at, or you could programmatically filter for which nodes you want to import into a new or existing flow. One way to make this more functional is have that template workflow trigger via webhook and return the json: you can have a single node in your workspace for pinging the hook and copy and paste the appropriate JSON into your flow in the editor.
I think having the ability to save nodes in a library like this would be very helpful. Right now, I have a workflow with all of my “template nodes” but that is cumbersome having to navigate, copy the selected node(s) then paste them in a new workflow. Would be helpful if we could access those in a library