dify - 💡(How to fix) Fix Workflow runs indefinitely past APP_MAX_EXECUTION_TIME, stuck in "running" status [UI] [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langgenius/dify#35465Fetched 2026-04-22 08:04:01
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
1
Author
Timeline (top)
labeled ×2closed ×1commented ×1mentioned ×1

Error Message

The workflow should be forcibly terminated once APP_MAX_EXECUTION_TIME is exceeded, and the run should be marked as failed with a timeout error. No timeout error is shown.

RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.13.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Bug Description: When a workflow is triggered, it continues running beyond the timeout value set in APP_MAX_EXECUTION_TIME (in .env). The workflow run is displayed in the UI with a running status indefinitely and never transitions to a failed or completed state.

Steps to Reproduce:

Set APP_MAX_EXECUTION_TIME to a specific value in .env (default 1200). Create a workflow that is designed to run longer than this limit (e.g., a long LLM chain or loop). Trigger the workflow via the UI or API. Observe the run status in the UI — it remains running past the configured timeout. Check the workflow_runs table in the database — it is empty. Check the Celery worker — no task record is present.

✔️ Expected Behavior

The workflow should be forcibly terminated once APP_MAX_EXECUTION_TIME is exceeded, and the run should be marked as failed with a timeout error.

❌ Actual Behavior

The workflow run stays in running status in the UI without ever resolving. No timeout error is shown. The workflow_runs table in the database contains no record of the run. The worker queue also shows no record of the run.

extent analysis

TL;DR

The workflow run exceeds the APP_MAX_EXECUTION_TIME without being terminated, suggesting an issue with the timeout enforcement mechanism.

Guidance

  • Review the Celery worker configuration to ensure it is properly set up to handle timeouts and task termination.
  • Verify that the APP_MAX_EXECUTION_TIME value is being correctly read from the .env file and applied to the workflow execution.
  • Investigate the database connection and workflow run logging to understand why the workflow_runs table remains empty.
  • Check the UI code to ensure it is correctly updating the run status based on the workflow execution outcome.

Example

No code snippet is provided as the issue description does not include specific code references.

Notes

The issue may be related to the interaction between the Celery worker, the database, and the UI. Further investigation is needed to determine the root cause.

Recommendation

Apply a workaround by manually terminating the workflow run after the timeout period and updating the UI to reflect the failed status, until the root cause is identified and fixed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING