AutomationFlowsData & Sheets › Follow Up

Follow Up

Follow-up. Uses supabase, n8n-nodes-evolution-api, httpRequest. Scheduled trigger; 11 nodes.

Cron / scheduled trigger★★★★☆ complexity11 nodesSupabaseN8N Nodes Evolution ApiHTTP Request
Data & Sheets Trigger: Cron / scheduled Nodes: 11 Complexity: ★★★★☆ Added:

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 →

Download .json
{
  "active": true,
  "connections": {
    "Cron Trigger": {
      "main": [
        [
          {
            "node": "Buscar Leads para Follow-up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Buscar Leads para Follow-up": {
      "main": [
        [
          {
            "node": "Verificar se h\u00e1 Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verificar se h\u00e1 Leads": {
      "main": [
        [
          {
            "node": "Processar Estrat\u00e9gia Follow-up",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Sem Leads para Follow-up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Processar Estrat\u00e9gia Follow-up": {
      "main": [
        [
          {
            "node": "Enviar Follow-up WhatsApp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enviar Follow-up WhatsApp": {
      "main": [
        [
          {
            "node": "Atualizar Status Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Atualizar Status Lead": {
      "main": [
        [
          {
            "node": "Log Atividade",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Atividade": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Salvar Log Follow-up": {
      "main": [
        []
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Resumo Execu\u00e7\u00e3o",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "createdAt": "2025-06-05T04:50:50.055Z",
  "id": "Q6bSSINJ7HQFQ3U2",
  "isArchived": false,
  "meta": null,
  "name": "Follow-up",
  "nodes": [
    {
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "hour": 11,
              "minute": 40
            }
          ]
        }
      },
      "name": "Cron Trigger",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "287fc68d-035f-46ed-9d33-fe6fc87980d0"
    },
    {
      "parameters": {
        "operation": "getAll",
        "tableId": "dados_cliente",
        "returnAll": true,
        "filterType": "string",
        "filterString": "=status=in.(novo,em atendimento,interessado)&tentativas_followup=lt.3&or=(ultimo_contato.is.null,ultimo_contato.lt.2025-06-04T03:00:00.000Z)"
      },
      "name": "Buscar Leads para Follow-up",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        200,
        0
      ],
      "id": "ab869af6-50c1-489a-8163-0489d48218ce",
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 1
          },
          "conditions": [
            {
              "id": "has-leads",
              "leftValue": "={{$items().length > 0}}",
              "rightValue": 0,
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "name": "Verificar se h\u00e1 Leads",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        400,
        0
      ],
      "id": "f28c3f70-7766-46e6-b8e7-183cfab79f5d"
    },
    {
      "parameters": {
        "jsCode": "// Processar cada lead e definir estrat\u00e9gia de follow-up\nconst leads = $input.all();\nconst processedLeads = [];\n\nfor (const lead of leads) {\n  const leadData = lead.json;\n  \n  // Calcular dias desde \u00faltimo contato\n  const ultimoContato = new Date(leadData.ultimo_contato || leadData.created_at);\n  const diasSemContato = Math.floor((Date.now() - ultimoContato.getTime()) / (1000 * 60 * 60 * 24));\n  \n  // Definir tipo de follow-up baseado no status e tentativas\n  let tipoFollowup = 'padrao';\n  let mensagem = '';\n  \n  const tentativas = leadData.tentativas_followup || 0;\n  const nomeCompleto = leadData.name || leadData.nome_completo || '';\n  const nomeCurto = nomeCompleto.split(' ')[0] || '';\n  \n  // Estrat\u00e9gias diferentes baseadas no n\u00famero de tentativas\n  if (tentativas === 0) {\n    tipoFollowup = 'primeiro_followup';\n    mensagem = `Oi ${nomeCurto}! \ud83d\ude0a Como voc\u00ea est\u00e1? Queria saber se teve tempo de pensar sobre nossa conversa sobre automa\u00e7\u00e3o. Tem alguma d\u00favida que posso esclarecer?`;\n  } else if (tentativas === 1) {\n    tipoFollowup = 'segundo_followup';\n    mensagem = `${nomeCurto}, tudo bem? \ud83e\udd14 Imagino que deve estar corrido por a\u00ed. Nossa proposta de automa\u00e7\u00e3o pode justamente te ajudar a ter mais tempo livre. Que tal uma conversa r\u00e1pida de 15 min?`;\n  } else if (tentativas === 2) {\n    tipoFollowup = 'ultimo_followup';\n    mensagem = `${nomeCurto}, \u00faltima tentativa! \ud83d\ude05 Sei que automa\u00e7\u00e3o pode parecer complexa, mas nossos clientes economizam em m\u00e9dia 20h/semana. Vale a pena pelo menos conhecer, n\u00e3o acha? \ud83d\ude80`;\n  }\n  \n  // Formata\u00e7\u00e3o do telefone\n  const telefoneFormatado = leadData.phone ? \n    '55' + leadData.phone.toString().replace(/\\D/g, '').slice(-11) : \n    leadData.telefone_formatado;\n  \n  processedLeads.push({\n    json: {\n      ...leadData,\n      telefone_formatado: telefoneFormatado,\n      nome_curto: nomeCurto,\n      tipo_followup: tipoFollowup,\n      mensagem_followup: mensagem,\n      dias_sem_contato: diasSemContato,\n      nova_tentativa: tentativas + 1\n    }\n  });\n}\n\nreturn processedLeads;"
      },
      "name": "Processar Estrat\u00e9gia Follow-up",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        600,
        -20
      ],
      "id": "d58a98a5-ef0d-49e0-8a6f-e9efab5d651f"
    },
    {
      "parameters": {
        "resource": "messages-api",
        "instanceName": "aiagenteautomate@gmail.com",
        "remoteJid": "={{ $json.telefone_formatado }}@s.whatsapp.net",
        "messageText": "={{ $json.mensagem_followup }}",
        "options_message": {}
      },
      "name": "Enviar Follow-up WhatsApp",
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "typeVersion": 1,
      "position": [
        800,
        -20
      ],
      "id": "c9a05e07-1eca-4a31-ac54-53a515f512ce",
      "credentials": {
        "evolutionApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "tableId": "dados_cliente",
        "filters": {
          "conditions": [
            {
              "keyName": "id",
              "condition": "eq",
              "keyValue": "={{ $json.id }}{{ $('Processar Estrat\u00e9gia Follow-up').item.json.id }}"
            }
          ]
        },
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "ultimo_contato",
              "fieldValue": "={{ $now.toISO() }}"
            },
            {
              "fieldId": "tentativas_followup",
              "fieldValue": "={{ $json.nova_tentativa }}"
            },
            {
              "fieldId": "tipo_ultimo_followup",
              "fieldValue": "={{ $json.tipo_followup }}"
            },
            {
              "fieldId": "status",
              "fieldValue": "={{ $json.nova_tentativa >= 3 ? 'follow_up_completo' : 'seguimento' }}"
            }
          ]
        }
      },
      "name": "Atualizar Status Lead",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        1000,
        -20
      ],
      "id": "5dd7f7b4-9828-4cd4-8eb5-839dae5665a8",
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "log-entry",
              "name": "log_followup",
              "type": "object",
              "value": "={\n  \"lead_id\": \"{{ $json.id }}\",\n  \"nome\": \"{{ $json.name }}\",\n  \"tipo_followup\": \"WhatsApp\",   // exemplo fixo, ou puxe de onde quiser\n  \"tentativa\": \"{{ $json.tentativas_followup }}\",\n  \"telefone\": \"{{ $json.phone }}\",\n  \"status_anterior\": \"{{ $json.status }}\",\n  \"timestamp\": \"{{$now.toISO()}}\"\n}\n"
            }
          ]
        },
        "options": {}
      },
      "name": "Log Atividade",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1200,
        -20
      ],
      "id": "3f948cde-97dd-4546-aa26-277782d21b01"
    },
    {
      "parameters": {
        "operation": "insert"
      },
      "name": "Salvar Log Follow-up",
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        1080,
        -320
      ],
      "id": "4c8847fc-d3ce-4e06-98e8-289101c4d69c",
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "summary",
              "name": "resumo_execucao",
              "type": "object",
              "value": "={\n  \"total_leads_processados\": {{ $('Processar Estrat\u00e9gia Follow-up').all().length }},\n  \"data_execucao\": \"{{ $now.toISO() }}\",\n  \"tipos_followup\": {\n    \"primeiro\": {{ $('Processar Estrat\u00e9gia Follow-up').all().filter(lead => lead.json.tipo_followup === 'primeiro_followup').length }},\n    \"segundo\": {{ $('Processar Estrat\u00e9gia Follow-up').all().filter(lead => lead.json.tipo_followup === 'segundo_followup').length }},\n    \"ultimo\": {{ $('Processar Estrat\u00e9gia Follow-up').all().filter(lead => lead.json.tipo_followup === 'ultimo_followup').length }}\n  }\n}"
            }
          ]
        },
        "options": {}
      },
      "name": "Resumo Execu\u00e7\u00e3o",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1600,
        -20
      ],
      "id": "0d3763d8-3ec5-4fc1-9ade-bcfbc0c1c08a"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "no-leads",
              "name": "mensagem",
              "type": "string",
              "value": "Nenhum lead encontrado para follow-up no momento"
            }
          ]
        },
        "options": {}
      },
      "name": "Sem Leads para Follow-up",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        600,
        200
      ],
      "id": "cef7ff2b-e265-45c1-b32d-80efb738d019"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://krqjybpktokadpdmlouo.supabase.co/rest/v1/log_followups",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "apikey",
              "value": "<redacted-credential>"
            },
            {
              "name": "Authorization",
              "value": "<redacted-credential>"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "Prefer",
              "value": "return=representation"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "lead_id",
              "value": "={{ $json.log_followup.lead_id }}"
            },
            {
              "name": "nome_lead",
              "value": "={{ $json.log_followup.nome }}"
            },
            {
              "name": "tipo_followup",
              "value": "={{ $json.log_followup.tipo_followup }}"
            },
            {
              "name": "tentativa_numero",
              "value": "={{ $json.log_followup.tentativa }}"
            },
            {
              "name": "telefone",
              "value": "={{ $json.log_followup.telefone }}"
            },
            {
              "name": "enviado_em",
              "value": "={{ $now.toISO() }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1400,
        -20
      ],
      "id": "1e67e3c5-fc04-4345-bf85-302db394139f",
      "name": "HTTP Request"
    }
  ],
  "repo_name": "backup-n8n",
  "repo_owner": "faelsou",
  "repo_path": "backups/",
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 1,
  "updatedAt": "2025-07-04T14:38:57.303Z",
  "versionId": "5f5b78a7-9d54-4fb5-b268-94db43bd985f"
}

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

