Using start time from ical event as start for flow

Hi all, new user here. Please be gentle!

I'm using node-red-contrib-ical-events to get the events for the next day (1 event per day) and get the start time. I'd like to pass this to some kind of trigger node to start a flow based on the Event Start time -1 hour (Trigger one hour before the event)

Example:

[iCal EventStart = 09:00] > [Do something to -1 hour from EventStart] > [trigger flow at EventStart-1h]

Ideally I would like to store the EventStart-1h in some kind of global variable so it can trigger multiple flows with one lookup but this isn't essential.

EG:

[iCal EventStart] > [EventStart-1h] > [Save to variable]

[Some kind of timer block using variable] > [flow 1]
[Some kind of timer block using variable] > [flow 2]

Any advice would be greatly appreciated.

So what have ou tried so far? Please export your flow and paste it to a reply

Apologies if I wasn't clear. Please ignore the my initial post if it does not make sense. I will attempt to explain it better for you.

I do not have a flow that would give any more information than my first post as I do not know which nodes I might need (other than the ical node mentioned to get the ical event which outputs a string: payload[0].eventStart = 2023-02-07T09:00:00.000Z).

I want to:

  1. Set a a global variable from the ical flow (Done)
    • global.foo=2023-02-07T09:00:00.000Z
  2. Use global.foo as the start time for other flows (Not done)

For example the inject node can take a time to trigger (EG: 9am) but from what I can tell I cannot use the output of one flow (the date formatted string above) as the time in the inject node.

I guess my question becomes, can someone advise of a node that can use a global variable for the trigger time for it's flow? And if it can use it will it read the new value any time global.foo updates or is this locked during the Deploy step?

Which of the three ical nodes (Trigger, Sensor or Upcoming) are you using?
How do you have it configured?

There isn't much documentation for this node so you might want to open an issue on the authors GitHub page and ask your question there.

The ical node is irrelevant. Please Ignore ical and the format of the string.

I have a global variable called global.foo, this contains a timestamp (in whatever format the node I'm looking for requires, again the format of this string is irrelevant), I want to use this variable in a node to trigger a flow. My problem is I have not been able to find a node which can do this, hence am looking for recommendations for such a node.

One possibility is node-red-contrib-cron-plus that is widely used and well supported. You can dynamically pass it schedules of what it should do.

1 Like

Thank you Colin. This certainly seems like the right direction. Will give it a go and mark as the solution if I can get it working.

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