AutomationFlowsData & Sheets › Smarteros - Respuesta Automática B2b

Smarteros - Respuesta Automática B2b

SmarterOS - Respuesta Automática B2B. Uses postgres, httpRequest. Scheduled trigger; 5 nodes.

Cron / scheduled trigger★★★★☆ complexity5 nodesPostgresHTTP Request
Data & Sheets Trigger: Cron / scheduled Nodes: 5 Complexity: ★★★★☆ Added:

This workflow follows the HTTP Request → Postgres 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 →

Download .json
{
  "name": "SmarterOS - Respuesta Autom\u00e1tica B2B",
  "nodes": [
    {
      "parameters": {
        "batchSize": 1,
        "options": {}
      },
      "id": "trigger-event",
      "name": "Trigger: Nuevo Evento",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "operation": "select",
        "table": "smarter_events",
        "columns": "id,payload,lifecycle",
        "where": "lifecycle='ingested' AND payload->'data'->>'channel'='email'",
        "limit": 10,
        "options": {}
      },
      "id": "fetch-events",
      "name": "Fetch Eventos Pendientes",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.5,
      "position": [
        450,
        300
      ],
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// ============================================\n// CLASIFICACI\u00d3N DE INTENT Y PLANTILLA\n// ============================================\n\nconst events = $input.all();\nconst responses = [];\n\nfor (const event of events) {\n  const payload = event.json.payload;\n  const email = payload.data?.email;\n  const subject = payload.data?.subject || '';\n  const intent = payload.data?.intent || 'general_inquiry';\n  const businessName = payload.data?.business_name || '';\n  \n  if (!email) continue;\n  \n  // Seleccionar plantilla seg\u00fan intent\n  let emailSubject = '';\n  let emailBody = '';\n  \n  if (intent === 'demo_request') {\n    emailSubject = '\ud83d\ude80 Tu demo de SmarterOS est\u00e1 lista';\n    emailBody = `Hola ${businessName || 'equipo'},\n\n\u00a1Gracias por tu inter\u00e9s en SmarterOS!\n\nVimos que quieres una demo de nuestro CRM con automatizaci\u00f3n.\n\n\ud83d\udcc5 **Opciones:**\n\n1. **Demo Guiada (15 min)** \u2192 Agenda aqu\u00ed: https://cal.com/smarterbot/demo\n2. **Demo Auto-guiada** \u2192 Video de 5 min: https://loom.com/smarteros-demo\n3. **Activaci\u00f3n Directa** \u2192 Respond\u00e9 este email y lo activamos ya\n\n\ud83d\udcb0 **Plan recomendado: PRO**\n- CRM con Odoo incluido\n- Automatizaci\u00f3n de ventas\n- Integraci\u00f3n con email, WhatsApp, web\n- $150.000/mes\n\n\u00bfCu\u00e1l opci\u00f3n prefer\u00eds?\n\n\u2014\nEquipo SmarterOS\nhttps://smarterbot.cl`;\n  }\n  else if (intent === 'pricing_request') {\n    emailSubject = '\ud83d\udcb0 Propuesta SmarterOS - Automatizaci\u00f3n B2B';\n    emailBody = `Hola ${businessName || 'equipo'},\n\nGracias por consultar por nuestros planes!\n\n\ud83d\udcca **Nuestros Planes:**\n\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 B\u00c1SICO - $50.000/mes                    \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 \u2022 Captura de leads (web + email)        \u2502\n\u2502 \u2022 Validaci\u00f3n autom\u00e1tica                 \u2502\n\u2502 \u2022 Registro en PostgreSQL                \u2502\n\u2502 \u2022 Soporte b\u00e1sico                        \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 PRO - $150.000/mes \u2b50 RECOMENDADO       \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 \u2022 Todo lo del B\u00e1sico +                  \u2502\n\u2502 \u2022 CRM en Odoo                           \u2502\n\u2502 \u2022 Scoring de leads                      \u2502\n\u2502 \u2022 Pipeline de ventas                    \u2502\n\u2502 \u2022 Integraci\u00f3n WhatsApp                  \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 ENTERPRISE - $300.000/mes               \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 \u2022 Todo lo del Pro +                     \u2502\n\u2502 \u2022 DTE autom\u00e1tico (facturaci\u00f3n)          \u2502\n\u2502 \u2022 Onboarding con Picoclaw               \u2502\n\u2502 \u2022 Auto-learning                         \u2502\n\u2502 \u2022 Analytics avanzado                    \u2502\n\u2502 \u2022 Soporte prioritario 24/7              \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n\ud83c\udfaf **\u00bfCu\u00e1l se ajusta m\u00e1s a tu necesidad?**\n\nRespond\u00e9 este email y te ayudo a activarlo.\n\n\u2014\nEquipo SmarterOS\nhttps://smarterbot.cl`;\n  }\n  else if (intent === 'enterprise_inquiry') {\n    emailSubject = '\ud83c\udfe2 SmarterOS Enterprise - Contacto Directo';\n    emailBody = `Hola ${businessName || 'equipo'},\n\n\u00a1Excelente! Veo que est\u00e1s interesado en nuestra soluci\u00f3n Enterprise.\n\n\ud83c\udfaf **Para empresas que buscan:**\n- Automatizaci\u00f3n completa\n- Facturaci\u00f3n electr\u00f3nica (DTE)\n- M\u00faltiples canales (web, email, WhatsApp, Telegram)\n- Analytics en tiempo real\n- Soporte prioritario\n\n\ud83d\udcbc **Plan Enterprise: $300.000/mes**\n\nIncluye:\n- Todo lo del Plan Pro\n- DTE autom\u00e1tico (SII)\n- Onboarding personalizado\n- Auto-learning (mejora continua)\n- Dashboard analytics\n- Soporte 24/7\n\n\ud83d\udcde **\u00bfAgendamos una llamada de 15 min?**\n\nCalendario: https://cal.com/smarterbot/enterprise\n\nO respond\u00e9 este email con tu horario preferido.\n\n\u2014\nEquipo SmarterOS\nhttps://smarterbot.cl`;\n  }\n  else {\n    emailSubject = '\ud83d\udc4b Gracias por contactar SmarterOS';\n    emailBody = `Hola ${businessName || 'equipo'},\n\n\u00a1Gracias por tu mensaje!\n\n\ud83e\udd16 **SmarterOS** es tu asistente de automatizaci\u00f3n B2B.\n\n\ud83d\udccc **Te ayudo con:**\n- Captura autom\u00e1tica de leads\n- CRM con Odoo\n- Automatizaci\u00f3n de ventas\n- Integraci\u00f3n con email, WhatsApp, web\n- Facturaci\u00f3n electr\u00f3nica (DTE)\n\n\ud83d\udcac **\u00bfEn qu\u00e9 puedo ayudarte?**\n\nRespond\u00e9 este email y te asisto.\n\n\u2014\nEquipo SmarterOS\nhttps://smarterbot.cl`;\n  }\n  \n  responses.push({\n    json: {\n      event_id: event.json.id,\n      to: email,\n      subject: emailSubject,\n      body: emailBody,\n      intent: intent\n    }\n  });\n}\n\nreturn responses;"
      },
      "id": "classify-intent",
      "name": "Clasificar Intent y Preparar Email",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.mailgun.net/v3/smarterbot.cl/messages",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "from",
              "value": "SmarterOS <no-reply@smarterbot.cl>"
            },
            {
              "name": "to",
              "value": "={{ $json.to }}"
            },
            {
              "name": "subject",
              "value": "={{ $json.subject }}"
            },
            {
              "name": "text",
              "value": "={{ $json.body }}"
            },
            {
              "name": "h:Reply-To",
              "value": "hola@smarterbot.cl"
            }
          ]
        },
        "options": {}
      },
      "id": "send-email",
      "name": "Enviar Email de Respuesta (Mailgun)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        850,
        300
      ],
      "credentials": {
        "httpBasicAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "table": "smarter_events",
        "updateKey": "id",
        "updateValue": "={{ $json.event_id }}",
        "columns": "lifecycle,decided_at",
        "options": {}
      },
      "id": "update-event",
      "name": "Actualizar Evento a Respondido",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.5,
      "position": [
        1050,
        300
      ],
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Trigger: Nuevo Evento": {
      "main": [
        [
          {
            "node": "Fetch Eventos Pendientes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Eventos Pendientes": {
      "main": [
        [
          {
            "node": "Clasificar Intent y Preparar Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clasificar Intent y Preparar Email": {
      "main": [
        [
          {
            "node": "Enviar Email de Respuesta (Mailgun)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enviar Email de Respuesta (Mailgun)": {
      "main": [
        [
          {
            "node": "Actualizar Evento a Respondido",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false,
  "triggerCount": 1
}

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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

SmarterOS - Respuesta Automática B2B. Uses postgres, httpRequest. Scheduled trigger; 5 nodes.

Source: https://github.com/SmarterCL/os.smarterbot.cl/blob/0c9c17e0e6d7e57ba50d1141b656b14242162c9d/n8n-workflows/07-auto-response.json — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Data & Sheets

Disparador 1.8. Uses itemLists, postgres, emailSend, httpRequest. Scheduled trigger; 85 nodes.

Item Lists, Postgres, Email Send +1
Data & Sheets

공유회_알림톡_크론. Uses postgres, httpRequest, n8n-nodes-solapi. Scheduled trigger; 39 nodes.

Postgres, HTTP Request, N8N Nodes Solapi
Data & Sheets

QuepasaAutomatic. Uses postgres, postgresTrigger, httpRequest. Scheduled trigger; 39 nodes.

Postgres, Postgres Trigger, HTTP Request
Data & Sheets

QuepasaAutomatic. Uses postgres, postgresTrigger, httpRequest. Scheduled trigger; 39 nodes.

Postgres, Postgres Trigger, HTTP Request
Data & Sheets

QuepasaAutomatic. Uses postgres, postgresTrigger, httpRequest. Scheduled trigger; 39 nodes.

Postgres, Postgres Trigger, HTTP Request