This workflow follows the HTTP Request → Supabase recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "SmarterOS - Facturaci\u00f3n Electr\u00f3nica DTE",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "dte-generate",
"responseMode": "responseNode",
"options": {}
},
"id": "webhook-dte",
"name": "Webhook Generar DTE",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"jsCode": "// ============================================\n// PREPARAR DTE PARA LIBREDTE\n// ============================================\n\nconst factura = $input.item.json;\n\n// Mapear datos de Odoo a formato LibreDTE\nconst dteData = {\n tipo_dte: \"33\", // Factura electr\u00f3nica\n folio: factura.folio || 1,\n emisor: {\n rut: \"78233417-4\",\n razon_social: \"SMARTER SPA\",\n giro: \"Consultor\u00eda inform\u00e1tica\",\n direccion: \"Santiago\",\n comuna: \"Santiago\"\n },\n receptor: {\n rut: factura.receptor_rut || \"76.123.456-K\",\n razon_social: factura.receptor_nombre || \"Cliente SpA\",\n giro: factura.receptor_giro || \"Comercio\",\n direccion: factura.receptor_direccion || \"Av. Principal 123\",\n comuna: factura.receptor_comuna || \"Santiago\"\n },\n detalle: factura.lineas || [\n {\n codigo: \"01\",\n cantidad: 1,\n precio: factura.monto_neto || 300000,\n descripcion: factura.descripcion || \"Implementaci\u00f3n SmarterOS\"\n }\n ],\n pagos: {\n forma_pago: factura.forma_pago || \"1\",\n monto_pagado: factura.monto_total || (factura.monto_neto * 1.19)\n }\n};\n\n// Calcular montos\nconst neto = dteData.detalle[0].precio * dteData.detalle[0].cantidad;\nconst iva = neto * 0.19;\nconst total = neto + iva;\n\ndteData.totales = {\n monto_neto: Math.round(neto),\n iva: Math.round(iva),\n monto_total: Math.round(total)\n};\n\nreturn { json: dteData };"
},
"id": "prepare-dte",
"name": "Preparar DTE Format",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
450,
300
]
},
{
"parameters": {
"method": "POST",
"url": "http://libredte-api:8080/api/v1/dte",
"sendHeaders": {
"Content-Type": "application/json"
},
"body": "={{ JSON.stringify($json) }}",
"options": {}
},
"id": "libredte-generate",
"name": "LibreDTE Generar",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
650,
300
]
},
{
"parameters": {
"method": "POST",
"url": "http://libredte-api:8080/api/v1/sii/enviar",
"sendHeaders": {
"Content-Type": "application/json"
},
"body": "{\\\"dte_id\\\": \\\"{{ $json.dte_id }}\\\"}",
"options": {}
},
"id": "libredte-send",
"name": "Enviar al SII",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
850,
300
]
},
{
"parameters": {
"operation": "update",
"schema": "public",
"table": "smarter_events",
"columns": "lifecycle,payload,executed_at",
"filterType": "string",
"filterString": "correlation_id=eq.{{ $json.correlation_id }}"
},
"id": "supabase-update-dte",
"name": "Actualizar en Supabase",
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
1050,
300
],
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"respondWith": "json",
"responseBody": "{\n \"success\": true,\n \"dte_id\": \"={{ $json.dte_id }}\",\n \"estado\": \"{{ $json.estado }}\",\n \"folio\": \"={{ $json.folio }}\",\n \"mensaje\": \"DTE generado y enviado al SII\"\n}",
"options": {}
},
"id": "response-dte",
"name": "Responder OK",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
1250,
300
]
}
],
"connections": {
"Webhook Generar DTE": {
"main": [
[
{
"node": "Preparar DTE Format",
"type": "main",
"index": 0
}
]
]
},
"Preparar DTE Format": {
"main": [
[
{
"node": "LibreDTE Generar",
"type": "main",
"index": 0
}
]
]
},
"LibreDTE Generar": {
"main": [
[
{
"node": "Enviar al SII",
"type": "main",
"index": 0
}
]
]
},
"Enviar al SII": {
"main": [
[
{
"node": "Actualizar en Supabase",
"type": "main",
"index": 0
}
]
]
},
"Actualizar en Supabase": {
"main": [
[
{
"node": "Responder OK",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "dte-facturacion-v1",
"tags": [
{
"name": "smarteros"
},
{
"name": "dte"
},
{
"name": "facturacion"
}
]
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
supabaseApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
SmarterOS - Facturación Electrónica DTE. Uses httpRequest, supabase. Webhook trigger; 6 nodes.
Source: https://github.com/SmarterCL/os.smarterbot.cl/blob/0c9c17e0e6d7e57ba50d1141b656b14242162c9d/n8n-workflows/04-dte-facturacion.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
2. Refresh Pipedrive tokens. Uses stopAndError, stickyNote, supabase, httpRequest. Webhook trigger; 29 nodes.
This workflow provides an OAuth 2.0 auth token refresh process for better control. Developers can utilize it as an alternative to n8n's built-in OAuth flow to achieve improved control and visibility.
Buildnbloom - Typeform to Tier 1 Call. Uses supabase, airtable, httpRequest. Webhook trigger; 17 nodes.
Ai Assistant Workflow. Uses supabase, httpRequest, emailSend. Webhook trigger; 14 nodes.
Automação Master: Pedidos & Reservas (Web & App) - Evolution MultiTenant. Uses httpRequest, supabase. Webhook trigger; 14 nodes.