dify icon indicating copy to clipboard operation
dify copied to clipboard

[Feature Request] Let the iteration block skip the iteration with error if one iteration fails, and go to the next

Open Emasoft opened this issue 1 year ago • 0 comments

Self Checks

  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [X] Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Let the iteration block skip the iteration with error if one iteration fails, and go to the next. Currently if some iteration fails with error, the entire bunch of iterations done is wasted, and those remaining are not even tried. But this is wrong, since it would be normal for a batch of input data to have some malformed input that would give error. For example: I was running a very long workflow (20+ minutes), and on a batch of 150 iterations, the iteration 132 failed with error, and everything stopped. I wasted money, even if the documents produced for the first 131 iterations were correctly processed and ready to be sent out or saved, they were LOST. I WASTED TIME AND MONEY. Also, all the remaining iterations were not processed either, even if they were probably process without errors. The iteration block should just SKIP the failed iterations and continue with the NEXT until all are processed. The failed iterations should not be sent as output, but those completed correctly should be sent as output to continue the workflow to the next block. You should just report the failed iterations on a log or something, so that the user can use those logs to retry with better input data or a different prompt later. Losing money and data is not good. Please update the iteration block to add this functionality. Thanks.

2. Additional context or comments

An additional issue is the missing TEMP STORAGE for the Iteration Block. The iteration block needs a temp storage space for the temporary outputs, so even if the process crashes elsewhere, we can recover the already processed files. Currently I'm using the tracking box to manually copy/paste the intermediate output content of the iterations (with errors or successful) and it is not very practical. The best way would be to let any iteration block to have a special "temp" folder (on the website itself or on a user choosen cloud service like any SFTP/SSH remote server, gdrive, one drive, dropbox, AWS, Jottacloud, Tailscale, etc. ) so that the user can download and handle the temp files and even continue the iteration from where it was stopped, resuming the workflow with a "Pause/Start" button. This temp storage should not be deleted automatically if the workflow stops. Only the user can decide to clear it (with a simple button named 'empty temp files') The only option would be to overwrite or not the existing temp files if the workflow is run again. Ideally, an option to automatically tesume the workflow using those temp files would be offered to the user by default.

3. Can you help us with this feature?

  • [ ] I am interested in contributing to this feature.

Emasoft avatar Oct 09 '24 09:10 Emasoft