← All public flows
PublicFlow #38
Simple health endpoint for a Node-RED instance
Shared by Anonymous on 24 Aug 2026
16 views0 votes
About this flow
Adds a lightweight /health endpoint for a reverse proxy or uptime monitor. It returns status, Node-RED uptime and a timestamp without exposing flow context or environment variables.
Node-RED JSON
[{"id":"tab-health","type":"tab","label":"Health endpoint","disabled":false,"info":"Small JSON health check suitable for an uptime monitor."},{"id":"http-health","type":"http in","z":"tab-health","name":"GET /health","url":"/health","method":"get","upload":false,"swaggerDoc":"","x":150,"y":100,"wires":[["fn-health"]]},{"id":"fn-health","type":"function","z":"tab-health","name":"Build safe status","func":"msg.statusCode = 200;\nmsg.headers = { 'content-type': 'application/json', 'cache-control': 'no-store' };\nmsg.payload = {\n status: 'ok',\n uptimeSeconds: Math.floor(process.uptime()),\n checkedAt: new Date().toISOString()\n};\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":100,"wires":[["reply-health","debug-health"]]},{"id":"reply-health","type":"http response","z":"tab-health","name":"Return JSON","statusCode":"","headers":[],"x":650,"y":80,"wires":[]},{"id":"debug-health","type":"debug","z":"tab-health","name":"Health requests","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":660,"y":140,"wires":[]}]Visual preview
Drag to pan · Scroll to zoom