My use case:
I would like to use the codeNodeEditor
for a community node property
and provide one or more imports and object instances to it.
An object instance of myInstance
including its typedef could be provided to the code editor and it could be used like the other provided $ instances and functions.
The node itself could use/execute the code snipped at any time:
Begin, PreConnect, PostConnect, ForEachItem … End
Basically to be able to use the code editor to provide custom-hooks
I think it would be beneficial to add this because:
Advanced configurations over short code snippets would be possible.
Any resources to support this?
All nodes that hold internally an object instance of some kind
or processing items.
A simple use case would be the WebhookNode. Some providers like monday
require an Endpoint verification. This requires currently a “complex” node setup to successfully respond to it. If the WebhookNode would have a property to add a code snippet for a (request) => null or response }
hook with return $request.hasHeader('X-Challenge') ? request.getHeader('X-Challenge') : null
Are you willing to work on this?
I am currently sill beginning with the n8n internals