Getting error from Slack: "Your Slack credential is missing required Oauth Scopes"

Describe the problem/error/question

Using n8n cloud.
I am trying to search inside a Slack channel using Slack node

What is the error message (if any)?

Your Slack credential is missing required Oauth Scopes

NodeOperationError: Your Slack credential is missing required Oauth Scopes at Object.slackApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Slack/V2/GenericFunctions.js:47:19) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Slack/V2/SlackV2.node.js:594:44) at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:722:19) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:711:51 at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1141:20

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

It’s n8n cloud, I don’t know it’s version
All settings by default

Hey @Igor_77,

Welcome to the community :cake:

Can you try and authenticate against the app again? You may need to also add it to your Slack instance again.

Hello Jon,

I’ve tried to reconnect Slack and error persist.
What I’ve done:

  1. Removed n8n app from my Slack workspace
  2. Removed Slack OAuth connection (from Slack node configuration screen)
  3. Created new Slack OAuth connection (from Slack node configuration screen)

When I view the n8n Slack app I can see following scopes:

It seems required scope is present here.
So maybe error message is misleading.

I’ve updated to latest 1.63.2 beta and error persists.

The error looks to be correct, I added the search:read scope yesterday as it was missing. In theory adding the app to your instance again and creating a new credential should be enough to get it working.

I will have another look and see if I have missed something else.

@Jon
Noticed that scopes are only for on behalf of user, not on bahalf of the app - is that ok?

@Jon
Re-tested in 1.64 and getting the same error message.
Tested that other Slack actions work fine.

I’ve found partially working workaround.
I’ve used Access Token access instead of OAuth2.
I’ve created new app in my workspace and I’ve used “User” access token, not the “Bot User” access token - this is important because documentation instructs otherwise, but with “Bot User” access token connection gives error right away:

With “User” access token search works fine.
It seems this is related to the fact that in Scopes configuration you cannot assign “search:read” to the bot token, it is not in the list. It is only available for user token.

@Jon would be good if this work with OAuth2 token as well

@Igor_77 Thank you for figuring out and sharing a workaround. Using the Access Token with User role does indeed work.