This workflow corresponds to n8n.io template #6196 — we link there as the canonical source.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "AnwVFKf8Tm5HHiyk",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Preventing simultaneous executions for scheduled workflows",
"tags": [],
"nodes": [
{
"id": "ac9d5f0d-5fbd-4a26-93e4-a9b7ba66a7f1",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
32,
-592
],
"parameters": {
"width": 1148,
"height": 728,
"content": "## Preventing Simultaneous Executions of Scheduled Workflows\n\nThis n8n template provides a robust solution for processing data from Google Sheets in a controlled manner, specifically designed to **prevent simultaneous executions of a scheduled workflow**. This is crucial for maintaining data integrity, avoiding race conditions, and ensuring that your automated processes handle data sequentially.\n\n### What This Workflow Does and Why It's Important\n\nMany automated tasks involve processing a list of items, like rows in a Google Sheet. If a workflow is scheduled to run every minute, but a single run takes longer than a minute to complete, you could end up with multiple instances of the same workflow running concurrently. This can lead to:\n\n* **Data Duplication**: Processing the same row multiple times.\n* **Data Corruption**: Inconsistent updates or overwrites.\n* **Resource Exhaustion**: Overloading your systems or API rate limits.\n\nThis template solves this by leveraging n8n's **workflow runtime timeout feature**. By setting the workflow's runtime timeout to be equal to or slightly less than its scheduled execution frequency, you ensure that only one instance of the workflow can run at any given time. Once a workflow run successfully completes, it updates a status in your Google Sheet, marking the processed rows and preventing them from being picked up again in subsequent runs. This guarantees sequential, reliable data processing and avoids conflicts.\n\n### Step-by-Step Setup Instructions\n\n1. **Import the Template**: Import this workflow into your n8n instance.\n2. **Google Sheets Credential**: Ensure you have a Google Sheets credential configured in n8n and connected to the Google Sheets nodes within the workflow.\n3. **Specify Spreadsheet and Sheet Name**: In the \"Google Sheet\" node, update the Spreadsheet ID and Sheet Name to point to your specific Google Sheet. You can use this [example Google Sheet](https://docs.google.com/spreadsheets/d/1hKwP2_G6EaVSJlqWH1zYMVjarb9cuBx78D_U3HBrdhQ/edit?usp=sharing) for reference.\n4. **Configure Processing Logic**: Customize the nodes between the \"Read Google Sheet\" and \"Update Google Sheet\" steps to perform your desired data processing logic (e.g., sending emails, updating a CRM, making API calls).\n5. **Set Up Schedule**: Activate the workflow and configure its trigger (e.g., \"Cron\" node) to run on your desired schedule.\n6. **Configure Workflow Timeout**: In your n8n workflow settings, set the Workflow Timeout to a value equal to or slightly less than your scheduled execution frequency (e.g., if scheduled every 5 minutes, set timeout to 4 minutes 50 seconds).\n\nMore details in my [n8n tips blog](https://n8nplaybook.com/post/2025/07/how-to-prevent-concurrent-n8n-workflows/)."
},
"typeVersion": 1
},
{
"id": "c775e4d0-68c8-400c-adcc-3ffc1c43819c",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
448,
192
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "ae6127ea-e503-4c24-ad19-6733ed07e87a",
"name": "Read Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"onError": "continueErrorOutput",
"position": [
224,
288
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "READY",
"lookupColumn": "Status"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1hKwP2_G6EaVSJlqWH1zYMVjarb9cuBx78D_U3HBrdhQ/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1hKwP2_G6EaVSJlqWH1zYMVjarb9cuBx78D_U3HBrdhQ",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1hKwP2_G6EaVSJlqWH1zYMVjarb9cuBx78D_U3HBrdhQ/edit?usp=drivesdk",
"cachedResultName": "Tip #5: Fixing Google Sheets quota exceeding issue"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "810336b0-1a21-448a-87a1-9bb4388ce9ae",
"name": "Update Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"onError": "continueErrorOutput",
"position": [
1088,
288
],
"parameters": {
"columns": {
"value": {},
"schema": [
{
"id": "Color",
"type": "string",
"display": true,
"required": false,
"displayName": "Color",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Number",
"type": "string",
"display": true,
"required": false,
"displayName": "Number",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": false,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "autoMapInputData",
"matchingColumns": [
"row_number"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1hKwP2_G6EaVSJlqWH1zYMVjarb9cuBx78D_U3HBrdhQ/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1hKwP2_G6EaVSJlqWH1zYMVjarb9cuBx78D_U3HBrdhQ",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1hKwP2_G6EaVSJlqWH1zYMVjarb9cuBx78D_U3HBrdhQ/edit?usp=drivesdk",
"cachedResultName": "Tip #5: Fixing Google Sheets quota exceeding issue"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "efa03f8c-e27d-47eb-b671-f42265ccbece",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
32,
288
],
"parameters": {
"rule": {
"interval": [
{
"field": "minutes"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "d11b9464-0510-404d-82c1-a2aac71a67cc",
"name": "Wait random seconds (workload)",
"type": "n8n-nodes-base.wait",
"position": [
656,
288
],
"parameters": {
"amount": "={{ Math.round(Math.random() * 60) }}"
},
"typeVersion": 1.1
},
{
"id": "fe31d962-d720-4ba4-8ef3-4827f7f965a0",
"name": "Prepare output",
"type": "n8n-nodes-base.set",
"position": [
880,
288
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "4a875792-664d-4c97-af72-1252c86cc64a",
"name": "row_number",
"type": "number",
"value": "={{ $json.row_number }}"
},
{
"id": "cd47a508-aad7-4c7c-94cc-15752e8ede05",
"name": "Number",
"type": "number",
"value": "={{ $json.Color.length }}"
},
{
"id": "b67e8c39-f3f9-4614-9b5d-96876cb6a669",
"name": "Status",
"type": "string",
"value": "DONE"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "512983c7-5f71-470a-a4eb-ff819483a137",
"name": "Wait after quota error",
"type": "n8n-nodes-base.wait",
"position": [
1088,
528
],
"parameters": {
"unit": "minutes",
"amount": "=1"
},
"typeVersion": 1.1
},
{
"id": "625ad76b-deea-4a34-a9cd-5c706282bdae",
"name": "Wait after quota error 2",
"type": "n8n-nodes-base.wait",
"position": [
224,
528
],
"parameters": {
"unit": "minutes",
"amount": "=1"
},
"typeVersion": 1.1
}
],
"active": false,
"settings": {
"callerPolicy": "workflowsFromSameOwner",
"executionOrder": "v1",
"executionTimeout": 300
},
"versionId": "7821f3cc-f69d-4bea-ba98-819d651fa669",
"connections": {
"Prepare output": {
"main": [
[
{
"node": "Update Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Wait random seconds (workload)",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Read Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"Read Google Sheets": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait after quota error 2",
"type": "main",
"index": 0
}
]
]
},
"Update Google Sheets": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait after quota error",
"type": "main",
"index": 0
}
]
]
},
"Wait after quota error": {
"main": [
[
{
"node": "Update Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"Wait after quota error 2": {
"main": [
[
{
"node": "Read Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"Wait random seconds (workload)": {
"main": [
[
{
"node": "Prepare output",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This n8n template provides a robust solution for processing data from Google Sheets in a controlled manner, specifically designed to prevent simultaneous executions of a scheduled workflow. This is crucial for maintaining data integrity, avoiding race conditions, and ensuring…
Source: https://n8n.io/workflows/6196/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow automates video distribution to 9 social platforms simultaneously using Blotato's API. It includes both a scheduled publisher (checks Google Sheets for videos marked "Ready") and a subwo
YogiAI. Uses googleSheets, googleSheetsTool, httpRequest, stopAndError. Scheduled trigger; 61 nodes.
This workflow monitors Google Calendar for events indicating that a customer will visit the company today or the next day, retrieves the required details, and sends reminder notifications to the relev
Useful if a team is working within a single instance and you want to be notified of what workflows have changed since you last visited them. Another use-case might be monitoring your managed instances
ofn hook v0.24.0 beta. Uses start, httpRequest, functionItem, itemLists. Scheduled trigger; 42 nodes.