Server Startup

A simple sub-flow that triggers once when the server first starts-up. The trigger sends an empty payload but has the topic 'server-startup' and has a msg.startupDate property.

[{"id":"bd88a321.42776","type":"subflow","name":"On Startup","in":[],"out":[{"x":454,"y":160,"wires":[{"id":"dbe754fd.2418a8","port":0}]}]},{"id":"c61021cd.39efe","type":"inject","name":"On Startup","topic":"server-startup","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"x":148,"y":160,"z":"bd88a321.42776","wires":[["dbe754fd.2418a8"]]},{"id":"dbe754fd.2418a8","type":"function","name":"Save startup date","func":"msg.startupDate = msg.payload;\nmsg.payload = \"\";\nreturn msg;","outputs":1,"noerr":0,"x":318,"y":160,"z":"bd88a321.42776","wires":[[]]},{"id":"5ca75d76.a358a4","type":"subflow:bd88a321.42776","name":"","x":261,"y":141,"z":"ba13aa9d.45ec58","wires":[["acf315a4.530ce8"]]}]
dhartveld

Flow Info

created 2 years, 4 months ago

Node Types

Core
  • function (x1)
  • inject (x1)
Other
  • subflow (x1)
  • subflow:bd88a321.42776 (x1)

Tags

  • lifecycle
  • startup
  • init
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option