Add improved n8n workflow with enhanced AI analysis#15
Open
alexmosquerac wants to merge 4 commits intomouredev:mainfrom
Open
Add improved n8n workflow with enhanced AI analysis#15alexmosquerac wants to merge 4 commits intomouredev:mainfrom
alexmosquerac wants to merge 4 commits intomouredev:mainfrom
Conversation
alexmosquerac
commented
Dec 4, 2025
- Added structured CRO analysis with NEXA framework (5 pillars with scoring)
- Implemented two-stage OpenAI processing: analysis + professional report generation
- Enhanced metadata extraction (title, description, h1) for better context
- Added professional HTML email template with visual design
- Improved scoring system (0-50 points) for quantitative assessment
- Separated technical analysis from persuasive copywriting
- Added structured CRO analysis with NEXA framework (5 pillars with scoring) - Implemented two-stage OpenAI processing: analysis + professional report generation - Enhanced metadata extraction (title, description, h1) for better context - Added professional HTML email template with visual design - Improved scoring system (0-50 points) for quantitative assessment - Separated technical analysis from persuasive copywriting
- Added X-API-Key header for secure communication between n8n and Lovable - API Key: nexa_45b52642066f47f2182bb0517905dab12626a82b68995704090354fb23cd34e4 - Protects /api/save-audit-lead endpoint from unauthorized access
CHANGES: - Fixed Supabase Edge Function URL (removed double https://) - Changed API key header from X-API-Key to x-api-key (lowercase) - Added analysis_status field to payload - Created comprehensive step-by-step implementation guide - Added test script for workflow validation - Included troubleshooting section FILES: - n8n-workflow-definitivo.json: Corrected workflow ready to import - test-workflow.sh: Automated test script - GUIA-IMPLEMENTACION-DEFINITIVA.md: Complete implementation guide with checklist
CRITICAL FIX: Resolved Resend JSON validation error
- Fixed jsonBody in Resend node: removed extra quotes around html field
- Corrected format: "html": {{ JSON.stringify(...) }} (without external quotes)
- Updated all node references to match current naming (e.g., HTML to Text - Limpiar + Metadatos1)
- Maintained proper JSON.stringify() usage for HTML content escaping
- All credentials and IDs preserved from working configuration
This workflow is now ready for direct import and use.
WORKFLOW INCLUDES:
- Webhook trigger (POST)
- Google Sheets lead logging
- HTML scraping and cleaning with metadata extraction
- OpenAI GPT-4o dual-stage analysis (CRO audit + HTML report generation)
- Supabase Edge Function integration for database storage
- Resend email delivery with professional HTML template
- Webhook response confirmation
FILES:
- n8n-workflow-FINAL-CORREGIDO.json: Complete corrected workflow ready to import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.