{
  "name": "Automate WhatsApp tests and rank results with PostgreSQL (Module \"Quiz\")",
  "nodes": [
    {
      "id": "6eb96949-f6bc-4044-b0cf-7bac329ce722",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        520
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "42f5adf9-8663-44f7-a2da-20631d01dc0f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        520
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "2e406d54-a333-4767-a1bb-e2c61d60c5b6",
      "name": "Starts",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        480,
        560
      ]
    },
    {
      "id": "7d6e48cb-6154-48a5-97c5-aef2bfcffc58",
      "name": "Get Bot Status",
      "type": "n8n-nodes-base.postgres",
      "position": [
        480,
        760
      ]
    },
    {
      "id": "a998e1fe-c919-4b61-a051-17afa7f14c0e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        1400
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "2ed48b30-5737-4d84-bceb-a8046c950fe6",
      "name": "Commands",
      "type": "n8n-nodes-base.switch",
      "position": [
        980,
        760
      ]
    },
    {
      "id": "0039047d-110f-4726-a29d-2d1035e924ec",
      "name": "Main Menu",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1260,
        560
      ]
    },
    {
      "id": "53c8427c-a23d-4818-a2d5-f8ad3cd78816",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2960,
        940
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "743ef248-8f5c-444b-91c9-07249ae98540",
      "name": "Define Flow",
      "type": "n8n-nodes-base.switch",
      "position": [
        700,
        760
      ]
    },
    {
      "id": "68ae7054-369d-4b61-ad76-eeba27d8fc98",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1220,
        740
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "988f33f4-a8d9-44d9-ac2c-3ad00c64217f",
      "name": "Upsert Bot Status on START",
      "type": "n8n-nodes-base.postgres",
      "position": [
        700,
        560
      ]
    },
    {
      "id": "719d9e1d-61e1-44de-8cfc-bc28b8e5f53c",
      "name": "Initialization",
      "type": "n8n-nodes-base.set",
      "position": [
        240,
        760
      ]
    },
    {
      "id": "2908320f-4f14-4d9a-9896-72b4187f8217",
      "name": "Update Bot Status on START ",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1480,
        560
      ]
    },
    {
      "id": "ef1d9288-56f0-41ce-81a3-c3452e6ac86a",
      "name": "Update Bot Status on TEST",
      "type": "n8n-nodes-base.postgres",
      "position": [
        3020,
        960
      ]
    },
    {
      "id": "a42629ec-0966-4e63-b863-a0f541003171",
      "name": "Randomize questions",
      "type": "n8n-nodes-base.sort",
      "position": [
        2360,
        960
      ]
    },
    {
      "id": "08429844-5483-44d7-8a5c-4e9e0f6f120e",
      "name": "Any questions?",
      "type": "n8n-nodes-base.if",
      "position": [
        2140,
        1160
      ]
    },
    {
      "id": "c2fe1635-6536-4895-9842-a815eb7902aa",
      "name": "Update Answer",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1700,
        1160
      ]
    },
    {
      "id": "ea2fe4f7-1cd3-41a8-a1b1-1fe94e416a5f",
      "name": "Get Non-Answered Questions",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1920,
        1160
      ]
    },
    {
      "id": "3000d5c8-a99c-4d1d-b6ff-a49ec1ea73c2",
      "name": "Get Tests",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1480,
        760
      ]
    },
    {
      "id": "118fe642-e11f-4f1d-ab38-34f9b4b3e329",
      "name": "Union Number with Question",
      "type": "n8n-nodes-base.set",
      "position": [
        1700,
        760
      ]
    },
    {
      "id": "aa592693-5434-44e8-8e90-00887b261b1f",
      "name": "Union list",
      "type": "n8n-nodes-base.summarize",
      "position": [
        1920,
        760
      ]
    },
    {
      "id": "fcac55cc-3ce0-4f2c-8d36-605927fce0fb",
      "name": "Calculate answers",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2360,
        1160
      ]
    },
    {
      "id": "c03e0632-74ea-471a-a0d4-7f754d062db4",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        20,
        760
      ]
    },
    {
      "id": "726f6b67-542f-4a11-aa48-e1427be1074e",
      "name": "List Tests",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2140,
        760
      ]
    },
    {
      "id": "c365a231-8572-4a40-8c07-21000690e9af",
      "name": "List?",
      "type": "n8n-nodes-base.if",
      "position": [
        1260,
        760
      ]
    },
    {
      "id": "94d08401-dc68-4979-b94e-600e79000679",
      "name": "Get Test",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1700,
        960
      ]
    },
    {
      "id": "ff451553-cae3-450d-8f0c-ae4a89f146d8",
      "name": "Get Tests ",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1480,
        960
      ]
    },
    {
      "id": "66608e4e-2771-4210-aee8-f1fcb3453cef",
      "name": "Test",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1920,
        960
      ]
    },
    {
      "id": "3e36fbcd-fbe7-4343-8eb7-2ee0c2bac223",
      "name": "Get Questions AND Answers",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2140,
        960
      ]
    },
    {
      "id": "78efdb33-a094-4a36-98f8-30de68292d4c",
      "name": "Upsert pred Answer",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2580,
        960
      ]
    },
    {
      "id": "6ff36dd2-b8b0-4f45-997a-7d098f9eb56f",
      "name": "Request Answer",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2800,
        960
      ]
    },
    {
      "id": "75937466-26c4-424b-ae46-54890d044c12",
      "name": "Get Answer",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1260,
        1160
      ]
    },
    {
      "id": "9638190f-351e-40ee-8708-20231701c650",
      "name": "Result",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2580,
        1160
      ]
    },
    {
      "id": "65c40000-24b8-4317-a3f8-99cf8618b508",
      "name": "Get Question variants",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1480,
        1160
      ]
    },
    {
      "id": "a082da78-ab1a-4e61-8d6b-cb24ffb3ed9d",
      "name": "Update Bot Status on START",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2800,
        1160
      ]
    },
    {
      "id": "1ea5577a-5ac6-4884-9ec3-f20bc17c33e4",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        760
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "0cc3c717-85c3-4cb0-8526-4f4e6b6a54dd",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        520
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "08ed150c-151c-42f9-9f72-cf46b2791011",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        1080
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "f31fa5b3-0c9d-4479-8026-70fc779ed579",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        1080
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "Test": {
      "main": [
        [
          {
            "node": "Get Questions AND Answers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List?": {
      "main": [
        [
          {
            "node": "Get Tests",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Tests ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Result": {
      "main": [
        [
          {
            "node": "Update Bot Status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Starts": {
      "main": [
        [
          {
            "node": "Upsert Bot Status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Commands": {
      "main": [
        [
          {
            "node": "Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "List?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Test": {
      "main": [
        [
          {
            "node": "Test",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Tests": {
      "main": [
        [
          {
            "node": "Union Number with Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Main Menu": {
      "main": [
        [
          {
            "node": "Update Bot Status on START ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Answer": {
      "main": [
        [
          {
            "node": "Get Question variants",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Tests ": {
      "main": [
        [
          {
            "node": "Get Test",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Union list": {
      "main": [
        [
          {
            "node": "List Tests",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define Flow": {
      "main": [
        [
          {
            "node": "Starts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Commands",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Answer": {
      "main": [
        [
          {
            "node": "Get Non-Answered Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Any questions?": {
      "main": [
        [
          {
            "node": "Randomize questions",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Calculate answers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Bot Status": {
      "main": [
        [
          {
            "node": "Define Flow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialization": {
      "main": [
        [
          {
            "node": "Get Bot Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request Answer": {
      "main": [
        [
          {
            "node": "Update Bot Status on TEST",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Initialization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate answers": {
      "main": [
        [
          {
            "node": "Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upsert pred Answer": {
      "main": [
        [
          {
            "node": "Request Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Randomize questions": {
      "main": [
        [
          {
            "node": "Upsert pred Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Question variants": {
      "main": [
        [
          {
            "node": "Update Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Questions AND Answers": {
      "main": [
        [
          {
            "node": "Randomize questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Non-Answered Questions": {
      "main": [
        [
          {
            "node": "Any questions?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Union Number with Question": {
      "main": [
        [
          {
            "node": "Union list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}