When I click on deploy button in node-red I want JSON file to be saved in database

when I click on deploy button in node-red I want JSON file to be saved in database without calling an API. How can I modify deploy button functionality to save it directly?

You implement a storage plugin based on this API Storage API : Node-RED

"without calling an API" is a meaningless statement here, you will always need to call an API somewhere.

Explain in more detail the problem you are actually trying to solve here, as the context will be important.

Are you trying to use just the Node-RED editor without the runtime?

okay! I have embedded the node red and when hitting localhost:8080/red/flows I am able to view the JSON file created. I want to save this file to the sql DB so what ate the steps I will need to follow so I can save this file.

It's still not clear what you are actually doing, but as I've said if you want the flow stored in a database, then you have to write a storage plugin using the API I linked to in the first answer that connects to the database