{ "name": "BotKonzept - Customer Registration & Trial Management", "nodes": [ { "parameters": { "httpMethod": "POST", "path": "botkonzept-registration", "responseMode": "responseNode", "options": {} }, "id": "webhook-registration", "name": "Registration Webhook", "type": "n8n-nodes-base.webhook", "typeVersion": 1.1, "position": [250, 300], "webhookId": "botkonzept-registration" }, { "parameters": { "conditions": { "string": [ { "value1": "={{$json.body.email}}", "operation": "isNotEmpty" }, { "value1": "={{$json.body.firstName}}", "operation": "isNotEmpty" }, { "value1": "={{$json.body.lastName}}", "operation": "isNotEmpty" } ] } }, "id": "validate-input", "name": "Validate Input", "type": "n8n-nodes-base.if", "typeVersion": 1, "position": [450, 300] }, { "parameters": { "operation": "insert", "schema": "public", "table": "customers", "columns": "email,first_name,last_name,company,status,created_at,trial_end_date", "additionalFields": { "returnFields": "*" } }, "id": "create-customer", "name": "Create Customer in DB", "type": "n8n-nodes-base.postgres", "typeVersion": 2.4, "position": [650, 200], "credentials": { "postgres": { "id": "supabase-local", "name": "Supabase Local" } } }, { "parameters": { "authentication": "privateKey", "command": "=/root/customer-installer/install.sh --storage local-zfs --bridge vmbr0 --ip dhcp --vlan 90 --apt-proxy http://192.168.45.2:3142 --n8n-owner-email {{ $json.email }} --n8n-owner-pass \"{{ $('Generate-Password').item.json.password }}\"", "cwd": "/root/customer-installer/" }, "id": "create-instance", "name": "Create Customer Instance", "type": "n8n-nodes-base.ssh", "typeVersion": 1, "position": [850, 200], "credentials": { "sshPrivateKey": { "id": "pve20-ssh", "name": "PVE20" } } }, { "parameters": { "jsCode": "// Parse installation output\nconst stdout = $input.item.json.stdout;\nconst installData = JSON.parse(stdout);\n\n// Add customer info\ninstallData.customer = {\n id: $('Create Customer in DB').item.json.id,\n email: $('Create Customer in DB').item.json.email,\n firstName: $('Create Customer in DB').item.json.first_name,\n lastName: $('Create Customer in DB').item.json.last_name,\n company: $('Create Customer in DB').item.json.company\n};\n\nreturn installData;" }, "id": "parse-install-output", "name": "Parse Install Output", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [1050, 200] }, { "parameters": { "operation": "insert", "schema": "public", "table": "instances", "columns": "customer_id,ctid,hostname,ip,fqdn,status,credentials,created_at,trial_end_date", "additionalFields": {} }, "id": "save-instance", "name": "Save Instance to DB", "type": "n8n-nodes-base.postgres", "typeVersion": 2.4, "position": [1250, 200], "credentials": { "postgres": { "id": "supabase-local", "name": "Supabase Local" } } }, { "parameters": { "fromEmail": "noreply@botkonzept.de", "toEmail": "={{ $json.customer.email }}", "subject": "Willkommen bei BotKonzept - Ihre Instanz ist bereit! 🎉", "emailType": "html", "message": "=\n\n
\n \n \n\n\nIhre KI-Chatbot-Instanz ist bereit
\nHallo {{ $json.customer.firstName }},
\n \nvielen Dank für Ihre Registrierung! Ihre persönliche KI-Chatbot-Instanz wurde erfolgreich erstellt und ist jetzt einsatzbereit.
\n \nDashboard-URL:
\n {{ $json.urls.n8n_external }}
E-Mail: {{ $json.n8n.owner_email }}
\n Passwort: {{ $json.n8n.owner_password }}
Chat-Webhook:
\n {{ $json.urls.chat_webhook }}
Upload-Formular:
\n {{ $json.urls.upload_form }}
💰 Frühbucher-Angebot:
\nUpgraden Sie in den nächsten 3 Tagen und erhalten Sie 30% Rabatt auf Ihr erstes Jahr!
\nTrial-Zeitraum: 7 Tage (bis {{ $json.trial_end_date }})
\n \nBei Fragen stehen wir Ihnen jederzeit zur Verfügung!
\n \nViel Erfolg mit Ihrem KI-Chatbot!
\n Ihr BotKonzept-Team