[Bug] Update Item Operation in Directus Flow emits stale event data via WebSockets / Subscriptions

I am experiencing an issue where a Directus Flow operation updates a record successfully in the database, but the emitted event payload received by WebSocket subscribers contains stale data from a previous state/flow execution.

Environment:

Directus Version: 12.2.0
Database: PostgreSQL
Realtime / Subscriptions: WebSockets

Steps to Reproduce & Observed Behavior

1. Execution of Flow 1 (First Flow)

 Operation: Update Data (update_wallet)
 Collection: wallet_accounts
 Emit Events: Enabled
 Result: The database record updates correctly (version: 22), and WebSocket subscribers receive the expected update payload:
[2026-09-21T11:45:09.504Z] UPDATE RECEIVED
[
  {
    "id": "7d37fe0e-ddba-4e11-86bf-109bf01c5412",
    "user_id": "fdc0d948-adec-4d81-9f8c-0d55f81f63c7",
    "currency": "U",
    "total_balance": "18031.00000000",
    "available_balance": "18021.00000000",
    "reserved_balance": "10.00000000",
    "status": "active",
    "version": "22",
    "date_updated": "2026-09-21T11:45:09.515Z"
  }
]

2. Execution of Flow 2 (Second Flow - Triggered after Flow 1 completes)

Operation: Update Data (update_wallets)
Collection: wallet_accounts
Emit Events: Enabled
DB State (Expected Payload): The database record is successfully updated to version: 23:
{
  "id": "7d37fe0e-ddba-4e11-86bf-109bf01c5412",
  "available_balance": "18031.00000000",
  "reserved_balance": "0",
  "version": "23"
}
Emitted Event Data (Actual Received Payload - BUG): Instead of broadcasting version 23, the client subscribed to wallet_accounts receives the stale payload from Flow 1 (version 22)
[2026-09-21T11:45:55.677Z] UPDATE RECEIVED
[
  {
    "id": "7d37fe0e-ddba-4e11-86bf-109bf01c5412",
    "user_id": "fdc0d948-adec-4d81-9f8c-0d55f81f63c7",
    "currency": "U",
    "total_balance": "18031.00000000",
    "available_balance": "18021.00000000",
    "reserved_balance": "10.00000000",
    "status": "active",
    "version": "22",
    "date_updated": "2026-09-21T11:45:09.515Z"
  }
]

Questions / Expected Behavior

Expected Result: The emitted event for Flow 2 should contain the newly updated data (version 23).
Is this caused by internal event payload caching or uncommitted database transaction states during the execution of the update operation in Flows? How can I ensure emitted events always reflect the latest DB state across multiple flow executions?

1 Answer

1

Hi @brian_nguyen, for bug reporting, please open an issue on GitHub with the same details. Thanks, Beth

Hi @beth, I have created an issue on Github, please refer the link: https://github.com/directus/directus/issues/28295 Thanks for your support, Brian

–