Files
customer-installer/TODO.md

113 lines
3.6 KiB
Markdown
Raw Normal View History

# n8n Customer Provisioning System
2026-01-18 18:25:20 +01:00
## Status: ✅ Phase 1-4 Complete
2026-01-18 18:25:20 +01:00
---
## Implementierte Features
2026-01-18 18:25:20 +01:00
### Phase 1: n8n API Funktionen (libsupabase.sh)
- [x] `n8n_api_login()` - Login mit `emailOrLdapLoginId` (nicht `email`)
- [x] `n8n_api_create_postgres_credential()` - PostgreSQL Credential erstellen
- [x] `n8n_api_create_ollama_credential()` - Ollama Credential erstellen
- [x] `n8n_api_import_workflow()` - Workflow importieren
- [x] `n8n_api_activate_workflow()` - Workflow aktivieren mit `versionId`
- [x] `n8n_generate_rag_workflow_json()` - Built-in Workflow Template
- [x] `n8n_setup_rag_workflow()` - Hauptfunktion für komplettes Setup
### Phase 2: install.sh - Workflow Import
- [x] Login durchführen
- [x] PostgreSQL Credential erstellen und ID speichern
- [x] Ollama Credential erstellen und ID speichern
- [x] Workflow JSON mit korrekten Credential-IDs generieren
- [x] Workflow importieren
- [x] Workflow aktivieren mit `POST /rest/workflows/{id}/activate` + `versionId`
### Phase 3: Externe Workflow-Datei Support
- [x] `--workflow-file <path>` Option hinzugefügt (default: `RAGKI-BotPGVector.json`)
- [x] `--ollama-model <model>` Option hinzugefügt (default: `ministral-3:3b`)
- [x] `--embedding-model <model>` Option hinzugefügt (default: `nomic-embed-text:latest`)
- [x] Python-Script für dynamische Credential-ID-Ersetzung
- [x] Entfernung von `id`, `versionId`, `meta`, `tags`, `active`, `pinData` beim Import
- [x] `RAGKI-BotPGVector.json` als Standard-Workflow-Template
### Phase 4: Tests & Git
- [x] Container sb-1769174647 - Workflow aktiviert ✅
- [x] Container sb-1769180683 - Externe Workflow-Datei ✅
- [x] Git Commits gepusht
---
## Verwendung
2026-01-18 18:25:20 +01:00
### Standard-Installation (mit Default-Workflow)
```bash
bash install.sh --debug
```
### Mit benutzerdefiniertem Workflow
```bash
bash install.sh --debug \
--workflow-file /path/to/custom-workflow.json \
--ollama-model "llama3.2:3b" \
--embedding-model "nomic-embed-text:v1.5"
```
### Verfügbare Optionen
| Option | Default | Beschreibung |
|--------|---------|--------------|
| `--workflow-file` | `RAGKI-BotPGVector.json` | Pfad zur n8n Workflow JSON-Datei |
| `--ollama-model` | `ministral-3:3b` | Ollama Chat-Modell |
| `--embedding-model` | `nomic-embed-text:latest` | Ollama Embedding-Modell |
2026-01-18 18:25:20 +01:00
---
## Technische Details
2026-01-18 18:25:20 +01:00
### n8n REST API Endpoints
2026-01-18 18:25:20 +01:00
| Endpoint | Methode | Beschreibung |
|----------|---------|--------------|
| `/rest/login` | POST | Login (Feld: `emailOrLdapLoginId`, nicht `email`) |
| `/rest/credentials` | POST | Credential erstellen |
| `/rest/workflows` | POST | Workflow importieren |
| `/rest/workflows/{id}/activate` | POST | Workflow aktivieren (benötigt `versionId`) |
2026-01-18 18:25:20 +01:00
### Credential Types
2026-01-18 18:25:20 +01:00
- `postgres` - PostgreSQL Datenbank
- `ollamaApi` - Ollama API
### Workflow-Verarbeitung
Das Python-Script `/tmp/process_workflow.py` im Container:
1. Liest die Workflow-Template-Datei
2. Entfernt Felder: `id`, `versionId`, `meta`, `tags`, `active`, `pinData`
3. Ersetzt alle `postgres` Credential-IDs mit der neuen ID
4. Ersetzt alle `ollamaApi` Credential-IDs mit der neuen ID
5. Schreibt die verarbeitete Workflow-Datei
---
## Git Commits
1. `ff1526c` - feat: Auto-import n8n RAG workflow with credentials
2. `f663708` - fix: Workflow activation with versionId
3. `26f5a73` - feat: External workflow file support with dynamic credential replacement
---
## Nächste Schritte (Optional)
- [ ] Workflow-Validierung vor Import
- [ ] Mehrere Workflows unterstützen
- [ ] Workflow-Update bei bestehenden Containern
- [ ] Backup/Export von Workflows