Upload multiple JSONL files (stagedUploadsCreate)

Hello,
We are looking at Bulk mutation to update metafields of all variants, it’s working well with a smaller number of variants, but for over 10k variants JSONL file goes over 20MB and Bulk mutation’s file size limit is 20MB, we can chunk the files in less than 20MB and create multiple JSONL files, my question is can we use the same stagedTarget info from a single call to stagedUploadsCreate to upload multiple jsonl files in a sequence, for example, Upload first chunk → wait for webhook → upload second chunk etc… or we need to call stagedUploadsCreate for every chunk

Hope above makes sense!

So it looks like you cannot reuse the same stagedTarget information from a single call to stagedUploadsCreate for multiple JSONL file uploads in sequence. Each chunk of the JSONL file would require its own stagedUploadsCreate call to generate a unique stagedTarget for that specific file.

The stagedUploadsCreate mutation is designed to create upload targets for individual files based on their metadata, such as filename, MIME type, and size. Each upload target is specific to the file it is created for, and reusing it for another file would not work as expected. What you’ll need to do is for each chunk:

  • Call the stagedUploadsCreate mutation to generate a new upload target.
  • Upload the chunk using the provided stagedTarget URL and parameters.
  • Wait for the webhook or confirmation of the upload’s completion.

Then proceed to the next chunk and repeat the process.

Thanks @Liam-Shopify for looking into, it

1 Like