# Perform action when flow is changed

**URL:** <https://discourse.nodered.org/t/perform-action-when-flow-is-changed/38324>\
**Category:** General\
**Created:** [31 December 2020 13:13 UTC](https://discourse.nodered.org/t/perform-action-when-flow-is-changed/38324 "2020-12-31T13:13:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![EcoMan](https://avatars.discourse-cdn.com/v4/letter/e/848f3c/32.png) [@EcoMan](https://discourse.nodered.org/u/EcoMan)\
**Post date:** [31 December 2020 13:13 UTC](https://discourse.nodered.org/t/perform-action-when-flow-is-changed/38324/1 "2020-12-31T13:13:47Z")

</div>

Hi,

I have a node-red instance running both on cloud and on-prem, running multiple flows.  
The on-prem is an emergency solution for a connectivity-loss event.

What I'm looking for is a way to have an event trigger once I deploy, sending only the changed flow as a json file.

So for example, I have flows x,y,z, each running tasks for a different edge "location". If I perform a change on flow x, I want only that flow to be exported to a JSON format and to trigger an event with that file (sending it to the client using that flow, for example).

Any ideas?

Thank you for your time.

---

<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:** [31 December 2020 13:18 UTC](https://discourse.nodered.org/t/perform-action-when-flow-is-changed/38324/2 "2020-12-31T13:18:30Z")

</div>

You could use the watch node to watch for changes to the flow file. Then use that event to trigger your action(s).

It is worth noting though that a save event may result in multiple filing system changes to a file. It is safest to delay a copy by a couple of seconds after a watch event fires.

---

<div class="post-metadata">

**Author:** ![EcoMan](https://avatars.discourse-cdn.com/v4/letter/e/848f3c/32.png) [@EcoMan](https://discourse.nodered.org/u/EcoMan)\
**Post date:** [31 December 2020 14:59 UTC](https://discourse.nodered.org/t/perform-action-when-flow-is-changed/38324/3 "2020-12-31T14:59:01Z")

</div>

@TotallyInformation that sounds like a good idea. thank you .  
Will try it out in the coming days and update if it worked.

---

<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:** [1 March 2021 14:59 UTC](https://discourse.nodered.org/t/perform-action-when-flow-is-changed/38324/4 "2021-03-01T14:59:11Z")

</div>

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