From 26b06e07d57b34fd5b9466c391794192b0a3f63b Mon Sep 17 00:00:00 2001 From: Gustavo Date: Mon, 24 Aug 2026 21:37:17 -0300 Subject: [PATCH] feat(v2): REAL Slack send confirmed working end-to-end After the user added the missing OAuth scopes (channels:join, chat:write.public) and reinstalled the Slack App, updated the credential with the refreshed token and retried the real test send: SUCCESS. The digest message was actually posted to #chamados-suporte (channel C0BJNBTPFT5) by "Bot Coordenador", confirmed via the real Slack API response (ok:true, real message ts/channel/bot_profile returned). Code - Registrar Envio Sucesso correctly recorded status:'success' -- this record is intentionally left in place (not cleared like the earlier failed-test rows), since it now correctly represents a real send and its whole purpose is to prevent a duplicate resend of today's digest. Also found and fixed a real cosmetic bug from that same successful send: n8n's Slack node appends an "Automated with this n8n workflow" link footer by default (otherOptions.includeLinkToWorkflow defaults to true) -- not part of the message spec (minimal digest only). Disabled it. Added a regression test. Reverted SEND_ENABLED to false and deactivated pending final user confirmation before permanent production activation. 159/159 tests passing. Co-Authored-By: Claude Sonnet 5 --- n8n/deployed/coordenador-glpi-v2.n8n.json | 4 +++- n8n/workflow.template.json | 4 +++- tools/build-workflow.test.js | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/n8n/deployed/coordenador-glpi-v2.n8n.json b/n8n/deployed/coordenador-glpi-v2.n8n.json index 993e35f..2b479ab 100644 --- a/n8n/deployed/coordenador-glpi-v2.n8n.json +++ b/n8n/deployed/coordenador-glpi-v2.n8n.json @@ -788,7 +788,9 @@ "value": "C0BJNBTPFT5" }, "text": "={{ $json.mensagem }}", - "otherOptions": {} + "otherOptions": { + "includeLinkToWorkflow": false + } }, "credentials": { "slackApi": { diff --git a/n8n/workflow.template.json b/n8n/workflow.template.json index 68a0d58..a88a31c 100644 --- a/n8n/workflow.template.json +++ b/n8n/workflow.template.json @@ -788,7 +788,9 @@ "value": "C0BJNBTPFT5" }, "text": "={{ $json.mensagem }}", - "otherOptions": {} + "otherOptions": { + "includeLinkToWorkflow": false + } }, "credentials": { "slackApi": { diff --git a/tools/build-workflow.test.js b/tools/build-workflow.test.js index 3b07dd9..292b92f 100644 --- a/tools/build-workflow.test.js +++ b/tools/build-workflow.test.js @@ -148,6 +148,15 @@ test('node real de envio Slack existe (nao e so simulado/comentado)', () => { assert.equal(slackNode.onError, 'continueErrorOutput', 'precisa separar sucesso/falha pra idempotencia e nao-silenciar-erro'); }); +test('Slack node nao anexa o rodape automatico "Automated with this n8n workflow" (bug real: vazou na primeira mensagem real de teste)', () => { + // O node Slack do n8n inclui esse link por padrao (includeLinkToWorkflow default: true) -- + // vazou pra dentro do canal real no primeiro teste de envio. A missao pede mensagem minima, + // sem nada alem do que buildTopMessage gera. + const wf = buildWorkflow(); + const slackNode = wf.nodes.find((n) => n.type === 'n8n-nodes-base.slack'); + assert.equal(slackNode.parameters.otherOptions.includeLinkToWorkflow, false); +}); + test('guard de envio roda antes do Slack e existe IF de decisao', () => { const wf = buildWorkflow(); const guardConn = wf.connections['Code - Guard de Envio Slack'];