Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Test WhatsApp Node To Receive Messages #13361

Open
hcancelik opened this issue Feb 19, 2025 · 5 comments
Open

Cannot Test WhatsApp Node To Receive Messages #13361

hcancelik opened this issue Feb 19, 2025 · 5 comments
Labels
in linear Issue or PR has been created in Linear for internal review In Review We are reviewing the issue

Comments

@hcancelik
Copy link

hcancelik commented Feb 19, 2025

Bug Description

I am having an issue where I get the following message when I start testing the node for WhatsApp Business.

Image

The system is running on queue mode where there is a Primary, Worker and a Webhook where each setup runs separately using the same Redis instance.

Image

The URLS for both test and production workflow works fine when I do a get request.
The workflow also works fine when I enable the production but not in the test mode.

WEBHOOK_URL is setup correctly for all instances.
Primary instance has N8N_DISABLE_PRODUCTION_MAIN_PROCESS set to true but I also tried it as false.

Am I missing something in the setup?

To Reproduce

Setup a n8n in queue mode with one primary, one worker and a webhook runner.
Setup to workflow to receive a message from whatsapp
Start the workflow in test environment.

Expected behavior

Register the webhook correcly with WhatsApp api and listen for messages instead of throwing an error.

Operating System

n8nio/n8n Docker Image

n8n Version

1.78.1

Node.js Version

20.18.2

Database

PostgreSQL

Execution mode

queue

@Joffcom
Copy link
Member

Joffcom commented Feb 19, 2025

Hey @hcancelik,

We have created an internal ticket to look into this which we will be tracking as "GHC-895"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Feb 19, 2025
@Joffcom
Copy link
Member

Joffcom commented Feb 20, 2025

Hey @hcancelik,

It looks like the 404 is coming back when trying to do the verification, Did you configure your load balancer to point to the worker instance of n8n correctly?

@hcancelik
Copy link
Author

hcancelik commented Feb 20, 2025

@Joffcom thanks for the reply. There is a single instance for each so I'm not sure if Railway is creating load balancer when it's only one.

When I use the production webhook by activating the "workflow" it does register successfully. I just couldn't get it work when it is in inactive state.

The test webhook points the primary instance and the production one points to the webhook one. They are two different subdomains on the same domain.

@Joffcom Joffcom added the In Review We are reviewing the issue label Feb 20, 2025
@Joffcom
Copy link
Member

Joffcom commented Feb 21, 2025

Hey @hcancelik

I would be surprised if Railway created a load balancer based on your configuration as it wouldn't know what to do with it.

The error message you are seeing though is coming from WhatsApp and it is saying it is unable to verify the url it has been sent, this would suggest a configuration issue and could be that they can't reach the url. It could be a configuration issue but I don't know what options and values you have set but as long as the main instance can be reached by the outside world which is needed for testing it should work, I believe WhatsApp may also only like one url for the trigger so there could be an issue there as well.

@Joffcom Joffcom added Needs Feedback Waiting for further input or clarification. and removed In Review We are reviewing the issue labels Feb 21, 2025
@hcancelik
Copy link
Author

@Joffcom

WEBHOOK_URL environment key in all instances (primary, worker and webhook) points to the same url. That's the correct configuration right?

I think the issue is that the wrong webhook url is being passed to WhatsApp when testing with separate webhook instance.

When the WEBHOOK_URL environment key is set to webhook instance public url in the primary instance, the UI shows the correct test and production urls but when WhatsApp node generates the webhook url, it's based on the WEBHOOK_URL instead of primary's public address.

Here is an example. Let assume these are the domains for a setup.

Primary n8n instance URL => primary.domain.com
Webhook n8n instance URL => webhook.domain.com

Webhook URLs for xyz worfklow on UI shows as:

Test URL: https://primary.domain.com/webhook-test/xyz/webhook
Production URL: https://webhook.domain.com/webhook/xyz/webhook

These are correct.
However for testing, WhatsApp node must be sending the following URL which is the only url that returns 404.

https://webhook.domain.com/webhook-test/xyz/webhook

@Joffcom Joffcom added In Review We are reviewing the issue and removed Needs Feedback Waiting for further input or clarification. labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review In Review We are reviewing the issue
Projects
None yet
Development

No branches or pull requests

2 participants