Generating unique file names when uploading to s3

I’m scraping data from multiple urls and I need to save the data to a file in s3 after every url. How would I go about creating a unique file name so it doesn’t overwrite the previous file each time through the loop?

Everything is working flawlessly, including writing the file to s3. The only problem is, I get a single file with the scraped contents of last url in the array.

You may want to use the Code node to generate a UUID for the file name
How to Generate UUID in JavaScript | by Zachary Lee | Level Up Coding (

Or the crypto node… another option could be to add a Unix timestamp to the filename or depending on the workflow maybe $itemIndex

$itemIndex was the first thing I tried and couldn’t get it to work. Seemed like the easiest option.

I guess UUID or unixtime stamp could be the next best thing.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.