# How to modify node-red deploy operation to save flow to database

**URL:** <https://discourse.nodered.org/t/how-to-modify-node-red-deploy-operation-to-save-flow-to-database/26568>\
**Category:** Core Development\
**Created:** [13 May 2020 05:37 UTC](https://discourse.nodered.org/t/how-to-modify-node-red-deploy-operation-to-save-flow-to-database/26568 "2020-05-13T05:37:31Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [13 May 2020 08:26 UTC](https://discourse.nodered.org/t/how-to-modify-node-red-deploy-operation-to-save-flow-to-database/26568/16 "2020-05-13T08:26:57Z")

</div>

Darshan, the function that is called when you press the deploy button lives in the **runtime** of node-red: this is **server code** , on nodejs. The code you have added to it uses jquery. Jquery is a framework for interacting with DOM structures in the **browser** , meaning it is **clientside code**.  
If you want to do this, start by learning the difference between clientside and serverside, and learn some nodejs basics. Next, figure out a way to call http apis from nodejs.

The error you’re seeing is the call to the flows endpoint returning with a server error, status code 500 if I had to guess. You’re seeing that one in your browser because it is the response to a browser-made call, an XMLHttpRequest also known as XHR. You should also see the full error on the console/log where you run node-red.  
The error you get “ReferenceError: is not defined” means that it has no clue what means so jquery is not available, which makes sense because you’re in the runtime. So it cannot make that call.

---

_[View the full topic](https://discourse.nodered.org/t/how-to-modify-node-red-deploy-operation-to-save-flow-to-database/26568)._
