Registry / workflow / node-red-contrib-cron-plus

node-red-contrib-cron-plus

JSON →
library2.2.4jsnpmunverified

node-red-contrib-cron-plus is an actively maintained Node-RED custom node providing robust scheduling capabilities within Node-RED flows. Currently stable at version 2.2.4, it offers versatile scheduling options including standard cron expressions, solar events (e.g., sunrise, sunset, civil twilight with offsets), and fixed date sequences. Releases often include bug fixes and minor enhancements, with major versions introducing significant features or architectural changes. Key differentiators include its comprehensive dynamic control via input messages, full timezone support, an intuitive UI with a cron expression builder, a map for solar coordinate selection, and options for outputting various payload types. It's specifically designed for the Node-RED environment, allowing for visual configuration and integration into flow-based programming paradigms, rather than being a standalone JavaScript library.

npm install node-red-contrib-cron-plus
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-C
N
node-red-contrib-cron-plus
workflowjavascriptv2.2.4
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cron-plus
✓ Install via Node-RED Palette Manager or `npm install node-red-contrib-cron-plus` in your Node-RED user directory, then drag the 'cron-plus' node from the palette into your flow.
✗ import { CronPlus } from 'node-red-contrib-cron-plus';
This package provides a Node-RED custom node, not a standalone JavaScript library. Its functionality is accessed through the Node-RED visual editor by adding the 'cron-plus' node to a flow.
Dynamic Schedule Input (add command)
✓ msg.topic = 'add'; msg.payload = { payload: 'hello', schedule: '0 * * * *', id: 'my-dynamic-schedule' }; return msg;
✗ msg.payload = '0 * * * *'; return msg;
Dynamic schedules require a structured `msg.payload` object with at least `schedule` and `payload` properties, and optionally an `id` for management.
Control Commands (stop/start/remove)
✓ msg.topic = 'stop-all-dynamic'; return msg;
✗ msg.payload = 'stop-all-dynamic'; return msg;
Control commands are typically sent via `msg.topic` and can include filters like `-all`, `-dynamic`, `-static`, `-active`, or `-inactive` to target specific schedule types.

This Node-RED flow demonstrates a basic cron-plus node configured to trigger every 15 seconds, sending a 'triggered!' payload to the debug sidebar.

[{"id":"d1b5c9e4.72147","type":"inject","z":"aefd1b5c.d1148","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":120,"y":120,"wires":[["f2a1b9c8.d73e0"]]},{"id":"f2a1b9c8.d73e0","type":"cronplus","z":"aefd1b5c.d1148","name":"Every 15 Seconds","outputField":"payload","timeZone":"Europe/London","persistDynamic":false,"outputs":1,"options":[{"topic":"cron-trigger","payloadType":"str","payload":"triggered!","expression":"0/15 * * * * * *"}],"x":340,"y":120,"wires":[["e7f0d8c2.b12a3"]]},{"id":"e7f0d8c2.b12a3","type":"debug","z":"aefd1b5c.d1148","name":"Debug Output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":560,"y":120,"wires":[]}]
Debug
Known issues
breakingVersion 2.0.0 initially introduced an ESM compatibility issue with its dependencies, which was rolled back in v2.0.1 to a CommonJS version. Ensure you are using v2.0.1 or newer to avoid potential module resolution problems.
fix
Upgrade to `node-red-contrib-cron-plus@2.0.1` or higher.
affects: 2.0.0
gotchaThe map popup used for selecting solar event coordinates requires an active internet connection to function correctly. Without internet, it will provide static information to assist in manual coordinate entry.
fix
Ensure your Node-RED instance or browser (if configuring) has internet access when using the map. Otherwise, manually input latitude and longitude.
affects: >=1.0.0
gotchaWhen 'Default Payload' is selected as the output type, the full `msg.cronplus` object (containing schedule details) is moved to `msg.payload`, overwriting any existing `msg.payload` content.
fix
If you need both the original `msg.payload` and `msg.cronplus` details, choose a different 'payload type' (e.g., string, object, JSONata) or map the `msg.cronplus` object to a different `outputField`.
affects: >=1.0.0
gotchaCommands to manage schedules (e.g., `remove`, `stop`, `start`) can be filtered by `dynamic` or `static`. Forgetting to specify the correct filter (e.g., `remove-all-dynamic` vs `remove-all-static`) can lead to unexpected behavior or schedules not being controlled as intended.
fix
Always be explicit about targeting dynamic or static schedules with appropriate command suffixes. Review the available commands in the node's documentation or built-in help.
affects: >=1.5.0
Errors
Common errors & fixes
Error: 'add' command requires a valid schedule object in msg.payload
Attempting to add a dynamic schedule with an incorrectly formatted `msg.payload` or missing required properties like `schedule` or `payload`.
fix
Ensure `msg.payload` is an object containing `schedule` (cron string, solar event, or date array) and `payload` (the value to send) when `msg.topic` is 'add'.
Solar event coordinates are missing or invalid.
A solar schedule is configured but lacks valid latitude and longitude coordinates, which are essential for calculating solar events.
fix
Provide valid latitude and longitude coordinates in the node configuration, either directly or via an environment variable, ensuring they are accessible to the node.
Node-RED cannot load node: cron-plus (likely due to Node.js version or corrupted install)
The installed Node-RED version or underlying Node.js runtime does not meet the minimum requirements, or the package installation is corrupted.
fix
Verify that your Node.js version is `>=8.0.0`. Try reinstalling the package (`npm install node-red-contrib-cron-plus`) in your Node-RED user directory (`~/.node-red`) or via the Node-RED Palette Manager.
Upgrade
Version history
2.2.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
44 hits · last 30 days
node
38
OpenAI (training)
1
Resources
node-red-contrib-cron-plus — npm install node-red-contrib-cron-plus · libregistry