Your second post is exactly how you would make a custom coded node. It is pretty easy as you can tell as well 🙂
There are also a few other node types you can derive from too depending on the type of node you are after.
In your node posted above, if for example you change from PureFunctionNode, to CallableFunctionNode, the node will also have a Flow input and a Flow output as well.
Another completely different way for custom coded nodes, which can also be useful if you want to use your functions outside of FlowCanvas too, would be to create a static class like “Utilities” and create any number of static functions within it.
Then, open up the [Preferred Types Editor] and add your static “Utilities” class into the list.
You will now be able to access your Utilities static functions via reflection as normal, through the menu “Functions/Reflected/Utilities/…”.