Define rate limit with context variable

Hello,
I'm trying, with node red dashboard, to configure rate limit with a slider. But on delay and inject nodes, i don't see how to put a context variable in the delay. Any idea how to proceed to manage a delay from a context variable.

Hi and welcome to the forum.

What can help you in these times is to make a very simple flow that does only that specific thing.

When you say context.... That is at the flow level or specific to some code you wrote in a function node?

If it is at the flow level:
You will need to use a change node to do what you want.
Then when you open the change node you change it to something like:

Screenshot from 2022-05-04 18-17-42

Then the msg.delay will have the value from your context.

But if it is from a function node, slightly different.

But I'll leave it here for now.

Yes indeed I want to use it with the flow, thank you for this answer I will try right away

You will also have to tick the option in the node to allow the delay to be adjusted by msg.delay.

And!

Don't forget that the value is in MILLISECONDS......
:wink:

It can catch you if you forget that.

Oh thanks for editing your message because that doesn't work, but when i set it ms this work fine thank you !

Yeah, it's caught me a lot of times.
You want a 5 second delay and enter 5 as the value.

All good. :slight_smile:

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