{
  "name": "Kontaktformular zu CRM und Slack",
  "nodes": [
    {
      "parameters": {
        "path": "kontaktformular-crm-slack",
        "httpMethod": "POST",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "kontaktformular-empfangen",
      "name": "Kontaktformular empfangen",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "mode": "manual",
        "duplicateItem": false,
        "assignments": {
          "assignments": [
            {
              "id": "name",
              "name": "name",
              "value": "={{ $json.name || \"Demo Kontakt\" }}",
              "type": "string"
            },
            {
              "id": "email",
              "name": "email",
              "value": "={{ $json.email || \"kunde@example.com\" }}",
              "type": "string"
            },
            {
              "id": "nachricht",
              "name": "nachricht",
              "value": "={{ $json.message || \"Bitte melden.\" }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "pflichtfelder-bereinigen",
      "name": "Pflichtfelder bereinigen",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        260,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "conditions": [
            {
              "leftValue": "={{ $json.email }}",
              "rightValue": "@",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ]
        },
        "options": {}
      },
      "id": "e-mail-gueltig",
      "name": "E-Mail gueltig?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        520,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://example.com/api/crm/leads",
        "sendBody": true,
        "contentType": "json",
        "jsonBody": "={\"email\":\"{{$json.email}}\",\"name\":\"{{$json.name}}\",\"quelle\":\"Kontaktformular\"}",
        "options": {}
      },
      "id": "crm-lead-anlegen",
      "name": "CRM Lead anlegen",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        780,
        -140
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://example.com/api/crm/tasks",
        "sendBody": true,
        "contentType": "json",
        "jsonBody": "={\"email\":\"{{$json.email}}\",\"aufgabe\":\"Rueckmeldung\"}",
        "options": {}
      },
      "id": "crm-aufgabe-erstellen",
      "name": "CRM Aufgabe erstellen",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1040,
        -140
      ]
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "post",
        "channel": "#team",
        "text": "={{ \"Neue Kontaktanfrage von \" + $json.email }}"
      },
      "id": "team-in-slack-benachrichtigen",
      "name": "Team in Slack benachrichtigen",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        1300,
        -140
      ]
    },
    {
      "parameters": {
        "fromEmail": "team@example.com",
        "toEmail": "kunde@example.com",
        "subject": "Danke fuer Ihre Anfrage",
        "html": "<p>Danke, wir melden uns zeitnah.</p>",
        "options": {}
      },
      "id": "auto-antwort-senden",
      "name": "Auto Antwort senden",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1300,
        90
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={\"ok\":true}",
        "options": {}
      },
      "id": "erfolg-an-website-senden",
      "name": "Erfolg an Website senden",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.4,
      "position": [
        1560,
        -20
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={\"ok\":false,\"message\":\"Bitte E-Mail pruefen\"}",
        "options": {}
      },
      "id": "fehler-an-website-senden",
      "name": "Fehler an Website senden",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.4,
      "position": [
        780,
        170
      ]
    }
  ],
  "connections": {
    "Kontaktformular empfangen": {
      "main": [
        [
          {
            "node": "Pflichtfelder bereinigen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pflichtfelder bereinigen": {
      "main": [
        [
          {
            "node": "E-Mail gueltig?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "E-Mail gueltig?": {
      "main": [
        [
          {
            "node": "CRM Lead anlegen",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fehler an Website senden",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CRM Lead anlegen": {
      "main": [
        [
          {
            "node": "CRM Aufgabe erstellen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CRM Aufgabe erstellen": {
      "main": [
        [
          {
            "node": "Team in Slack benachrichtigen",
            "type": "main",
            "index": 0
          },
          {
            "node": "Auto Antwort senden",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Team in Slack benachrichtigen": {
      "main": [
        [
          {
            "node": "Erfolg an Website senden",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Auto Antwort senden": {
      "main": [
        [
          {
            "node": "Erfolg an Website senden",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  }
}
