PHANTOM
🇮🇳 IN
Skip to content

[Bug] Workflow Webapp: Copy button stays disabled after Human Input node pause/resume #32649

@uskaidev

Description

@uskaidev

Self Checks

  • This is only for bug reports. For questions, please head to Discussions.
  • I have searched for existing issues. No duplicate found.
  • I have provided all relevant information.

Describe the bug

When a Workflow app uses Human Input nodes, the copy button in the Webapp result screen remains disabled (greyed out) after the workflow completes. Users cannot copy the final output text.

Root Cause Analysis

In web/app/components/share/text-generation/result/index.tsx:

  1. tempMessageId is assigned workflow_run_id in onWorkflowStarted (~line 299)
  2. messageId state is set from tempMessageId in onWorkflowFinished (~line 494)
  3. When the workflow pauses at a Human Input node, onWorkflowPaused reconnects SSE via sseGet (~line 554). However, tempMessageId is a local variable scoped to the original handleRun closure — it is not preserved across the new SSE connection's callbacks
  4. As a result, when onWorkflowFinished fires after resume, tempMessageId is undefined, so messageId remains null
  5. The copy button has disabled={isError || !messageId}, which stays true

Suggested fix

In onWorkflowPaused, before reconnecting SSE, capture and restore tempMessageId from the paused workflow's workflow_run_id:

onWorkflowPaused: () => {
  // ... existing code ...
  // Preserve tempMessageId for the resumed SSE connection
  const pausedRunId = workflowProcessData.id
  // When reconnecting:
  tempMessageId = pausedRunId  // ensure it's available in the new closure
}

Steps to Reproduce

  1. Create a Workflow app containing at least one Human Input node
  2. Publish the app as a Webapp
  3. Run the workflow — it pauses at the Human Input node
  4. Submit the form (approve/revise/reject)
  5. Workflow finishes successfully
  6. Observe the copy button in the result area — it is disabled

Expected Behavior

The copy button should be active after the workflow completes, allowing users to copy the output text.

Actual Behavior

The copy button remains disabled/greyed out. The only workaround is manual text selection or viewing the output in the workflow tracing/log panel.

Environment

  • Dify version: 1.13.0 (self-hosted, Docker)
  • Browser: Chrome (also reproducible in other browsers)
  • OS: macOS / Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions