WebApps links don't point to the current workflow running. Recovering a job running is impossible once you close the browser tab.
Self Checks
- [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [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.
Dify version
0.9.1
Cloud or Self Hosted
Cloud
Steps to reproduce
- Publish a workflow as a WebApp
- configure and start the workflow Webapp
- Copy the provided url of the current job (i.e. https://udify.app/workflow/X5sFXFvXky1kFWDq).
- Close the browser tab while the job is still running.
- Reopen a tab using the permalink to the job you where provided just now.
✔️ Expected Behavior
The link should display the job currently running in the WebApp page, displaying the progress and the log, with the options to pause/stop/restart the job.
❌ Actual Behavior
The WebApps permalink provided don't point to the current workflow job running, but shows a new job start page. No configuration input is preserved. Recovering a job running is impossible once you close the browser tab.
If you try to start a new job, it would answer with: Please wait for the response to the previous message to complete.
But the user have no way to see the queue of jobs running, nor to stop/pause them or get the logs or the results.
Money is spent without any option for the user to manage the running jobs or stopping them if they are consuming too much tokens.
To address the issue of WebApps links not pointing to the current workflow running, you can use the handleBackupDraft and handleLoadBackupDraft functions from the useWorkflowRun hook. These functions help preserve and restore the workflow state, allowing job recovery after closing the browser tab.
Steps to Implement:
-
Backup the Current Workflow State: Use
handleBackupDraftto save the current state of the workflow, including nodes, edges, viewport, features, and environment variables.const { handleBackupDraft } = useWorkflowRun(); handleBackupDraft(); -
Load the Backup on Reopening: Use
handleLoadBackupDraftto restore the workflow state from the backup when reopening the application.const { handleLoadBackupDraft } = useWorkflowRun(); handleLoadBackupDraft();
These steps ensure that the workflow state is preserved and can be restored, allowing for job recovery after closing and reopening the browser tab [1][2].
To continue talking to Dosu, mention @dosu.