How to implement user based rate limiting in n8n chat trigger node?

We are using the n8n Chat Trigger node and want to implement user-based rate limiting to restrict the number of messages a user can send within a given time (e.g., X messages per hour).

Since the Chat Trigger node only provides sessionId, action, and chatInput, we are exploring ways to uniquely identify users—whether via IP address, session ID, or any other available metadata. Our goal is to achieve this with minimal effort/coding, ideally using built-in n8n nodes like IF, Set, and Supabase/Postgres for tracking message counts.

Has anyone implemented a similar rate-limiting solution in n8n Chat Trigger? Any best practices or workarounds would be greatly appreciated! :rocket:

1 Like

The straight forward approach would be using a Wait Node. Better approach would be to log the data somewhere. Choices are Redis, Supabase etc and process it further.

Universal rate limiting can be achieved via the approaches mentioned (Redis, Supabase, Wait node). The main concern here is unique identification of users.