dify - 💡(How to fix) Fix [Refactor/Chore] Consolidate workflow persistence async writes into default repositories [1 pull requests]

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…

Workflow persistence currently has separate repository implementations for synchronous SQLAlchemy writes and Celery-backed async writes. This makes the repository choice encode runtime behavior that should instead depend on the invocation source.

Refactor workflow persistence so the default SQLAlchemy workflow execution repositories support both synchronous and asynchronous write modes:

  • Debugger executions should keep synchronous DB writes for immediate read-after-write behavior.
  • WebApp, Service API, trigger, and other non-debug executions should enqueue Celery tasks for DB persistence.
  • The repository factory should continue to only load repository classes from configured paths.
  • The legacy Celery workflow execution repositories should be removed once the mixed-mode SQLAlchemy repositories become the default.

Root Cause

Workflow persistence currently has separate repository implementations for synchronous SQLAlchemy writes and Celery-backed async writes. This makes the repository choice encode runtime behavior that should instead depend on the invocation source.

Refactor workflow persistence so the default SQLAlchemy workflow execution repositories support both synchronous and asynchronous write modes:

  • Debugger executions should keep synchronous DB writes for immediate read-after-write behavior.
  • WebApp, Service API, trigger, and other non-debug executions should enqueue Celery tasks for DB persistence.
  • The repository factory should continue to only load repository classes from configured paths.
  • The legacy Celery workflow execution repositories should be removed once the mixed-mode SQLAlchemy repositories become the default.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for refactors or chores; if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template and fill in all the required fields.

Description

Workflow persistence currently has separate repository implementations for synchronous SQLAlchemy writes and Celery-backed async writes. This makes the repository choice encode runtime behavior that should instead depend on the invocation source.

Refactor workflow persistence so the default SQLAlchemy workflow execution repositories support both synchronous and asynchronous write modes:

  • Debugger executions should keep synchronous DB writes for immediate read-after-write behavior.
  • WebApp, Service API, trigger, and other non-debug executions should enqueue Celery tasks for DB persistence.
  • The repository factory should continue to only load repository classes from configured paths.
  • The legacy Celery workflow execution repositories should be removed once the mixed-mode SQLAlchemy repositories become the default.

Motivation

This simplifies the workflow persistence architecture by keeping storage behavior in the default repositories and letting the persistence layer select the write mode from InvokeFrom. It removes duplicated repository implementations and avoids using configuration paths to switch behavior that is runtime-specific.

Additional Context

Celery tasks remain as the async write mechanism. The removed pieces are the old Celery repository classes, their exports, tests, and obsolete workflow node execution storage config.

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