# Extending JSONata with my own functions

**URL:** <https://discourse.nodered.org/t/extending-jsonata-with-my-own-functions/99873>\
**Category:** General\
**Tags:** jsonata\
**Created:** [5 December 2025 15:55 UTC](https://discourse.nodered.org/t/extending-jsonata-with-my-own-functions/99873 "2025-12-05T15:55:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubnemo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dubnemo/32/38759_2.png) [@dubnemo](https://discourse.nodered.org/u/dubnemo)\
**Post date:** [5 December 2025 15:55 UTC](https://discourse.nodered.org/t/extending-jsonata-with-my-own-functions/99873/1 "2025-12-05T15:55:41Z")

</div>

Is there a way in Node-RED to register my own functions so they can be accessed within a JSONata transformation? Other tools like Mulesoft allow you to extend DataWeave by add a jar file containing public Java methods, and I am hoping to do the same with JSONata. There are a number date format, include JDEdwards 'Julian' date, that I would like to perform within the context of JSONata for readability, vs referencing a function node that sets flow context and referencing that via $flowContext.

I am reading this in the JSONata documentation but is not clear. It seems like the registerFunction is the approach, but it would be best to put this in perspective of Node-RED.

> **[Embedding and Extending JSONata · JSONata](https://docs.jsonata.org/embedding-extending)**
>
> \## API

Thoughts?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [5 December 2025 16:36 UTC](https://discourse.nodered.org/t/extending-jsonata-with-my-own-functions/99873/2 "2025-12-05T16:36:02Z")

</div>

I believe that the JSONata implementation in Node-RED is already extended and there is (currently anyway) no option for user extensions.

A possible work-around would be to use JSONata in a function node which I think is possible though I've not tried it myself.

---

<div class="post-metadata">

**Author:** ![AllanOricil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allanoricil/32/106911_2.png) [@AllanOricil](https://discourse.nodered.org/u/AllanOricil)\
**Post date:** [5 December 2025 20:39 UTC](https://discourse.nodered.org/t/extending-jsonata-with-my-own-functions/99873/3 "2025-12-05T20:39:43Z")

</div>

@dubnemo

create a client-side only plugin and do something like below

> <https://github.com/node-red/node-red/blob/master/packages%2Fnode_modules%2F%40node-red%2Futil%2Flib%2Futil.js#L705-L734>

`jsonata` seems to be in the global context. Open node-red editor in a browser and see if you can get a reference of `jsonata` using the browser's console. If you can, then you have to build your plugin and set jsonata as "external" in rollup/vite/webpack

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [5 March 2026 20:40 UTC](https://discourse.nodered.org/t/extending-jsonata-with-my-own-functions/99873/4 "2026-03-05T20:40:24Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
