{
  "name": "Collect WhatsApp questionnaire responses in Postgres (Module \"Anketa\")",
  "nodes": [
    {
      "id": "74e77f18-8de5-4f3b-95ef-d97b38a8af97",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        40,
        760
      ]
    },
    {
      "id": "13dfccbd-47d9-434b-8c54-4b7b33364f49",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        520
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "688a5af7-20df-4292-a6bc-d28e93aa4a24",
      "name": "Starts",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        480,
        560
      ]
    },
    {
      "id": "c31015af-d2ea-477a-b039-f99d4994a334",
      "name": "Get Bot Status",
      "type": "n8n-nodes-base.postgres",
      "position": [
        480,
        760
      ]
    },
    {
      "id": "7db6bdbb-e9c8-4b1f-9a8d-f65557884af6",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        1340
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "3ccf8ac8-78b4-4332-a92f-c0c6ccdea135",
      "name": "Commands",
      "type": "n8n-nodes-base.switch",
      "position": [
        980,
        760
      ]
    },
    {
      "id": "c88213ae-81d5-4bfa-9de0-7fa45979abd6",
      "name": "Main Menu",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1260,
        560
      ]
    },
    {
      "id": "a7411083-1ad9-4295-9f16-86baccb234b9",
      "name": "Initialization",
      "type": "n8n-nodes-base.set",
      "position": [
        260,
        760
      ]
    },
    {
      "id": "173729da-c067-4a76-93df-35d2ffbcfd54",
      "name": "Starts Test",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1260,
        760
      ]
    },
    {
      "id": "2ce61e6d-bca9-4efd-8fd3-3a9e2ad9b590",
      "name": "Get First Question",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1480,
        760
      ]
    },
    {
      "id": "d8747f70-ab23-49ee-87ec-798786711bd9",
      "name": "Update Bot Status on ANKETA",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1920,
        760
      ]
    },
    {
      "id": "d88b9f5d-7529-4a20-89a5-4007f30b9535",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1860,
        720
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "f57e0e75-49e9-42ff-965d-b5cb6084ebee",
      "name": "Define Flow",
      "type": "n8n-nodes-base.switch",
      "position": [
        700,
        760
      ]
    },
    {
      "id": "0fc45a08-2719-43fb-8999-637b68d29ce0",
      "name": "Update Bot Status on START",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2340,
        1180
      ]
    },
    {
      "id": "786e1ad6-5bb8-4ac5-a923-fafadabcc499",
      "name": "Get Available Questions",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1700,
        980
      ]
    },
    {
      "id": "5ebe7749-4f5f-44ec-b041-16a9a62e93cd",
      "name": "Is Questions available?",
      "type": "n8n-nodes-base.if",
      "position": [
        1920,
        980
      ]
    },
    {
      "id": "b65f351d-78b5-46da-bd73-93d0ceb2a919",
      "name": "Is Question found? ",
      "type": "n8n-nodes-base.if",
      "position": [
        1480,
        980
      ]
    },
    {
      "id": "2cccfa58-1492-4420-ab5b-42f16ac53e96",
      "name": "First Question",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1700,
        760
      ]
    },
    {
      "id": "feacdb2b-de64-4784-85e8-a12b35992384",
      "name": "Question",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2140,
        980
      ]
    },
    {
      "id": "df3eb202-da56-4c03-b4c4-61b557d786eb",
      "name": "Add prev Answer",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2340,
        980
      ]
    },
    {
      "id": "a6818f00-dd39-4cbd-8f0a-018a80ef6064",
      "name": "Add Answer",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1700,
        1180
      ]
    },
    {
      "id": "104a660d-5032-413f-a72f-62ae74e9d12f",
      "name": "Finish Anketa",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2140,
        1180
      ]
    },
    {
      "id": "11b6580c-f083-45c6-8524-424c2ceef63b",
      "name": "Get prev Answer",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1260,
        980
      ]
    },
    {
      "id": "bfb2e3bd-7663-449d-8e61-b6125935aa3b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        720
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "5d5d103e-9365-4f62-9efe-8199ed8f5ce5",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        960
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "199c0247-ecbd-4693-9572-1e70da007b44",
      "name": "Upsert Bot Status on START",
      "type": "n8n-nodes-base.postgres",
      "position": [
        700,
        560
      ]
    },
    {
      "id": "a164b652-b8cc-4edf-a552-293d613deb2e",
      "name": "Add prev Answer ",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2140,
        760
      ]
    },
    {
      "id": "60a9c88a-c156-4b3f-abfd-f2f30b492058",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        760
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "1c5c37c4-89e8-4ed4-9013-0a9c3c1748d1",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        520
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "70f96a8e-c191-4f0e-9073-1f9bb1e8ef36",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        1080
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "d4f4e891-0c3b-425f-9dab-c83396cf4e27",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        1080
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "679715b4-677a-42c4-93ae-aba55a6cdc49",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        520
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "Starts": {
      "main": [
        [
          {
            "node": "Upsert Bot Status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Commands": {
      "main": [
        [
          {
            "node": "Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Starts Test",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Question": {
      "main": [
        [
          {
            "node": "Add prev Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Answer": {
      "main": [
        [
          {
            "node": "Get Available Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define Flow": {
      "main": [
        [
          {
            "node": "Starts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Commands",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get prev Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Starts Test": {
      "main": [
        [
          {
            "node": "Get First Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Finish Anketa": {
      "main": [
        [
          {
            "node": "Update Bot Status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "First Question": {
      "main": [
        [
          {
            "node": "Update Bot Status on ANKETA",
            "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
          }
        ]
      ]
    },
    "Get prev Answer": {
      "main": [
        [
          {
            "node": "Is Question found? ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Initialization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get First Question": {
      "main": [
        [
          {
            "node": "First Question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Question found? ": {
      "main": [
        [
          {
            "node": "Get Available Questions",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Available Questions": {
      "main": [
        [
          {
            "node": "Is Questions available?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Questions available?": {
      "main": [
        [
          {
            "node": "Question",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Finish Anketa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Bot Status on START": {
      "main": [
        []
      ]
    },
    "Update Bot Status on ANKETA": {
      "main": [
        [
          {
            "node": "Add prev Answer ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}