Slack Trigger Setup

I’m trying to get the Slack Trigger set up. I have the app set up and the credentials working, but when I enable Event Subscriptions and paste the webhook URL into Slack, I get the following error message.

“Your URL didn’t respond with the value of the challenge parameter”

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:

@smittym , you seem to be in the process of setting app your Slack application. Here’s the step you are missing, Events API | Slack.

Before your setup is completed you need to confirm your n8n workflow is the webhook you authorize to handle Slack events. This is a one-off task you have to complete before continuing with building your workflow.

To be more specific, when setting up a Slack app, you are asked to confirm your webhook URL. At this point, Slack sends HTTP request in the form

{
    "token": <token>,
    "challenge": <challenge>,
    "type": "url_verification"
}

What your n8n workflow has to do is to check that if type has the value “url_verification”, you respond back with the value of challenge. Once done Slack will aprove your webhook URL and you can move on.

I thought the Slack Trigger node would handle that verification. I can’t see any way to pass that challenge back to Slack from the Slack Trigger node setup.

Apologies, I missed that you are trying the trigger node. Indeed, verification should be done automatically.

Perhaps you are using wrong URL (test vs production) or n8n app does not reply in time or event does not even reach n8n (could be with self-hosted solution).

So, I am using cloud and I have verified the URL is correct. Maybe it times out, not sure how I would be able to track that down.

@smittym, I tested the setup on the cloud and had no issue. Perhaps it is a matter of following the steps to set this all up.

Here’s what I did

  1. Activate n8n workflow (where you have the Slack trigger), this essentially switches to Production mode
  2. Copy the production URL of the webhook
  3. Paste this URL into the Slack app configuration in “Event Subscriptions”

These steps have automatically verified the webhook URL for me.

1 Like

For some reason, without any changes, it started working today. I suspect there may have been some issue on the n8n side that was just a temporary glitch. Thank you for your help.

So I did get the Slack trigger set up properly and verified, but it doesn’t respond to any events from Slack. I have tried every combination from trigger on any event to specific events on specific channels, but it never fires off. Does the Slack trigger just not work?

1 Like

There seems to be a similar thing going on in the Make.com community as well.

If you want to verify your Slack Event URL, make sure your n8n Slack trigger is listening for an event. Worked for me.

I had the same issue, but activating the n8n workflow and using the production webhook URL resolved it.

I am running into the same error message when trying to setup the Test environment. It verifies on Production webhook URL but the test one won’t work and therefore I can’t build my next steps as there is no test data to reference:

So if someone can further help me, I am trying to get a basic IF statement using the payload received in the Slack call

2 questions:

  1. How can I generate a test case using Slack when the slack app url won’t load for the test URL and in production I can’t see the test data in the editor

  2. What is the syntax to get the slack text value from the payload?

Here is the prod log payload:

Thanks for the help!

OK hopefully this helps someone else. I just figured it out after watching a YouTube Video. Here is what I was missing:

When adding the Test URL, FIRST, turn the trigger step to “testing” so it is listening for the test.

While it’s listening, then retry that webhook test URL and it works!

Then test your payload and finally revert back to the production webhook call when ready.

This was unclear to me by the online docs and threads above although I may have missed someone stating the same thing. Hope this helps the next person struggling with this.

2 Likes

In my case, self hosting in the cloud, i had to add the environment variable WEBHOOK_URL=https://my.url.com so that the slack trigger node actually created the correct production url that made also the production verification successful. Before i had the same that just the test url verification worked.

I’m getting the same error when trying to set this up locally. I’m running the n8n docker image. Has anyone figured out a way to make this work?

1 Like

For me, the key for resolving the challenge and response is to ensure that the flow is set into “active” and at that point cut and past the webhook URL in Slack while in “active” mode. To emphasise, it does not work when you use the “Listen for Test Event” I am using a hosted solution with docker (which does not appear to be the issue)

To get Test Mode working, go back to Slack and “Event Subscriptions” and cut and past the test URL. This has to be done while the worflow is in “Test Workflow” mode - this breaks production. It is thus lots of cut and paste

Hi, you could use independent workflows for testing / prod. This way it would make your life easier and safer, testing with prod data also is not the greatest idea

Reg
J.