Recursive Backend Workflow - Numbered List

Hi everyone,

I’m trying to use Etsy’s API to display a keyword search query of listing results. Each listing image url is identified by a corresponding listing_id. To retrieve the images, I need to make two API calls, where I take the results of the first call and pass it to the 2nd call. The problem is, I cannot pass more than one listing_id through the 2nd Etsy API call at a time, so I need to set up a recursive backend workflow that loops through each returned listing_id to retrieve the entire list of images.

I’ve set up two API calls - one to retrieve all active listings, that returns the listing_id’s as a list of numbers:

and another API call to retrieve the image URLs for each corresponding listing_id. As you can see, the listing_id value only accepts one listing_id at a time:

API call #1 return listing_ids —> API Call #2 loop through each listing_id —> return each image url

I’m struggling to loop through the list of IDs and call the API for each one using a recursive backend workflow.

Can anyone provide some guidance or point me in the right direction? Any help would be greatly appreciated!

Thanks in advance.

Etsy API documentation
findAllListingsActive: https://developers.etsy.com/documentation/reference/#operation/findAllListingsActive

getListingsActive:
https://developers.etsy.com/documentation/reference/#operation/getListingImages

You could trigger an update on a list which will work in this case rather than each ID. I’ve found updating on a list will create workflows for 50-100 items or less with no trouble. Bubble tends to trigger a pile of these at once so while you have a handfull of ID as shown this should be fine

I also wrote out steps for a recursive workflow here Deleting Thousands of Records in Bulk - #7 by johnnyweb . That example is deleting items but you can modify it to update/crate records just as easily. Good luck!
JW

2 Likes

Yep, try “schedule API workflow on a list” on that field. 25 should be fine.

1 Like

Thank you @johnnyweb and @melbournemarsden ! I’m very appreciative of your guidance, this solution worked.

2 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.