# Resolved : How does the Complete node work?

**URL:** <https://discourse.nodered.org/t/resolved-how-does-the-complete-node-work/67906>\
**Category:** Developing Nodes\
**Created:** [19 September 2022 05:05 UTC](https://discourse.nodered.org/t/resolved-how-does-the-complete-node-work/67906 "2022-09-19T05:05:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phoddie](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/phoddie/32/64232_2.png) [@phoddie](https://discourse.nodered.org/u/phoddie)\
**Post date:** [19 September 2022 05:05 UTC](https://discourse.nodered.org/t/resolved-how-does-the-complete-node-work/67906/1 "2022-09-19T05:05:25Z")

</div>

This is a follow-up to my [previous post](https://discourse.nodered.org/t/how-does-the-complete-node-work/64733/5) with this same subject ("How does the Complete node work?"). The original has been closed because I took a little too long to follow-up.

The news is all good. I now have a working implementation of the `Complete` node in Node-RED MCU Edition. That work led to a rewrite of the `Catch` node. The behaviors of `Complete` and `Catch` match the full Node-RED as best as I can tell. They support `done()`, `node.done()`, and `node.error()` in a compatible way with the full Node-RED.

The runtime overhead of `done()` was reasonably high in the initial implementation because a `done()` function closure was created for each message delivered to each node. I think this is similar to what full Node-RED does. The second implementation uses the `nodered2mcu` preprocessor to determine which nodes need a closure for `done()`. For nodes not referenced by a `Complete` or `Catch` node the `done` function can be an empty function with no closure, which reduces the runtime overhead considerably for many flows. (Details of this are explained in the [Implementation Notes](https://github.com/phoddie/node-red-mcu#complete-and-catch-nodes) section of the Node-RED MCU Edition `read me`.)

FWIW – the way I finally understood how `done()` works with `Complete` and `Catch` nodes was to read the source code of built-in nodes that use call `done()` including `sort`, `delay`, and `trigger`. It was helpful to think of `Complete` and `Catch` as outputs of the nodes included in their scope. A node's output has wires to indicate where to send messages, whereas the `Complete` and `Catch` nodes use their scope to indicate from where to receive messages.

---

<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:** [18 November 2022 05:05 UTC](https://discourse.nodered.org/t/resolved-how-does-the-complete-node-work/67906/2 "2022-11-18T05:05:41Z")

</div>

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