Follow-up. Uses supabase, n8n-nodes-evolution-api, httpRequest. Scheduled trigger; 11 nodes.

Source: https://github.com/faelsou/backup-n8n/blob/1a12f60c21e60788cc887b5daca515ad72ca62a4/2025/06/Q6bSSINJ7HQFQ3U2.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

This workflow solves a common problem with RSS feeds: they often only provide a short summary or snippet of the full article. This template automatically monitors a list of your favorite blog RSS feed

HTTP Request, RSS Feed Read, Supabase
Data & Sheets

This workflow is a multi-system document synchronization pipeline built in n8n, designed to automatically sync and back up files between Microsoft SharePoint, Supabase/Postgres, and Google Drive.

HTTP Request, Supabase, Postgres +1
Data & Sheets

03 - Recordatorio 4h (CON VERIFICACIÓN) ✅. Uses supabase, httpRequest, twilio. Scheduled trigger; 17 nodes.

Supabase, HTTP Request, Twilio
Data & Sheets

02 - Recordatorio 24h antes (CON VERIFICACIÓN) ✅. Uses supabase, httpRequest, twilio. Scheduled trigger; 17 nodes.

Supabase, HTTP Request, Twilio
Data & Sheets

• Fetches IT-related tenders from the French BOAMP API (filter: informatique) • Scores each tender with OpenAI (pertinence, budget, stack, GO/NO-GO) • Routes to Supabase as hot (≥75) or archived • Run

HTTP Request, Supabase