AutomationFlowsAI & RAG › Daily Email Summary Workflow

Daily Email Summary Workflow

Original n8n title: N8n Email Diario Sem Ollama Fixed

n8n_email_diario_sem_ollama_fixed. Uses httpRequest, emailSend. Scheduled trigger; 10 nodes.

Cron / scheduled trigger★★★★☆ complexity10 nodesHTTP RequestEmail Send
AI & RAG Trigger: Cron / scheduled Nodes: 10 Complexity: ★★★★☆ Added:

This workflow follows the Emailsend → HTTP Request 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": "n8n_email_diario_sem_ollama_fixed",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "id": "21b45205-19ba-4ae1-87ac-dfa02520b38f",
      "name": "Agendamento Di\u00e1rio (7:30)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        20,
        -120
      ]
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "url": "http://backend:8000/api/v1/admin/users",
        "options": {}
      },
      "id": "a4b3441f-38ff-4676-adfb-fe32f7d6078c",
      "name": "Obter Lista de Usu\u00e1rios",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        240,
        -120
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Filtra apenas usu\u00e1rios com email v\u00e1lido\nconst usuarios = $input.all();\nconsole.log('Total de usu\u00e1rios:', usuarios.length);\n\n// Filtra apenas os que t\u00eam email\nconst usuariosComEmail = usuarios.filter(u => u.json && u.json.email && u.json.email.includes('@'));\nconsole.log('Usu\u00e1rios com email:', usuariosComEmail.length);\n\n// Debug - mostra os primeiros 3 usu\u00e1rios\nif (usuariosComEmail.length > 0) {\n  console.log('Primeiro usu\u00e1rio com email:', JSON.stringify(usuariosComEmail[0].json));\n}\n\nreturn usuariosComEmail;"
      },
      "id": "dbc0fca1-e365-4ab0-84f7-b2917bde76cb",
      "name": "Usu\u00e1rios com Email",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        460,
        -120
      ]
    },
    {
      "parameters": {
        "batchSize": 1,
        "options": {}
      },
      "id": "0c57217b-d6d5-4ca6-ad36-1a636279f146",
      "name": "Processar por Usu\u00e1rio",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 2,
      "position": [
        680,
        -120
      ]
    },
    {
      "parameters": {
        "functionCode": "// Obter o ID do usu\u00e1rio para debug\nconst item = $input.item;\nconst usuarioAtual = item.json;\n\n// Imprimir detalhes para debug\nconsole.log('Processando usu\u00e1rio:', JSON.stringify(usuarioAtual));\nconsole.log('ID do usu\u00e1rio:', usuarioAtual.id);\n\nreturn $input.item;"
      },
      "id": "c7b781a1-e365-4ab0-94f7-b2917bce76cb",
      "name": "Debug ID Usu\u00e1rio",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        800,
        -120
      ]
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "url": "=http://backend:8000/api/v1/admin/tasks/user/{{$json.id}}",
        "options": {}
      },
      "id": "672057cd-eb14-42a9-9d57-7e384e488654",
      "name": "Obter Tarefas do Usu\u00e1rio",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        900,
        -120
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Processar os dados do usu\u00e1rio e suas tarefas\nconst usuario = $node[\"Debug ID Usu\u00e1rio\"].json;\nconst tarefas = $json;\n\n// Log para debug\nconsole.log(`Usu\u00e1rio: ${usuario.name}, ID: ${usuario.id}, Email: ${usuario.email}`);\nconsole.log(`Tarefas recebidas: ${tarefas.length}`);\nif (tarefas.length > 0) {\n  console.log('Exemplo de tarefa:', JSON.stringify(tarefas[0]));\n}\n\n// Data atual\nconst hoje = new Date();\nconst amanha = new Date(hoje);\namanha.setDate(hoje.getDate() + 1);\n\n// Formatar data\nconst dataFormatada = hoje.toLocaleDateString('pt-BR');\n\n// Filtrar tarefas\nconst tarefasHoje = tarefas.filter(t => {\n  if (!t.due_date) return false;\n  const data = new Date(t.due_date);\n  return data.toDateString() === hoje.toDateString();\n});\n\nconst tarefasAmanha = tarefas.filter(t => {\n  if (!t.due_date) return false;\n  const data = new Date(t.due_date);\n  return data.toDateString() === amanha.toDateString();\n});\n\nconst tarefasAtrasadas = tarefas.filter(t => {\n  if (!t.due_date || t.status === 'done') return false;\n  const data = new Date(t.due_date);\n  return data < hoje && data.toDateString() !== hoje.toDateString();\n});\n\n// Log para debug de categoriza\u00e7\u00e3o\nconsole.log(`Tarefas para hoje: ${tarefasHoje.length}`);\nconsole.log(`Tarefas para amanh\u00e3: ${tarefasAmanha.length}`);\nconsole.log(`Tarefas atrasadas: ${tarefasAtrasadas.length}`);\n\n// Estat\u00edsticas\nconst totalTarefas = tarefas.length;\nconst tarefasConcluidas = tarefas.filter(t => t.status === 'done').length;\n\n// Retornar dados formatados com melhor tratamento para nome e email\nreturn {\n  json: {\n    id: usuario.id,\n    nome: usuario.name || (usuario.email ? usuario.email.split('@')[0] : 'Usu\u00e1rio'),\n    email: usuario.email || '',\n    dataFormatada,\n    tarefasHoje,\n    tarefasAmanha,\n    tarefasAtrasadas,\n    totalTarefas,\n    tarefasConcluidas\n  }\n};"
      },
      "id": "0c1e6b5c-8e85-4c4c-916d-1cec8062ef3a",
      "name": "Processar Dados do Usu\u00e1rio",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        1120,
        -120
      ]
    },
    {
      "parameters": {
        "functionCode": "// Gerar conte\u00fado de email sem usar IA\nconst dados = $json;\n\n// Log para debug\nconsole.log('Gerando email para:', dados.nome, dados.email);\n\n// Formata\u00e7\u00e3o das listas de tarefas\nconst formatarTarefas = (tarefas) => {\n  if (!tarefas || !tarefas.length) return '<p style=\"color:#666;\">(Nenhuma tarefa)</p>';\n  \n  return '<ul>' + tarefas.map(t => {\n    let prioridade = '';\n    switch(t.priority) {\n      case 'high': prioridade = '<span style=\"color:red;font-weight:bold;\">Alta</span>'; break;\n      case 'medium': prioridade = '<span style=\"color:orange;\">M\u00e9dia</span>'; break;\n      case 'low': prioridade = '<span style=\"color:green;\">Baixa</span>'; break;\n      default: prioridade = '';\n    }\n    \n    return `<li>${t.title} - ${prioridade}</li>`;\n  }).join('') + '</ul>';\n};\n\n// Conte\u00fado do email\nconst emailHTML = `\n<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"UTF-8\">\n  <title>Orga.AI - Resumo de Tarefas</title>\n  <style>\n    body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 600px; margin: 0 auto; }\n    .header { background-color: #4A86E8; color: white; padding: 20px; text-align: center; }\n    .container { padding: 20px; }\n    .section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #eee; }\n    .stats { display: inline-block; margin-right: 20px; background: #f5f5f5; padding: 10px; border-radius: 5px; }\n    h2 { color: #4A86E8; }\n    .today { border-left: 5px solid #FFC107; padding-left: 15px; }\n    .tomorrow { border-left: 5px solid #4CAF50; padding-left: 15px; }\n    .overdue { border-left: 5px solid #F44336; padding-left: 15px; }\n    .footer { text-align: center; font-size: 12px; color: #999; margin-top: 20px; }\n  </style>\n</head>\n<body>\n  <div class=\"header\">\n    <h1>Orga.AI - Seu Resumo Di\u00e1rio</h1>\n    <p>${dados.dataFormatada}</p>\n  </div>\n  \n  <div class=\"container\">\n    <h2>Ol\u00e1, ${dados.nome}!</h2>\n    \n    <div class=\"section\">\n      <h3>Seu Progresso</h3>\n      <div class=\"stats\">\n        <strong>Total de Tarefas:</strong> ${dados.totalTarefas}\n      </div>\n      <div class=\"stats\">\n        <strong>Tarefas Conclu\u00eddas:</strong> ${dados.tarefasConcluidas}\n      </div>\n    </div>\n    \n    <div class=\"section today\">\n      <h3>Suas Tarefas para Hoje</h3>\n      ${formatarTarefas(dados.tarefasHoje)}\n    </div>\n    \n    <div class=\"section tomorrow\">\n      <h3>Planejamento para Amanh\u00e3</h3>\n      ${formatarTarefas(dados.tarefasAmanha)}\n    </div>\n    \n    <div class=\"section overdue\">\n      <h3>Tarefas Atrasadas</h3>\n      ${formatarTarefas(dados.tarefasAtrasadas)}\n    </div>\n    \n    <div class=\"section\">\n      <h3>Dica do Dia</h3>\n      <p>Lembre-se de priorizar suas tarefas mais importantes pela manh\u00e3, quando seu n\u00edvel de energia est\u00e1 mais alto. Use a t\u00e9cnica Pomodoro para manter o foco: trabalhe por 25 minutos e descanse por 5.</p>\n    </div>\n  </div>\n  \n  <div class=\"footer\">\n    <p>Este email foi enviado automaticamente pelo sistema Orga.AI</p>\n    <p>\u00a9 2025 Orga.AI - Sua vida organizada com intelig\u00eancia</p>\n  </div>\n</body>\n</html>\n`;\n\n// Retornar os dados com o HTML formado\nreturn [{\n  json: {\n    ...dados,\n    emailHTML\n  }\n}];"
      },
      "id": "bf9ecc9a-042f-49a3-9c0d-1536e2cacdff",
      "name": "Gerar Conte\u00fado do Email",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1340,
        -120
      ]
    },
    {
      "parameters": {
        "fromEmail": "angelo.sagnori@gmail.com",
        "toEmail": "={{$json[\"email\"]}}",
        "subject": "=Orga.AI - Seu resumo di\u00e1rio de tarefas ({{$json[\"dataFormatada\"]}})",
        "html": "={{$json[\"emailHTML\"]}}",
        "options": {}
      },
      "id": "1c91b921-0951-4f6e-868b-571fccd29d61",
      "name": "Enviar Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 1,
      "position": [
        1580,
        -120
      ],
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "url": "http://backend:8000/api/v1/admin/logs",
        "method": "PUT",
        "allowUnauthorizedCerts": true,
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "= { \n  \"level\": \"info\", \n  \"source\": \"n8n_workflow\", \n  \"message\": `Email enviado para ${$json[\"nome\"]} <${$json[\"email\"]}>`,\n  \"details\": { \n    \"workflow\": \"n8n_email_diario_sem_ollama_fixed\", \n    \"user_id\": $json[\"id\"], \n    \"task_count\": $json[\"totalTarefas\"],\n    \"timestamp\": new Date().toISOString()\n  }\n}"
      },
      "id": "60572774-d4d7-45d8-8e85-ecb2af78a97f",
      "name": "Registrar Log de Email",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        1800,
        -120
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Agendamento Di\u00e1rio (7:30)": {
      "main": [
        [
          {
            "node": "Obter Lista de Usu\u00e1rios",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Obter Lista de Usu\u00e1rios": {
      "main": [
        [
          {
            "node": "Usu\u00e1rios com Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Usu\u00e1rios com Email": {
      "main": [
        [
          {
            "node": "Processar por Usu\u00e1rio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Processar por Usu\u00e1rio": {
      "main": [
        [
          {
            "node": "Debug ID Usu\u00e1rio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Debug ID Usu\u00e1rio": {
      "main": [
        [
          {
            "node": "Obter Tarefas do Usu\u00e1rio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Obter Tarefas do Usu\u00e1rio": {
      "main": [
        [
          {
            "node": "Processar Dados do Usu\u00e1rio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Processar Dados do Usu\u00e1rio": {
      "main": [
        [
          {
            "node": "Gerar Conte\u00fado do Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gerar Conte\u00fado do Email": {
      "main": [
        [
          {
            "node": "Enviar Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enviar Email": {
      "main": [
        [
          {
            "node": "Registrar Log de Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "fixed-sem-ollama-2025-05-11",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "fixed_workflow_sem_ollama",
  "tags": [
    "corrigido",
    "debug",
    "sem-ollama"
  ]
}

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

n8n_email_diario_sem_ollama_fixed. Uses httpRequest, emailSend. Scheduled trigger; 10 nodes.

Source: https://github.com/asagnori/Orga-AI/blob/f21833e668c05ab292af681640381cdd147afbcc/cookbooks/n8n-flows/backup/20250511/n8n_email_diario_sem_ia.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

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

AI & RAG

This n8n workflow automatically fetches monthly financial statements, normalizes the data, performs KPI calculations and trend analysis, detects anomalies, generates AI-powered executive insights and

HTTP Request, Postgres, Email Send
AI & RAG

Who is this for? Event organizers losing 80% of form starters who never finish registration and want automated follow-up emails triggered by abandonment beacons. What problem is this workflow solving?

HTTP Request, Email Send, Data Table
AI & RAG

Weekly Documentation Update. Uses executeCommand, httpRequest, emailSend. Scheduled trigger; 8 nodes.

Execute Command, HTTP Request, Email Send
AI & RAG

Daily Email Summary Workflow. Uses httpRequest, emailSend. Scheduled trigger; 5 nodes.

HTTP Request, Email Send
AI & RAG

This n8n workflow automates the monitoring of warehouse inventory and sales velocity to predict demand, generate purchase orders automatically, send them to suppliers, and record all transactions in E

HTTP Request, OpenAI, Postgres +1