Core nodes collection for Node-RED runtime providing fundamental building blocks for visual programming flows
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Common nodes provide essential flow control, debugging, and basic automation capabilities that form the foundation of most Node-RED flows.
Manual and scheduled message injection for triggering flows. Supports one-time manual triggers, interval-based scheduling, and cron-style timing.
/**
* Inject node for manual and scheduled message injection
* Registers as node type: "inject"
*/
function InjectNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.payload - Message payload to inject
// config.payloadType - Type of payload (str, num, bool, json, date, etc.)
// config.topic - Message topic
// config.repeat - Repeat interval in seconds
// config.crontab - Cron expression for scheduling
// config.once - Fire once on startup
}
// HTTP endpoint for remote triggering
// POST /inject/:id - Trigger specific inject nodeUsage Examples:
// Inject configuration for scheduled trigger
{
"id": "inject1",
"type": "inject",
"payload": "hello world",
"payloadType": "str",
"topic": "test",
"repeat": "5", // Every 5 seconds
"once": true // Fire on startup
}
// Inject with cron schedule
{
"id": "inject2",
"type": "inject",
"payload": "",
"payloadType": "date",
"crontab": "0 9 * * 1-5" // 9 AM, Monday-Friday
}Output messages to the debug sidebar and console for flow debugging and monitoring. Supports complete message display or specific property output.
/**
* Debug node for message output and monitoring
* Registers as node type: "debug"
*/
function DebugNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.console - Output to console (true/false)
// config.complete - Complete message or property name
// config.targetType - Type of target (msg, full)
// config.active - Debug active state
}
// HTTP endpoints for debug control
// POST /debug/:state - Control all debug nodes (true/false)
// POST /debug/:id/:state - Control specific debug node
// GET /debug/view/view.html - Debug viewer HTML interfaceTrigger when specified nodes complete their processing. Used for flow synchronization and completion detection.
/**
* Complete node for detecting node completion
* Registers as node type: "complete"
*/
function CompleteNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.scope - Array of node IDs to monitor
// config.uncaught - Monitor all uncaught completions
}Error handling for flows, catching errors from specified nodes or globally. Essential for robust flow design.
/**
* Catch node for error handling in flows
* Registers as node type: "catch"
*/
function CatchNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.scope - Array of node IDs to catch errors from
// config.uncaught - Catch all uncaught errors
}Usage Examples:
// Catch errors from specific nodes
{
"id": "catch1",
"type": "catch",
"scope": ["function1", "http-request1"],
"uncaught": false
}
// Global error catcher
{
"id": "catch-all",
"type": "catch",
"scope": [],
"uncaught": true
}React to node status changes, monitoring the operational state of other nodes in the flow.
/**
* Status node for monitoring node status changes
* Registers as node type: "status"
*/
function StatusNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.scope - Array of node IDs to monitor status from
}Create virtual connections between flows using link-in and link-out nodes. Enables flow organization and reusability.
/**
* Link In node - virtual input connection point
* Registers as node type: "link in"
*/
function LinkInNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.links - Array of link-out node IDs that connect to this
}
/**
* Link Out node - virtual output connection point
* Registers as node type: "link out"
*/
function LinkOutNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.links - Array of link-in node IDs to send to
// config.mode - "link" or "return" mode
}Usage Examples:
// Link out configuration
{
"id": "linkout1",
"type": "link out",
"links": ["linkin1", "linkin2"],
"mode": "link"
}
// Link in configuration
{
"id": "linkin1",
"type": "link in",
"links": ["linkout1"]
}Documentation and annotation within flows. Provides no functional behavior but improves flow readability.
/**
* Comment node for flow documentation
* Registers as node type: "comment"
*/
function CommentNode(config) {
RED.nodes.createNode(this, config);
// Configuration properties:
// config.info - Comment text content
}Placeholder for missing or unrecognized node types. Maintains flow integrity when nodes are unavailable.
/**
* Unknown node - placeholder for missing node types
* Registers as node type: "unknown"
*/
function UnknownNode(config) {
RED.nodes.createNode(this, config);
// Preserves original node configuration for when proper node becomes available
}Common nodes typically handle standard Node-RED messages:
// Input message handler pattern
this.on("input", function(msg, send, done) {
try {
// Process message
msg.payload = processedData;
// Send to next nodes
send(msg);
// Signal completion
done();
} catch (error) {
// Signal error
done(error);
}
});// Complete flow control setup
{
"inject": {
"payload": "start process",
"repeat": "10"
},
"debug": {
"complete": "payload",
"console": true
},
"catch": {
"scope": ["process-node"],
"uncaught": false
},
"complete": {
"scope": ["process-node"]
}
}