Async Code and Modules
How to use await and promises in the Node-RED Function node, handle async errors, set a timeout, and load extra Node.js modules.
How to use await and promises in the Node-RED Function node, handle async errors, set a timeout, and load extra Node.js modules.
How to remember values between messages in a Node-RED Function node using node, flow, and global context, and how to use timers to delay, debounce, and cancel work.
Ready-to-use Node-RED Function node recipes for filtering, routing, counting, throttling, averaging, detecting changes, quiet hours, and building Home Assistant messages.
How to send messages from a Node-RED Function node, including multiple outputs, multiple messages, sending later with node.send, finishing with node.done, and how messages are copied.
The basics of the Node-RED Function node, including what it is, how to return a message, the editor tabs, the objects you can use, logging, status, and error handling.