{
  "name": "flowsulting · Leads qualifizieren → CRM → Nachfassen",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "lead/neu",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "leads-t1",
      "name": "Neuer Lead",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "webhookId": "leads-t1"
    },
    {
      "parameters": {
        "url": "={{ $json.website }}",
        "method": "GET",
        "options": {
          "timeout": 15000
        }
      },
      "id": "leads-a1",
      "name": "Firma anreichern",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        280,
        0
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "Bewerte diesen Lead gegen unser Wunschkundenprofil. Gib Score 0-100, drei Gründe und den besten nächsten Schritt.\n\n{{ JSON.stringify($json) }}",
        "messages": {}
      },
      "id": "leads-a2",
      "name": "Passt der Lead?",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.5,
      "position": [
        560,
        0
      ]
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "heiss",
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "version": 2
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "heiss",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.stufe }}",
                    "rightValue": "heiss"
                  }
                ]
              }
            },
            {
              "outputKey": "warm",
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "version": 2
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "warm",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.stufe }}",
                    "rightValue": "warm"
                  }
                ]
              }
            },
            {
              "outputKey": "kalt",
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "version": 2
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "kalt",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.stufe }}",
                    "rightValue": "kalt"
                  }
                ]
              }
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "id": "leads-b1",
      "name": "Wie heiß?",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        840,
        0
      ]
    },
    {
      "parameters": {},
      "id": "leads-c1",
      "name": "Anruf-Aufgabe für Sie",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1120,
        -200
      ]
    },
    {
      "parameters": {
        "fromEmail": "info@flowsulting.de",
        "toEmail": "={{ $json.email }}",
        "subject": "Kurz zu Ihrer Anfrage",
        "emailFormat": "html",
        "html": "={{ $json.html }}",
        "options": {}
      },
      "id": "leads-c2",
      "name": "Nachfass-Strecke starten",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1120,
        200
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000
    },
    {
      "parameters": {
        "operation": "insert",
        "schema": {
          "__rl": true,
          "value": "public",
          "mode": "list"
        },
        "table": {
          "__rl": true,
          "value": "leads",
          "mode": "list"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "firma": "={{ $json.firma }}",
            "kontakt": "={{ $json.kontakt }}",
            "email": "={{ $json.email }}",
            "score": "={{ $json.score }}",
            "stufe": "={{ $json.stufe }}",
            "quelle": "={{ $json.quelle }}"
          }
        },
        "options": {}
      },
      "id": "leads-d1",
      "name": "Im CRM festhalten",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.5,
      "position": [
        1400,
        0
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4.1-mini",
          "mode": "list"
        },
        "options": {
          "temperature": 0.2
        }
      },
      "id": "leads-llm",
      "name": "KI-Modell",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.1,
      "position": [
        560,
        260
      ]
    }
  ],
  "connections": {
    "Neuer Lead": {
      "main": [
        [
          {
            "node": "Firma anreichern",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Firma anreichern": {
      "main": [
        [
          {
            "node": "Passt der Lead?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Passt der Lead?": {
      "main": [
        [
          {
            "node": "Wie heiß?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wie heiß?": {
      "main": [
        [
          {
            "node": "Anruf-Aufgabe für Sie",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Nachfass-Strecke starten",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anruf-Aufgabe für Sie": {
      "main": [
        [
          {
            "node": "Im CRM festhalten",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Nachfass-Strecke starten": {
      "main": [
        [
          {
            "node": "Im CRM festhalten",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "KI-Modell": {
      "ai_languageModel": [
        [
          {
            "node": "Passt der Lead?",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": [
    {
      "name": "flowsulting"
    },
    {
      "name": "Vertrieb & Angebote"
    }
  ]
}
