Same workflow executing twice at the same time

Describe the issue/error/question

The same workflow is executing at the same time. The cron is set for 18 min a part.

What is the error message (if any)?

Please share the workflow

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "mode": "everyX",
              "value": 18,
              "unit": "minutes"
            }
          ]
        }
      },
      "name": "Cron1",
      "type": "n8n-nodes-base.cron",
      "position": [
        400,
        300
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "text": "=Title: {{$node[\"Twitter5\"].json[\"data\"][\"title\"]}}\nListeners: {{$node[\"Twitter5\"].json[\"data\"][\"participant_count\"]}}\nStarted @ {{$node[\"parse EST Time\"].json[\"started_at_est\"]}} / {{$node[\"Twitter5\"].json[\"data\"][\"started_at\"].substring(11, 16)}} UTC\n#blkspaces\n\nhttps://twitter.com/i/spaces/{{$node[\"Twitter5\"].json[\"data\"][\"id\"]}}",
        "additionalFields": {}
      },
      "name": "Twitter1",
      "type": "n8n-nodes-base.twitter",
      "typeVersion": 1,
      "position": [
        2560,
        320
      ],
      "credentials": {
        "twitterOAuth1Api": {
          "id": "16",
          "name": "BlkSpaces"
        }
      },
      "continueOnFail": true
    },
    {
      "parameters": {
        "operation": "like",
        "tweetId": "={{$node[\"SplitInBatches\"].json[\"tweet_id\"]}}",
        "additionalFields": {}
      },
      "name": "Twitter2",
      "type": "n8n-nodes-base.twitter",
      "typeVersion": 1,
      "position": [
        2440,
        60
      ],
      "credentials": {
        "twitterOAuth1Api": {
          "id": "16",
          "name": "BlkSpaces"
        }
      },
      "continueOnFail": true
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "append",
        "sheetId": "1R2eupQ-A5vGmdxfC7XETi7gp0gE5H_l97n6RleokCeI",
        "range": "A:E",
        "options": {
          "valueInputMode": "USER_ENTERED"
        }
      },
      "name": "Google Sheets5",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2400,
        760
      ],
      "typeVersion": 1,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "6",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "number": [],
          "string": [
            {
              "name": "Date",
              "value": "={{new Date().toLocaleDateString()}}"
            },
            {
              "name": "spaces_url",
              "value": "=https://twitter.com/i/spaces/{{$node[\"Twitter5\"].json[\"data\"][\"id\"]}}"
            },
            {
              "name": "tweet_url",
              "value": "={{$node[\"Set\"].json[\"url\"]}}"
            },
            {
              "name": "photo",
              "value": "={{$node[\"SplitInBatches\"].json[\"photo\"]}}"
            },
            {
              "name": "score",
              "value": "={{$node[\"Deepface\"].json[\"instance_1\"][\"race\"][\"black\"]}}"
            }
          ]
        },
        "options": {}
      },
      "name": "Set3",
      "type": "n8n-nodes-base.set",
      "position": [
        2240,
        820
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "functionCode": "var date = new Date().toISOString();\nvar day = new Date().getDay();\nconst weekday = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n\nitems[0].json.date_today = date;\nitems[0].json.day_today = weekday[day];\n\nreturn items;"
      },
      "name": "Function1",
      "type": "n8n-nodes-base.function",
      "position": [
        2100,
        820
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "lookup",
        "sheetId": "1R2eupQ-A5vGmdxfC7XETi7gp0gE5H_l97n6RleokCeI",
        "range": "A:E",
        "lookupColumn": "spaces_url",
        "lookupValue": "=https://twitter.com/i/spaces/{{$node[\"Twitter5\"].json[\"data\"][\"id\"]}}",
        "options": {
          "continue": true
        }
      },
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        1540,
        740
      ],
      "retryOnFail": false,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "6",
          "name": "Google Sheets account"
        }
      },
      "continueOnFail": true
    },
    {
      "parameters": {
        "conditions": {
          "boolean": [],
          "string": [
            {
              "value1": "={{$node[\"Google Sheets\"].json[\"spaces_url\"]}}",
              "operation": "isEmpty"
            }
          ]
        }
      },
      "name": "IF",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1660,
        820
      ],
      "alwaysOutputData": false,
      "notesInFlow": true,
      "retryOnFail": false,
      "notes": "Filter\n\nTurned off \"Always Output Data\" and \"Retry on Fail\" as they shouldn't be needed at this point."
    },
    {
      "parameters": {
        "amount": 2,
        "unit": "seconds"
      },
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        1400,
        360
      ],
      "webhookId": "3a87db61-9485-4777-bff1-20453ecd282c"
    },
    {
      "parameters": {
        "batchSize": 1,
        "options": {}
      },
      "name": "SplitInBatches",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 1,
      "position": [
        1060,
        300
      ]
    },
    {
      "parameters": {
        "resource": "spaces",
        "operation": "lookup_creator_id",
        "user_ids": "={{$node[\"SplitInBatches\"].json[\"id\"]}}",
        "additionalFields": {}
      },
      "name": "Twitter",
      "type": "n8n-nodes-base.twitter",
      "typeVersion": 1,
      "position": [
        740,
        1000
      ],
      "credentials": {
        "twitterBearerToken": {
          "id": "17",
          "name": "Twitter V2 Bearer Token account"
        }
      },
      "continueOnFail": true
    },
    {
      "parameters": {
        "conditions": {
          "string": [],
          "number": [
            {
              "value1": "={{$node[\"Twitter\"].json[\"meta\"][\"result_count\"]}}",
              "operation": "equal"
            }
          ]
        }
      },
      "name": "IF1",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1260,
        720
      ]
    },
    {
      "parameters": {
        "amount": 2,
        "unit": "seconds"
      },
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        600,
        860
      ],
      "webhookId": "21ebd41d-4849-498e-bfe3-22bdf0a4a6e8"
    },
    {
      "parameters": {
        "resource": "spaces",
        "spaces_id": "={{$node[\"Twitter\"].json[\"data\"][0][\"id\"]}}",
        "additionalFields": {
          "space_fields": "host_ids,created_at,creator_id,id,lang,invited_user_ids,participant_count,speaker_ids,started_at,ended_at,topic_ids,state,title,updated_at,scheduled_start,is_ticketed"
        }
      },
      "name": "Twitter5",
      "type": "n8n-nodes-base.twitter",
      "typeVersion": 1,
      "position": [
        1840,
        820
      ],
      "credentials": {
        "twitterBearerToken": {
          "id": "17",
          "name": "Twitter V2 Bearer Token account"
        }
      },
      "continueOnFail": true
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$node[\"Twitter5\"].json[\"data\"][\"state\"]}}",
              "value2": "scheduled"
            }
          ]
        }
      },
      "name": "IF2",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        2580,
        640
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "number": [],
          "string": [
            {
              "name": "Date",
              "value": "={{new Date().toLocaleDateString()}}"
            },
            {
              "name": "spaces_url",
              "value": "={{$node[\"SplitInBatches\"].json[\"spaces_url\"]}}"
            },
            {
              "name": "tweet_url",
              "value": "={{$node[\"SplitInBatches\"].json[\"url\"]}}"
            },
            {
              "name": "photo",
              "value": "={{$node[\"SplitInBatches\"].json[\"photo\"]}}"
            },
            {
              "name": "score",
              "value": "={{$node[\"Deepface\"].json[\"instance_1\"][\"race\"][\"black\"]}}"
            }
          ]
        },
        "options": {}
      },
      "name": "Set4",
      "type": "n8n-nodes-base.set",
      "position": [
        3160,
        440
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "functionCode": "var date = new Date().toISOString();\nvar day = new Date().getDay();\nconst weekday = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n\nitems[0].json.date_today = date;\nitems[0].json.day_today = weekday[day];\n\nreturn items;"
      },
      "name": "Function2",
      "type": "n8n-nodes-base.function",
      "position": [
        2940,
        520
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "unit": "minutes"
      },
      "name": "Wait2",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        2800,
        800
      ],
      "webhookId": "909ee8e0-5cb2-4b4e-9a83-a2a157ec04a1",
      "disabled": true
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "append",
        "sheetId": "1R2eupQ-A5vGmdxfC7XETi7gp0gE5H_l97n6RleokCeI",
        "range": "A:E",
        "options": {
          "valueInputMode": "USER_ENTERED"
        }
      },
      "name": "Google Sheets2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3440,
        420
      ],
      "typeVersion": 1,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "6",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "text": "=Title: {{$node[\"Twitter5\"].json[\"data\"][\"title\"]}}\nScheduled to Start @ {{$node[\"parse EST Time-Scheduled\"].json[\"scheduled_start_est\"]}} / {{$node[\"Twitter5\"].json[\"data\"][\"scheduled_start\"].substring(11, 16)}} UTC\n#blkspaces\n\nhttps://twitter.com/i/spaces/{{$node[\"Twitter5\"].json[\"data\"][\"id\"]}}",
        "additionalFields": {}
      },
      "name": "Twitter7",
      "type": "n8n-nodes-base.twitter",
      "typeVersion": 1,
      "position": [
        3700,
        440
      ],
      "credentials": {
        "twitterOAuth1Api": {
          "id": "16",
          "name": "BlkSpaces"
        }
      },
      "continueOnFail": true
    },
    {
      "parameters": {
        "functionCode": "\nlet response = []\nfor (d of items[0].json.data) {\n  response.push({json : d})\n}\nreturn response"
      },
      "name": "parsing",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        820,
        300
      ]
    },
    {
      "parameters": {
        "resource": "users",
        "user_id": "1462195817482264581",
        "additionalFields": {
          "max_results": 500,
          "pagination_token": "J88KV9OKF0MEGZZZ"
        }
      },
      "name": "Twitter6",
      "type": "n8n-nodes-base.twitter",
      "typeVersion": 1,
      "position": [
        540,
        300
      ],
      "alwaysOutputData": true,
      "credentials": {
        "twitterBearerToken": {
          "id": "17",
          "name": "Twitter V2 Bearer Token account"
        }
      },
      "continueOnFail": true
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$node[\"Twitter\"].json[\"error\"]}}",
              "value2": "The service is receiving too many requests from you! Perhaps take a break?"
            }
          ]
        }
      },
      "name": "IF6",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        920,
        1040
      ]
    },
    {
      "parameters": {
        "amount": 15,
        "unit": "minutes"
      },
      "name": "Wait3",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        1160,
        1160
      ],
      "webhookId": "c8427116-f5cd-4d8d-b5a8-48513dc13398"
    },
    {
      "parameters": {
        "functionCode": "let started_at = $node[\"Twitter5\"].json[\"data\"][\"started_at\"]\n\nitem.started_at_est = toFormatedEST(new Date(started_at))\n\nreturn item;\n\nfunction toFormatedEST(date) {\n  let time = date.toLocaleTimeString('en-US', {timeZone: 'America/Panama', hour: '2-digit', minute:'2-digit'})\n  return `${time} EST`\n}\n"
      },
      "name": "parse EST Time",
      "type": "n8n-nodes-base.functionItem",
      "typeVersion": 1,
      "position": [
        1940,
        1060
      ],
      "continueOnFail": true
    },
    {
      "parameters": {
        "functionCode": "let scheduled_start = $node[\"Twitter5\"].json[\"data\"][\"scheduled_start\"]\n\nitem.scheduled_start_est = toFormatedEST(new Date(scheduled_start))\n\nreturn item;\n\nfunction toFormatedEST(date) {\n  let time = date.toLocaleTimeString('en-US', {timeZone: 'America/Panama', hour: '2-digit', minute:'2-digit'})\n  return `${time} EST`\n}\n\n"
      },
      "name": "parse EST Time-Scheduled",
      "type": "n8n-nodes-base.functionItem",
      "typeVersion": 1,
      "position": [
        2160,
        1060
      ],
      "continueOnFail": true
    },
    {
      "parameters": {
        "amount": 15,
        "unit": "minutes"
      },
      "name": "Wait9",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        800,
        100
      ],
      "webhookId": "c8427116-f5cd-4d8d-b5a8-48513dc13398"
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$node[\"Twitter\"].json[\"error\"]}}",
              "value2": "The service is receiving too many requests from you! Perhaps take a break?"
            }
          ]
        }
      },
      "name": "IF7",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        640,
        140
      ]
    }
  ],
  "connections": {
    "Cron1": {
      "main": [
        [
          {
            "node": "Twitter6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Twitter1": {
      "main": [
        [
          {
            "node": "Twitter2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Twitter2": {
      "main": [
        [
          {
            "node": "SplitInBatches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets5": {
      "main": [
        [
          {
            "node": "IF2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set3": {
      "main": [
        [
          {
            "node": "Google Sheets5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Function1": {
      "main": [
        [
          {
            "node": "Set3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "IF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF": {
      "main": [
        [
          {
            "node": "Twitter5",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "SplitInBatches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SplitInBatches": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Twitter": {
      "main": [
        [
          {
            "node": "IF6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF1": {
      "main": [
        [
          {
            "node": "SplitInBatches",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Twitter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Twitter5": {
      "main": [
        [
          {
            "node": "parse EST Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF2": {
      "main": [
        [
          {
            "node": "Function2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set4": {
      "main": [
        [
          {
            "node": "Google Sheets2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Function2": {
      "main": [
        [
          {
            "node": "Set4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait2": {
      "main": [
        [
          {
            "node": "Twitter1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets2": {
      "main": [
        [
          {
            "node": "Twitter7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Twitter7": {
      "main": [
        [
          {
            "node": "SplitInBatches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "parsing": {
      "main": [
        [
          {
            "node": "SplitInBatches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Twitter6": {
      "main": [
        [
          {
            "node": "IF7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF6": {
      "main": [
        [
          {
            "node": "Wait3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "IF1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait3": {
      "main": [
        [
          {
            "node": "IF1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "parse EST Time": {
      "main": [
        [
          {
            "node": "parse EST Time-Scheduled",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "parse EST Time-Scheduled": {
      "main": [
        [
          {
            "node": "Function1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait9": {
      "main": [
        [
          {
            "node": "parsing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF7": {
      "main": [
        [
          {
            "node": "Wait9",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "parsing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
    0.151.0
  • Database you’re using (default: SQLite):
    postgresql
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:
    npm

In this case, the Interval-Node would be better. If you tell a Cron-Node to execute all 18 minutes it will execute at the following minutes of the hour:
0, 18, 36, 54
Meaning between the first and the last interval there will only be 6 minutes.

1 Like