Commit Graph

15 Commits

Author SHA1 Message Date
Claude Code
6b60059c00 feat: HTML email template, structured text storage and Freescout design
compose.yaml:
- Add hostname n8n.eks-intec.de to fix SMTP HELO rejection
- Add NODE_TLS_REJECT_UNAUTHORIZED=0 for internal CA trust

workflow-a-http.json:
- Replace Set node with Code node for reliable data extraction
- Strip HTML from thread bodies before AI analysis
- Preserve newlines as ¶ (pilcrow) in DB storage instead of flattening

workflow-b-http.json:
- Add Prepare Email Body node: restores ¶→\n, strips markdown,
  converts numbered lists to <ol><li>, generates HTML email template
- Switch emailSend from plain text to HTML+text (multipart)
- Fix Log Reply to Freescout: use MAX(created_at)+1s to ensure
  n8n reply appears as newest thread regardless of email header timestamps
- Fix emailSend typeVersion 1 with text field for reliable expression support
- Correct Freescout thread INSERT: type=2, cc/bcc='[]', customer_id via subquery

freescout-templates/:
- Modern reply_fancy.blade.php: blue header bar with mailbox name and
  ticket number badge, quoted thread styling with left border accent, footer
- Modern auto_reply.blade.php: matching design for auto-reply emails
- Deploy to server: scp to /tmp, apply with sudo cp + artisan view:clear

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 17:27:49 +01:00
Claude Code
580dfc25e3 fix: revert to Set nodes instead of Code nodes for reliability
- Extract node: Use Set node with proper field mappings
- Parse node: Use Set node with try-catch error handling for JSON parsing
- Set nodes are more stable and better supported in n8n
- Both nodes now handle data transformation without code execution issues
2026-03-17 11:45:03 +01:00
Claude Code
7b7f9e2703 fix: correct Code node parameters for typeVersion 1
- Change typeVersion from 2 to 1 for Code nodes
- Rename 'jsCode' parameter to 'functionCode' for compatibility
- Both Extract and Parse nodes use proper format now
2026-03-17 11:43:27 +01:00
Claude Code
41394554f0 refactor: complete workflow redesign with Code nodes and proper data flow
- Replace Set nodes with Code nodes for JavaScript-based data transformation
- Code node in Extract: maps data array to individual items for iteration
- Code node in Parse: handles JSON parsing with error fallback
- Replace If node with Switch node for more reliable conditional logic
- Remove Split Results node entirely - handled in Code nodes
- Proper error handling for malformed LLM responses
- Should resolve all undefined/toLowerCase errors
2026-03-17 11:42:10 +01:00
Claude Code
be2068b7e4 fix: add error handling and fallback values in Parse AI Response node
- Add optional chaining (?.) for safe navigation of response properties
- Add fallback values if response fields are missing
- Extract vertrauen field directly in Parse node for easier reference
- Update Check Confidence node to reference $json.vertrauen instead of nested path
- Handles cases where LLM response format is unexpected
2026-03-17 11:29:32 +01:00
Claude Code
9f13d7f63d fix: use splitInBatches with basePath option instead of itemLists
- Revert to splitInBatches node type for compatibility
- Add basePath option set to 'data' to extract items from data array
- This tells n8n to iterate over the data array specifically
2026-03-17 11:11:19 +01:00
Claude Code
2fb4a54f75 fix: add Item Lists node to properly split data array from SQL response
- Replace splitInBatches with itemLists node for better data handling
- Configure splitField to 'data' to extract individual items from API response
- Adjust node positions and connections accordingly
- Fixes issue where only first item was being processed
2026-03-17 11:06:50 +01:00
Claude Code
b8d9023d00 fix: update LLM model to gpt-oss_120b_128k-gpu
- Replace unavailable gpt-3.5-turbo with available gpt-oss_120b_128k-gpu model
- Model is confirmed available on LiteLLM API endpoint
- Maintains all prompt structure and JSON response requirements
2026-03-17 11:02:47 +01:00
Claude Code
ce921f603d fix: correct SQL query syntax in Workflow A - replace NOT IN with LEFT JOIN for MariaDB compatibility
- Use LEFT JOIN with IS NULL condition instead of NOT IN subquery
- Change GROUP_CONCAT separator from '\n' to ',' (MariaDB syntax)
- Query now successfully returns unprocessed conversations from Freescout DB
- Verified: returns 20 conversations with proper data structure
2026-03-17 10:41:48 +01:00
Claude Code
96d70d9edf fix: resolve MariaDB collation error by switching from mysql-connector to PyMySQL
- Replace mysql-connector-python with PyMySQL driver for better MariaDB compatibility
- PyMySQL handles utf8mb4_0900_ai_ci collation properly without errors
- Update Dockerfile.sql-executor to install PyMySQL and psycopg2-binary
- Refactor sql-query-executor.py to use PyMySQL API (pymysql.connect, DictCursor)
- Verified sql-executor service with SELECT, INSERT, UPDATE operations on Freescout DB
- Add n8n workflow definitions: workflow-a-http.json and workflow-b-http.json
  * Workflow A: Polls unprocessed conversations, analyzes with LiteLLM, saves suggestions
  * Workflow B: Polls approved suggestions, executes Baramundi jobs or email replies
- Update compose.yaml with sql-executor service configuration and dependencies

All SQL operations now execute successfully against MariaDB 11.3.2
2026-03-17 09:31:03 +01:00
c67561e047 feat: workflow C – knowledge base auto-update 2026-03-16 17:21:33 +01:00
5457a8de39 feat: workflow B – approval gate and execution 2026-03-16 17:16:02 +01:00
2a636a7a46 fix: correct JSON syntax and n8n expressions in workflow A 2026-03-16 17:13:26 +01:00
2195cd22da feat: workflow A – mail processing and KI analysis 2026-03-16 17:10:41 +01:00
527d55b040 docs: n8n setup and credential configuration 2026-03-16 17:07:16 +01:00