const rows = $input.all().map((item) => item.json); rows.sort((a, b) => Number(b.run_at || 0) - Number(a.run_at || 0)); const latest = rows[0] || null; const painel = { gerado_em: new Date().toISOString(), ultima_execucao_shadow: latest, total_execucoes_recentes: rows.length, }; return [{ json: painel }];