{
  "name": "BACH Email Monitor",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "*/5 * * * *"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ],
      "name": "Alle 5 Minuten"
    },
    {
      "parameters": {
        "url": "http://localhost:8000/api/webhook/email-check",
        "method": "POST"
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        500,
        300
      ],
      "name": "BACH Email-Check"
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.new_emails }}",
              "operation": "isNotEmpty"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        750,
        300
      ],
      "name": "Neue Emails?"
    },
    {
      "parameters": {
        "url": "http://localhost:8000/api/webhook/email-process",
        "method": "POST",
        "sendBody": true
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        1000,
        200
      ],
      "name": "Emails verarbeiten"
    }
  ],
  "connections": {
    "Alle 5 Minuten": {
      "main": [
        [
          {
            "node": "BACH Email-Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BACH Email-Check": {
      "main": [
        [
          {
            "node": "Neue Emails?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Neue Emails?": {
      "main": [
        [
          {
            "node": "Emails verarbeiten",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false,
  "tags": [
    {
      "name": "BACH"
    },
    {
      "name": "Email"
    }
  ]
}