Using a Delay-Node configured to override delay; I've tried this code in a Function-Node:
var delayTime = 20000; // 20 seconds
var msgDelay = { payload: "START", timerDuration: delayTime, timerDurationUnit: "milliseconds" };
return msgDelay;
It fails to override the 5 second default. Is there a way to send a message to the Delay-Node from a function node that overrides the default 5 second delay, and simultaneously triggers the delay?
delay [number]
Sets the delay, in milliseconds, to be applied to the message. This option only applies if the node is configured to allow the message to override the configured default delay interval.
The arrival of any message at the delay node will start the timer, regardless of the value of msg.payload.
After 20 seconds, the complete message object {payload:"START", delay: 20000} is passed on from the delay node
You're correct; I removed the payload and it still works. I thought that should be the case, but every thing I tried failed. I just wasn't specifying the 'delay' property correctly; the documentation msg.delay is misleading.