Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebApps links don't point to the current workflow running. Recovering a job running is impossible once you close the browser tab. #9152

Open
5 tasks done
Emasoft opened this issue Oct 10, 2024 · 1 comment
Labels
💪 enhancement New feature or request

Comments

@Emasoft
Copy link

Emasoft commented Oct 10, 2024

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • 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.

@dosubot dosubot bot added the 🐞 bug Something isn't working label Oct 10, 2024
Copy link

dosubot bot commented Oct 10, 2024

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:

  1. Backup the Current Workflow State:
    Use handleBackupDraft to save the current state of the workflow, including nodes, edges, viewport, features, and environment variables.

    const { handleBackupDraft } = useWorkflowRun();
    handleBackupDraft();
  2. Load the Backup on Reopening:
    Use handleLoadBackupDraft to 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.

@crazywoola crazywoola added 💪 enhancement New feature or request and removed 🐞 bug Something isn't working labels Oct 10, 2024
@crazywoola crazywoola changed the title [BUG] WebApps links don't point to the current workflow running. Recovering a job running is impossible once you close the browser tab. WebApps links don't point to the current workflow running. Recovering a job running is impossible once you close the browser tab. Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants