Support custom expression extensions, e.g. Array.magicFunc()

Describe the feature

I have some complex numerical computations which I’d like to do on arrays, inside expressions. I have a custom npm module with my code.

I could do this with a code node, but a neat option, if there’s a way to do it, would be to patch into the extensions framework like:

packages/workflow/src/Extensions/ArrayExtensions.ts

And they are bound in:

packages/workflow/src/Extensions/ExpressionExtension.ts

There’s no external extension hook AFAICT, and but that would be really neat to be able to add some domain specific functions here to my instance; other generic ideas/examples:

  • Unit conversions $json.speed.convert("ms", "kph")
  • Itertools like functions (takeWhile, pairwise, etc.)

Is this something people want and the core team would support?

Information on your n8n setup

  • n8n version: stable
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Docker