Migrate to new Gitea instance (gitea.wbd-rd.nl)
- Update all submodule URLs from gitea.centraal.wbd-rd.nl to gitea.wbd-rd.nl - Add settler as proper submodule in .gitmodules - Add agent skills, function anchors, decisions, and improvements - Add Docker configuration and scripts - Add manuals and third_party docs - Update .gitignore with secrets and build artifacts - Remove stale .tgz build artifact Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
31
manuals/node-red/runtime-node-js.md
Normal file
31
manuals/node-red/runtime-node-js.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Node-RED Runtime Node JS Manual (EVOLV Summary)
|
||||
|
||||
Based on: https://nodered.org/docs/creating-nodes/node-js
|
||||
|
||||
## Input Handler Contract
|
||||
|
||||
- Node-RED calls runtime handlers as `function(msg, send, done)`.
|
||||
- For compatibility, custom nodes should support fallback behavior when `send` is not provided.
|
||||
- Use `done()` on successful completion and `done(err)` on failure.
|
||||
|
||||
## Output Routing Rules
|
||||
|
||||
- For single-output nodes: `send(msg)` sends on output 1.
|
||||
- For multi-output nodes: pass an array with one slot per output, for example:
|
||||
- `[msg, null, null]` => output 1 only
|
||||
- `[null, msg, null]` => output 2 only
|
||||
- Always construct the outbound message first, then send it.
|
||||
|
||||
## EVOLV Runtime Pattern
|
||||
|
||||
Recommended runtime input structure for `src/nodeClass.js`:
|
||||
|
||||
1. Normalize `send` fallback.
|
||||
2. Wrap `switch(msg.topic)` in `try/catch`.
|
||||
3. Route response messages to explicit output index with array format.
|
||||
4. Call `done()`/`done(err)` consistently.
|
||||
|
||||
## Common Failure Mode
|
||||
|
||||
- Sending a bare object in a multi-output context can hide intended port routing.
|
||||
- In EVOLV nodes with 3 outputs (`process`, `dbase`, `parent`), use explicit arrays for deterministic wiring behavior.
|
||||
Reference in New Issue
Block a user