{
  "name": "Prevent simultaneous workflow executions with Redis",
  "nodes": [
    {
      "id": "58dc1dd1-38f7-4cab-aa91-007c35a72f07",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        64,
        112
      ]
    },
    {
      "id": "28085fe4-2fd3-4c36-81eb-34bbec6e6f4f",
      "name": "Execute Workflow",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        960,
        -64
      ]
    },
    {
      "id": "c0346bd9-2854-453d-a6c0-b25bd38a70b5",
      "name": "Get Flag",
      "type": "n8n-nodes-base.redis",
      "position": [
        288,
        112
      ]
    },
    {
      "id": "1c671fda-a479-47a1-acfd-23b98f514de5",
      "name": "Set Flag",
      "type": "n8n-nodes-base.redis",
      "position": [
        736,
        112
      ]
    },
    {
      "id": "75a1b909-0b39-4afc-812e-5dafc51fcef9",
      "name": "Remove Flag",
      "type": "n8n-nodes-base.redis",
      "position": [
        960,
        288
      ]
    },
    {
      "id": "7319acc6-6696-4b3d-9394-3b89effb0442",
      "name": "Flag does not exists",
      "type": "n8n-nodes-base.filter",
      "position": [
        512,
        112
      ]
    },
    {
      "id": "b268fe1f-200c-484d-81c6-2cd967960963",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -128
      ],
      "parameters": {
        "width": 640,
        "height": 576,
        "content": "## How it works\n- This is a separate workflow which monitors the execution of the main workflow\n- Stores a flag in Redis (key dynamically named after workflow ID) which indicates if the main workflow "
      }
    },
    {
      "id": "1c286399-3c27-491b-916f-adb49465b8cf",
      "name": "Optional: Execute another workflow",
      "type": "n8n-nodes-base.noOp",
      "position": [
        960,
        112
      ]
    }
  ],
  "connections": {
    "Get Flag": {
      "main": [
        [
          {
            "node": "Flag does not exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Flag": {
      "main": [
        [
          {
            "node": "Execute Workflow",
            "type": "main",
            "index": 0
          },
          {
            "node": "Remove Flag",
            "type": "main",
            "index": 0
          },
          {
            "node": "Optional: Execute another workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Workflow": {
      "main": [
        []
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Flag",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Flag does not exists": {
      "main": [
        [
          {
            "node": "Set Flag",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}