Woocommerce Trigger not pulling in data

Hi all, I just finished setting up my n8n instance and creating my first workflow. Apologies in advance if I overlooked something obvious.

I am trying to connect a Woocommerce trigger to a regular Mautic node. The trigger is a Wocommerce ‘customer.created’ event which should create a new contact in Mautic.

I created a few test orders in Woocommerce and executed the node in n8n, but no data was pulled in.

The API’s have been setup for both Woocommerce and Mautic, and I know they work with n8n because when I execute ‘get’ workflows for single Woocommerce and Mautic nodes n8n retrieves the data. Also, when I execute the workflow (Woocommerce Trigger + Mautic), I can see a that a webhook has been created in my Woocommerce dashboard.

What could I have done wrong?

Welcome to the community @day54!

A good start would be to make sure that all executions are saved (successful & error) and then check if an execution got triggered for that event. If not, then the problem must be in WooCommerce (as it did not trigger). If yes, you should be able to see in n8n what the problem was.

Hi Jan,

The problem is with Woocommerce - no executions were recorded. I am sure I have done something wrong with the Woocommerce trigger.

I did create a simple workflow to get all orders from Woocommerce and that worked like a charm:

But the workflow that is initiated with the Woocommerce Trigger is a no go. Would it help if I shared the json for this workflow?

This is the screenshot for the Woocommerce-Mautic workflow:

So just to be sure. You have the workflow activate (not just running it manually)? And then after you did that you see that the webhook got created in WooCommerce and it stays there (as written in first post). And you also have n8n running on your own domain or with tunnel, so the Webhook-URL is not something like http://localhost...?

I turned on the green slider at the top right corner, is there another step I should take to activate the workflow?

2 webhooks were created in Woocommerce for each of the n8n workflows involving Woocommerce triggers - customer.created and customer.updated (this is for another workflow I attempted). Yes n8n is running on my own domain, these are the webhooks in the Woocommerce dashboard:

I just tested it, and it’s working for me. The event takes a bit to be fired, though (that is a WooCommerce/WordPress issue).

Hi Ricardo,

Did you change any of the default settings in the Woocommerce trigger?

I created 3 test customers and 4 test orders, but none of the data was transferred to n8n. The regular Woocommerce node works fine, but none of the triggers I have tried out have. What could the reason be?

The Woocommerce API was set up as per this doc: WooCommerce | Docs. When adding the API credentials in n8n, I entered the credential data and gave node access to both the Woocommerce and Woocommerce Trigger nodes.

Not at all. I created a sandbox using https://wpsandbox.net/ and did not change anything.

If you add a webhook node, grab the test url, execute it and then hit it. Does it work?

Sorry I’m a complete newbie. What do you mean by execute it and hit. I have added a webhook node but am not sure how to proceed

@day54 Check the video below

https://www.loom.com/share/2d48bd47c3094152a072f6c6e0efe01a

Hi, I think I’ve got similar problem:
WooCommerce Trigger not firing next action in workflow… i think n8n don’t register my webhooks, or register them on different URL than I know ?!

After saving workflow in n8n in WooCommerce webhook was created


When I edit this webhook and trying to save it again (without making any changes) It cannot be saved because: Error: URL could not be reached: Invalid URL provided.

From the WordPress site I have information that action was triggered (when I manuly create new order > which creates user)

And when I running production URL (saved in WooCommerce webhook) directly in browser, I have respond:

{“code”:404,“message”:“The requested webhook "GET cabcf36e-de80-4c7a-a429-2ab29b68930e/webhook" is not registered.”,“hint”:“The workflow must be active for a production URL to run successfully. You can activate the workflow using the toggle in the top-right of the editor. Note that unlike test URL calls, production URL calls aren’t shown on the canvas (only in the executions list)”,“stack”:“ResponseError: The requested webhook "GET cabcf36e-de80-4c7a-a429-2ab29b68930e/webhook" is not registered.\n at ActiveWorkflowRunner.executeWebhook (/usr/local/lib/node_modules/n8n/dist/src/ActiveWorkflowRunner.js:99:23)\n at async /usr/local/lib/node_modules/n8n/dist/src/WebhookServer.js:41:24”}

I’m running n8n on docker container hosted by DigitalOcean, using:

“docker run -it --rm --name n8n -p 5678:5678 -e NODE_TLS_REJECT_UNAUTHORIZED=0 -e DOMAIN_NAME=“http://164.xxx.xxxx.xx6:5678” -e WEBHOOK_URL=“http://164.xxx.xxxx.xx6:5678” -v ~/.n8n:/home/node/.n8n n8nio/n8n”

