fix(core): Reduce large relay message payloads to protect Redis #12342
+118
−23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
It is possible for a manual execution in scaling mode to cause so much data to flow through Redis that it becomes unresponsive. Specifically, the
nodeExecuteAfter
andexecutionFinished
events may carry arbitrarily large payloads.In this PR we replace payloads above a 5 MB limit with placeholders that signal the UI to direct the user to view the full payload in execution history instead. Events with payloads below the size limit continue to be sent and displayed as usual.
In future, we can override these placeholders with the full execution data fetched from the DB at the end of the execution. Since we are already planning to refactor execution data handling on the client in the near future, that change is out of scope for this PR.
Testing
OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true
docker exec -it <container> redis-cli monitor
localhost:3000
serving a 30 MB payloadFetch large payload
node have been trimmedRecording: https://share.cleanshot.com/GCrCsPXw
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/PAY-2403/reduce-large-relay-message-payloads-to-protect-redis
Review / Merge checklist
Docs updated or follow-up ticket createdTests includedPR labeled withrelease/backport