# Write a corrected HTML that fixes the GeoChart data columns (3 columns only: lat, lon, value)
html = r"""
Uplift — CRM Leads Dashboard (Routes & Cities, Fixed Map)
N8n Integration - CRM
Integration Technical Specification \n\nOverview \nThis specification defines the integration between the Uplift
web application and N8n workflow automation platform for CRM data synchronization. The primary focus is on Hubspot
integration, with extensibility for other CRM systems.
\n\nEstimated Development Time: 31-50
hours
\nOriginal Requirement: Send lead data from Uplift into Hubspot/Salesforce (Hubspot
prioritized)
\n\nSystem Architecture \n\nCore Components \n\nSystem-Level
Configuration: Global N8n settings in system admin \nOrganization-Level Integration:
Per-organization CRM workflow setup \nData Synchronization Engine: Cron-based polling and webhook
triggers \nError Handling & Monitoring: Connection, authentication, and execution
monitoring \n \n\nIntegration Flow \n\nSystem admin configures N8n instance
settings \nOrganization enables N8n integration with scope selection \nSystem creates 4 automated workflows
with webhook nodes \nHubspot private app is created with required permissions \nData synchronization begins via
cron jobs and real-time triggers \n \n\nTechnical Implementation \n\n1. System-Level
Configuration \nAdd new N8n section in system settings with the following fields:
\n\nProject
name: N8n project identifier \nAPI key: N8n API authentication key \nAPI
secret: N8n API secret for secure communication \n \n\n2. Organization Integration Setup \nWithin
Organization > Integrations, add new N8n integration with:
\n\nScope Selection: \n\n☑ CRM
leads \n☑ Requests \n \n\nWorkflow Creation: \nSystem automatically creates 4 workflows with
Webhook nodes:
\n\nLead Creation Workflow: Handles new CRM lead data \nLead Update
Workflow: Processes lead modifications \nRequest Creation Workflow: Manages new trip
requests \nRequest Update Workflow: Handles request changes \n \n\nEach workflow is named:
[organization name] - [workflow type]
\nReturns workflow IDs for tracking and management
\n\n3.
Integration Testing \nBuilt-in testing functionality:
\n\nConnection Test: Verify N8n API
connectivity \nDummy Data Test: Send test payload to workflows \nResponse
Validation: Confirm proper webhook response \n \n\n4. Hubspot Configuration \n\nRequired Hubspot
Permissions: \n\ncrm.objects.contacts.write
\ncrm.objects.contacts.read
\ncrm.objects.deals.read
\ncrm.objects.deals.write
\n \n\nSetup
Process: \n\nCreate private app on Hubspot with required scopes \nCopy access token to organization Hubspot
integration field \nManually configure N8n workflows (initial implementation) \n \n\nData
Synchronization \n\nSynchronization Engine \nDevelop cron job system that:
\n\nRuns every
minute \nRetrieves modified data for selected objects per organization \nGets changes since last successful
run \nUpdates/creates contacts for new leads \n \n\nData Objects and Fields \n\nCRM Lead
Data: \n\ncrmLead.firstName
\ncrmLead.lastName
\ncrmLead.name
\ncrmLead.id
\ncrmLead.createDate
\ncrmLead.modifyDate
\n<
li>crmLead.companyName
\nleads.tripRequestCount
\ncrmLead.alertEnabled
li>\n \n\nPrimary Channels (Related Objects): \n\nleads.primaryEmailCrmChannel.value
\nleads.primaryPhoneCrmChannel.value
\n \n\nAlert
Data: \n\nleads.alertEmail
\nleads.alertPhone
\nalertRoutes.originN
ame
\nalertRoutes.destinationName
\nalertCities.name
\n \n\nTrip
Request Data: \n\ntripRequest.crmLeadId
\ntripRequest.type
(rate/empty leg/fixed
price
route) \ntripRequest.source
\ntripRequest.aircraftModelId
\ntripRequest
.aircraftPreferences
\ntripRequest.aircraftType
\ntripRequest.availableFromDate
\ntripRequest.availableToDate
\ntripRequest.createDate
\ntripRequest.
legId
\ntripRequest.rateTotal
\ntripRequest.notes
\n \n\nData
Processing Rules \n\nExclusions: Exclude all crmLeads created through Airmail
requests \nWebhook Delivery: Post processed data to N8n webhook URLs \n \n\nEvent
Triggers \n\nEvents that Modify CRM Leads: \n\nWidget Events: \n\nSign up for
alert \nChange alert settings (widget or manage alerts page) \nInquire on flight (creates
request) \nInquire on share page \n \n\nApp Events: \n\nCreate CRM lead
manually \nModify CRM lead manually \nModify alert routes and cities \nCreate requests
manually \n \n\nN8n Workflow Configuration \n\nWorkflow Triggering \n\nEach workflow starts
with Webhook node \nUnique URL per workflow:
https://<n8n-domain>/webhook/<workflow-id-or-path>
\nWeb app calls specific webhook URL to
trigger correct workflow \n \n\nAuthentication Options \n\n1. Basic Authentication \n\nRequires
username and password \nCredentials provided via HTTP Basic Auth headers \nConfigure in Webhook node
settings \n \n\n2. Header Authentication \n\nCustom token in header \nSpecify header name and
expected value \nExample: X-API-Token: your-secret-token
\n \n\n3. JWT
Authentication \n\nJSON Web Tokens for authentication \nConfigure JWT credentials in N8n \nSelect
in Webhook node settings \n \n\nMultiple Environment Support \n\nDifferent webhook URLs per environment
(dev, staging, prod) \nEnvironment identifier as webhook parameter \nWorkflow parameters for
environment-specific behavior \n \n\nHubspot Integration Mapping \n\nData Mapping Strategy \nMap
Uplift crmLeads and related objects to HubSpot Contacts and Deals:
\n\nDeduplication
Logic: \n\nPrimary: Match on email address \nSecondary: Match on custom
property crmLeadId
\n \n\nObject Relationships: \n\nContacts: One HubSpot
Contact per crmLead \nDeals: Optional Deal creation on first
inquiry/interest \nCustom Objects: Use HubSpot Enterprise features if available for detailed alert
preferences \n \n\nStandard vs. Custom Properties \nIdentify which HubSpot properties are standard vs. must
be added as custom properties for complete data mapping.
\n\nError Handling & Monitoring \n\nFailure
Detection \nMonitor and notify for failures related to:
\n\nConnection Issues: N8n API
connectivity problems \nAuthentication Failures: Invalid credentials or expired
tokens \nWorkflow Execution Errors: Runtime failures in N8n workflows \n \n\nIntegration
Lifecycle \n\nDeactivation: When integration deleted in Uplift, mark inactive in
N8n \nReactivation: Support for re-enabling disabled integrations \n \n\nUser
Interface \n\nIntegration Creation Dialog \nOrganization > Integrations page with \"N8n\" provider
option:
\n\nProvider: Dropdown selection \nN8n workflow name:
Auto-generated as [organization name] - integration ID \nSync options: Checkboxes for CRM leads and
Requests \nActions: Create/Save, Cancel, Test integration \n \n\nTest Integration
Interface \nModal dialog showing:
\n\nConnection status \nTest response from N8n \nError
details if test fails \nClose/Re-test options \n \n\nImplementation Phases \n\nPhase 1: Core
Integration (20-30h) \n\nSystem and organization-level configuration \nBasic webhook workflow
creation \nHubspot authentication setup \nPrimary data synchronization \n \n\nPhase 2: Advanced
Features (11-20h) \n\nComprehensive error handling \nIntegration testing interface \nMonitoring and
notifications \nPerformance optimization \n \n\nSecurity Considerations \n\n\nAPI
Security: Secure storage of N8n API credentials \nWebhook Security: Authentication for all
webhook endpoints \nData Privacy: Compliance with data protection regulations \nAccess
Control: Role-based permissions for integration management \n \n\nTesting
Strategy \n\nIntegration Testing \n\nEnd-to-end workflow testing \nData integrity
validation \nError scenario testing \nPerformance under load \n \n\nUser Acceptance
Testing \n\nOrganization setup workflow \nData synchronization accuracy \nError handling user
experience \nIntegration management interface \n \n\nFuture
Enhancements \n\n\nMulti-CRM Support: Salesforce, Pipedrive, etc. \nReal-time
Sync: WebSocket-based real-time updates \nCustom Field Mapping: User-configurable field
relationships \nWorkflow Templates: Pre-built workflows for common
scenarios \nAnalytics Dashboard: Integration performance metrics \n