WordPress site have SSL but there was problem with reckognizing it, so I had to use NODE_TLS_REJECT_UNAUTHORIZED=0;
When I’m using in n8n workflow direct Wordpress Node to create posts - it works well.
But firing this wooCommerce Trigger was never successful to me

Result after firing sandbox URL in browser (after click in n8n “Listen For Event”):

{“code”:404,“message”:“The requested webhook "GET cabcf36e-de80-4c7a-a429-2ab29b68930e/webhook" is not registered.”,“hint”:“Click the ‘Execute workflow’ button on the canvas, then try again. (In test mode, the webhook only works for one call after you click this button)”,“stack”:“ResponseError: The requested webhook "GET cabcf36e-de80-4c7a-a429-2ab29b68930e/webhook" is not registered.\n at TestWebhooks.callTestWebhook (/usr/local/lib/node_modules/n8n/dist/src/TestWebhooks.js:25:23)\n at /usr/local/lib/node_modules/n8n/dist/src/Server.js:1658:52\n at Layer.handle [as handle_request] (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at next (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/route.js:144:13)\n at next (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/route.js:138:14)\n at next (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/route.js:138:14)\n at next (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/route.js:138:14)\n at next (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/route.js:138:14)\n at next (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/route.js:138:14)\n at next (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/route.js:138:14)\n at Route.dispatch (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/route.js:114:3)\n at Layer.handle [as handle_request] (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at /usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:284:15\n at param (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:365:14)\n at param (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:376:14)\n at Function.process_params (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:421:3)\n at next (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:280:10)\n at /usr/local/lib/node_modules/n8n/dist/src/UserManagement/routes/index.js:126:9\n at Layer.handle [as handle_request] (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at trim_prefix (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:328:13)\n at /usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:286:9\n at Function.process_params (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:346:12)”}

Please help me find solution

update 2022-05-05 16:59
I also tried by adding domain instead of ip adress, without ssl…and it also didn’t work (have the same problem)

Hey @Pawel_Z, sorry to hear you’re having trouble here. An error of The workflow must be active for a production URL to run successfully. suggests your workflow isn’t activated meaning the production URL is not available.

Could you try activating your workflow through the little switch in the upper right corner of your canvas?

image

Assuming your n8n instance can be reached from your WooCommerce instance, the webhooks should reach n8n as expected once your workflow is activated.

Hey,
maybe I wroted not clearly,
but I activated my workflow (as you suggest),
and then As I wroted, webhook in my WooCommerce was created (I pasted screenshot).

on every run n8n docker container, webhook in my WooCommerce is renewing (because workflow is active, and I don’t have to activate it again).
and every time when I’m firing webhook URL I have the same respond "“The requested webhook “GET cabcf36e-de80-4c7a-a429-2ab29b68930e/webhook” is not registered.”

on every run n8n docker container, webhook in my WooCommerce is renewing (because workflow is active, and I don’t have to activate it again).

Hi @Pawel_Z, I don’t think I fully understand what you are doing. Are you running multiple n8n instances in separate docker containers and are copying your workflows between them?

I’ve got only one instance of docker container and I stopped and runned again it many times, because:

  • trying with different enviromental variables
  • trying with “nohop…&”
  • trying with few domains, IP, SSL

still without success with WooCommerce triggers

Hi again,

still having this problem, please see my video. I don’t know what I’m doing wrong.

Hey @Pawel_Z, thanks for the video. I must have missed the part earlier where you mentioned you’re trying to open the webhook URL in your browser and only noticed this when watching the video.

Opening the Woocommerce webhook URL in your browser won’t work because the HTTP method uses by the webhook is POST. Your browser would, however, send a GET request instead. If you’d like to manually send data to a POST endpoint, you’d need to use a tool like curl or Insomnia (though I don’t see why you would want to do this).

The actual webhook sent by Woocommerce likely fails because the webhook URL that’s being registered contains localhost (and thus would only work if both Woocommerce and n8n run on the same machine and can talk to each other). If you’re running n8n behind a reverse proxy, you’d need to set the WEBHOOK_URL environment variable accordingly.

Hi,

thanks for your advice,
I’ve tested again, and go to results:

  • when WooCommerce firing webhook and calling webhook.site - everyhing is ok

  • when WooCommerce firing webhook and calling my n8n server recived:
    http_request_failed
    image

  • when calling n8n URL by POST (without preparing headers etc.) from SoapUI recived:
    {message":“Webhook call recived”}

  • when edit webhook in wooCommerce without any changes I cannot save it again (because WordPress shows: URL cannot be acheived

my active process in n8n didn’t go to next step (and create post in wordpress ← this part works well)

testing processs you can see on video:

Hi day54… Were you able to resolve this? I am also stuck in similar situation wherein woocommerce trigger not working but woocommerce get order working fine.