Hello, Bubble Community,
I’m encountering a challenge with managing image uploads and then saving them one by one in my DB and then sending them for validation in an API call in my application and would appreciate any guidance or solutions you might have.
Workflow Description:
- Image Collection: In my app, users upload 5 to 8 images as part of a task. These images are then associated with a specific task in a database field.
- Scheduled Workflow: Once images are uploaded, I have a scheduled backend workflow that iterates through these images to save them individually in a separate
Image
table. This table tracks each image’s url, a validity status (yes/no), and an error text field. - External API Validation: After all images for a task are saved, I intend to send them to an external API to validate each image’s content.
Issue Encountered:
The challenge arises due to the asynchronous nature of image saving. Image saving times vary (ranging from 3 to 10 seconds each), and since this process is asynchronous, the API call meant to validate these images sometimes occurs before some or all images have been saved. This results in the API not finding the expected images for the task, as they haven’t been saved in the system yet.
Current Setup Details:
- I’ve structured the workflow to save and then validate images asynchronously, aiming to enhance efficiency.
- The workflow checks for IMAGES (images table) associated with the task to send to validation API but often proceeds without them due to the described timing issue.
Seeking Suggestions On:
- Strategies to ensure all images are fully saved before the validation API call is made.
- Any workflow adjustments or Bubble.io features that might help synchronize these operations or better manage the timing issue.
Additional Context:
I’ve also attached a screenshot of my current workflow setup for reference. Also, as you can see I have used a plugin to add delay but sometimes even 10 secs is not enough and I think that it would be best if I have a better alternative for this.
I’m looking for advice on how to either adjust my approach to saving and validating images or how to effectively manage the asynchronous nature of these tasks to ensure all images are ready for API validation when needed.
Thank you in advance for your help and insights
Also, Find attached the workflow to save an image which is used in the above workflow.