Prevent concurrent workflow runs using Redis
What does this template do? This workflow sets a small "lock" value in Redis so that only one copy of a long job can run at the same time. If another trigger...
🔌 Nodes & Integrations Used (3)
📖 Implementation & Setup Guide
What does this template do? This workflow sets a small "lock" value in Redis so that only one copy of a long job can run at the same time. If another trigger fires while the job is still busy, the workflow sees the lock, stops early, and throws a clear error. This protects your data and keeps you from hitting rate limits. Because the workflow also stores simple progress flags ("working", "loading", "finishing"), you can poll the current status and show live progress for very long jobs.
Use Case Great when the same workflow can be called many times in parallel (for example by webhooks, cron jobs, or nested Execute Workflow calls) and you need an "only run once at a time" guarantee without building a full queue system.
What the Workflow Does - ⚡ Starts through **Execute Workflow Trigger** called by another workflow - 🔄 A **Switch** sends the run to **Get**, **Set**, or **Unset** actions - 💾 **Redis** reads or writes a key named `process_status_<key>` with a time‑to‑live (default 600 s) - 🚦 **If** nodes check the key and decide to continue or stop - ⏱️ **Wait** nodes stand in for the slow part of your job (replace these with your real work) - 📈 Updates the key with human‑readable progress values that another workflow can fetch with `action = get` - 🏁 When done, the lock is removed so the next run can start
Apps & Services Used - Redis - Core n8n nodes (Switch, If, Set, Wait, Stop and Error)
Pre‑requisites - A Redis server that n8n can reach - Redis credentials stored in n8n - A second workflow that calls this one and sends: - `action` set to `get`, `set`, or `unset` - `key` set to a unique name for the job - Optional `timeout` in seconds
Customization Tips - Increase or decrease the TTL in the **Set Timeout** node to match how long your job usually runs - Add or rename status values ("working", "loading", "finishing", and so on) to show finer progress - Replace **Stop and Error** with a Slack or email alert, or even push the extra trigger into a queue if you prefer waiting instead of failing - Use different Redis keys if you need separate locks for different tasks - Build a small "status endpoint" workflow that calls this one with `action = get` to display real‑time progress to users
Additional Use Cases
🛑 Telegram callback spam filter If a Telegram bot sends many identical callbacks in a burst, call this workflow first to place a lock. Only the first callback will proceed; the rest will exit cleanly until the lock clears. This keeps your bot from flooding downstream APIs.
🧩 External API rate‑limit protection Run heavy API syncs one after the other so parallel calls do not break vendor rate limits.
🔔 Maintenance window lock Block scheduled maintenance tasks from overlapping, making sure each window finishes before the next starts.
⚡ How to import this workflow into n8n:
- Click the Direct Download JSON button above to save
Prevent concurrent workflow runs using Redis.json. - Log in to your n8n Cloud or self-hosted n8n instance.
- In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
- Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
- Click Execute Workflow to test and switch to Active!
Related DevOps & GitHub Workflows
View All in DevOps & GitHub →Generate Google Doc Proposal
Production-ready n8n automation template for Generate Google Doc Proposal built by AhiXLight. Seamlessly connects Execute Workflow Trigger, Google Drive, OpenAI with 7 configured nodes.
Add a new lead to Pipedrive once GitHub repo is forked
This workflow automatically adds a new lead to Pipedrive once someone forks your GitHub repository. Prerequisites - Pipedrive account and Pipedrive credentia...
Add the affiliate to a program automatically
This workflow allows you to create an affiliate, add metadata, and add the affiliate to a program. !workflow-screenshot Tapfiliate node: This node allows you...
Add a note to Pipedrive s contact once PR is added on GitHub
This workflow automatically adds a note of the PR from GitHub to the Pipedrive contact if their GitHub email matches a Person in Pipedrive. Prerequisites - P...