Webhook sending only one item

Describe the issue/error/question

I have set up a simple workflow that gets data from a webscraper that I built. The issue is when I test it, it is only sending one item. When I activate the workflow and change the webhook url to production, I get no data. I have modified the code to send both an array and an object, but either way that doesn’t seem to affect it. I am using set after the webhook to filter and organize the data before I send it to google sheets.

What is the error message (if any)?

No error messages

Please share the workflow

(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)

Share the output returned by the last node

This is what I’m getting from n8n:

[

{

"headers": {

"host": "n8n.automate-tool.io",

"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36",

"content-length": "1925",

"accept": "*/*",

"accept-encoding": "gzip, deflate, br",

"accept-language": "en-US,en;q=0.9",

"authorization": "Basic ZGVtaWFuOmRlbWlhbl9uOG4=",

"content-type": "application/x-www-form-urlencoded; charset=UTF-8",

"origin": "chrome-extension://oolmdenpaebkcokkccakmlmhcpnogalc",

"sec-fetch-dest": "empty",

"sec-fetch-mode": "cors",

"sec-fetch-site": "none",

"sec-gpc": "1",

"x-forwarded-for": "73.184.249.141",

"x-forwarded-host": "n8n.automate-tool.io",

"x-forwarded-port": "443",

"x-forwarded-proto": "https",

"x-forwarded-server": "b95c30df41b0",

"x-real-ip": "73.184.249.141"

},

"params": {

},

"query": {

},

"body": {

"asin": "B08VHXZZ22",

"profileName": "Tim",

"rating": "5.0 out of 5 stars",

"review": "This is my first roborock vacuum coming from a roomba s9 and Braava mop that I bought and returned previously this year. I’ve always stuck to iRobot, but after my issues with their premium model, I decided to give roborock a go. Now I finally see what I’ve been missing. Pros: Navigation - lidar is the way to go here. No more leaving lights on to let the robot “see”. Vacuum/Mop combo - previously I had a separate moping robot that couldn’t make its way to the bathroom because there was carpet in between, the S7, no problem. Customization - the scheduling and power options give you the right amount of power and quiet when you need it. Smart Features - the ability for the robot to auto-detect carpet (and display it on your map), and watching the mop lift as it rolls over carpet is awesome. Smart charge and resume is typical, but then only resuming after do not disturb hours is a great feature as well. Build quality - this is a well built bot, all the hinges, sensor, and bumpers feel solid. Removing trays and filling moping container all feel well thought out. The lidar sensor also helps avoid aggressive bumps to your walls/furniture, unlike my previous roomba. Cons: Round design misses some corners versus premium roomba D shape. No auto-empty base (yet). I know it’s coming, but in the meantime, you have to make the investment in the robot now, and hope the auto-empty base performs well when it’s released. All in all, I’m blown away with what I’ve been missing by sticking with iRobot. I hope roborock continues to be a strong competitor, and will be first in-line to purchase the auto-empty base later this year.",

"review-date": "Reviewed in the United States on March 29, 2021"

},

"asin": "B08VHXZZ22",

"profileName": "Tim",

"rating": "5.0 out of 5 stars",

"review": "This is my first roborock vacuum coming from a roomba s9 and Braava mop that I bought and returned previously this year. I’ve always stuck to iRobot, but after my issues with their premium model, I decided to give roborock a go. Now I finally see what I’ve been missing. Pros: Navigation - lidar is the way to go here. No more leaving lights on to let the robot “see”. Vacuum/Mop combo - previously I had a separate moping robot that couldn’t make its way to the bathroom because there was carpet in between, the S7, no problem. Customization - the scheduling and power options give you the right amount of power and quiet when you need it. Smart Features - the ability for the robot to auto-detect carpet (and display it on your map), and watching the mop lift as it rolls over carpet is awesome. Smart charge and resume is typical, but then only resuming after do not disturb hours is a great feature as well. Build quality - this is a well built bot, all the hinges, sensor, and bumpers feel solid. Removing trays and filling moping container all feel well thought out. The lidar sensor also helps avoid aggressive bumps to your walls/furniture, unlike my previous roomba. Cons: Round design misses some corners versus premium roomba D shape. No auto-empty base (yet). I know it’s coming, but in the meantime, you have to make the investment in the robot now, and hope the auto-empty base performs well when it’s released. All in all, I’m blown away with what I’ve been missing by sticking with iRobot. I hope roborock continues to be a strong competitor, and will be first in-line to purchase the auto-empty base later this year.",

"review-date": "Reviewed in the United States on March 29, 2021"

}

]

I’m sending much more data than that. I could post it but I don’t want to overwhelm the chat.

Information on your n8n setup

  • n8n version: 0.165.0
  • Database you’re using (default: SQLite): default
  • Running n8n with the execution process [own(default), main]: default
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

Hi @Demian_Jennings, welcome to the community :tada:

Did you check your Execution List for any production execution?

Data sent to the production URL of your webhook wouldn’t show up in the Canvas straight away, instead it would be processed in the background you’d need to open it via the execution list.

I just checked it. All of the executions were a success, however they only sent 1 item. I know I’m sending at least at least 11 requests to the webhook

So one item per received webhook would be the expected behaviour. If you’d like to split the items inside a specific field (like body), you could use the Item Lists node like so:

image

Could you try placing this node after your webhook node and confirm whether that’s what you had in mind?

The script that is calling the webhook is inside of a for-loop, so after each iteration of the for-loop its calling the webhook and sending one packet of data. I’m expecting the webhook to capture each request and then send each data that I’m filtering with a set node to my google sheet. But it only sends one item and only when I’m using the test url. Also when I activate the flow, the webhook is not switching to production url. If I switch it manually it does not stay , so when I go and check it again, the webhook is still on the test url.

Hi @Demian_Jennings, the URL view in the webhook node is not a switch having any function besides picking which URL is shown. As long as your workflow is active, the production URL is active (and you should get a 200 success response when calling it).

That said, I don’t think I understand your data structure based on the example you have provided. The JSON you have shared only contains a single item (with an asin identifier of B08VHXZZ22 in your example), so I am not quite sure what behavior you would like to see and where the additional items would come into play.

Is only one item ever added to your Google Sheet, even when sending multiple webhooks to the production URL? If so, could you share your actual workflow? Simply select all nodes, hit Ctrl+C and paste the copied JSON into the forum, ideally using the option for preformatted text/code:

image

“Is only one item ever added to your Google Sheet, even when sending multiple webhooks to the production URL?” YES. I’m only getting one item added to the google sheet. The ASIN codes as well as all the other fields will be different with each request. Thats what I’m trying to do at least. But each request will have an asin code, profileName,rating,review, and a datePosted

This version is the data sent as an array. But I still only get one item sent to google sheets when there should be 11

Basically, where I’m at is it works when I’m testing but it only sends one item. The item gets inputted into the google sheet correctly, so I think the set node is working correctly, but once I activate it, I’m getting nothing. And I have changed to the production url in my code that calls the webhook.

it looks like I did not have the production url correct. I copied and pasted the URL into my code and BAM! I opened the flood gates to the pending requests.
1 Like

Sweet, glad to hear this is sorted, many thanks for confirming!