Implement robust API rate limiting (per minute and per hour) using Redis in an n8n workflow. Protect backend resources like Airtable easily with this essential n8n template.
Download this n8n workflow template and start using it instantly.
When exposing data or actions via a public webhook, implementing robust security and rate limits is essential to prevent abuse and control costs. This specialized n8n workflow provides a dual-layer rate limiting mechanism, managing usage both per minute and per hour using Redis as a highly efficient counter store.
This particular n8n workflow uses an API key supplied in the request header (x-api-key) to uniquely track user requests. If a user exceeds 10 requests per minute OR 60 requests per hour, the n8n node structure automatically halts the process and returns an error message, preventing access to the protected resource (in this case, an Airtable database lookup). This is a highly effective way to manage traffic using native n8n node functionality combined with external infrastructure tools, resulting in secure and scalable n8n templates.
This n8n workflow is initiated by an external API call using the Webhook1 n8n trigger.
Webhook1 receives an HTTP request, expecting an API key via the x-api-key header for authentication and tracking.Set n8n node generates a unique Redis key by combining the API key, the current hour, and the current minute. This ensures granularity.Redis n8n node increments the counter for the per-minute key and sets a TTL of 3600 seconds. The subsequent Per minute If n8n node checks if the count is less than or equal to 10.Set3 n8n node, which immediately returns a 'limit exceeded' message via the n8n workflow response mechanism.Set2 n8n node generates a broader per-hour key (API key + Hour).Redis1 n8n node increments the per-hour counter. The Per hour If n8n node checks if this count is less than 60.Set1, returning the 'limit exceeded' message.Airtable n8n node to fetch the requested data. The final Function n8n node processes this data, formats it, and includes the current hourly usage count before sending the successful response back to the user.Redis and Redis1 n8n nodes. This requires access to a running Redis instance.Airtable n8n node, ensuring it has read access to the specified 'Pokemon' table (or modify the Airtable node parameters to match your protected resource).Webhook1 n8n trigger. You will use this URL to make API calls, passing your unique API key in the x-api-key header. Webhook1 (n8n Trigger): The starting point of the n8n workflow. It is configured with Header Authentication to protect the endpoint and ensures the user provides an API key.
Set & Set2 (n8n node): These nodes are crucial for defining the unique rate limit keys. Set creates the minute-based key (API Key-Hour-Minute), while Set2 creates the broader hour-based key (API Key-Hour), ensuring accurate time-based tracking.
Redis & Redis1 (n8n node): These nodes connect to the Redis service to manage counters using the incr operation. This provides atomic counting necessary for reliable rate limiting in this n8n template.
Per minute & Per hour (If n8n node): These core logic nodes determine whether the incoming request exceeds the threshold (10/minute and 60/hour). They control the branching flow of the n8n workflow.
Airtable (n8n node): The protected resource. This node executes a 'list' operation, which is only reached if both rate limits are respected.
Function (n8n node): Used for transforming the successful Airtable response into a clean JSON structure and including the current usage count for transparency.
Build flexible AI agents using this dynamic automation. Leverage OpenRouter with the OpenAI node, memory, and chat capabilities in your custom n8n workflow.

Deploy this expert n8n workflow to automatically scrape Upwork jobs, extract client names using AI, find validated LinkedIn profiles via Phantombuster, and enrich lead data using Hunter.io before saving to Google Sheets.

Use this powerful n8n workflow to automatically scrape fresh Upwork job listings using Apify and log the structured data directly into Google Sheets. Leverage n8n for hands-free automation.

Use this powerful n8n workflow template to integrate LangChain code directly into your automation. Summarize YouTube transcripts using OpenAI and the specialized n8n node.









































