-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): Support bidirectional communication between specific mains and specific workers #10377
Merged
ivov
merged 2 commits into
master
from
pay-1835-bidirectional-worker-to-main-communication
Aug 20, 2024
Merged
feat(core): Support bidirectional communication between specific mains and specific workers #10377
ivov
merged 2 commits into
master
from
pay-1835-bidirectional-worker-to-main-communication
Aug 20, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…s and specific workers
n8n-assistant
bot
added
core
Enhancement outside /nodes-base and /editor-ui
n8n team
Authored by the n8n team
labels
Aug 13, 2024
valya
approved these changes
Aug 20, 2024
|
Test summaryRun details
Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Cloud |
✅ All Cypress E2E specs passed |
netroy
added a commit
to netroy/n8n
that referenced
this pull request
Aug 21, 2024
# [1.56.0](https://github.com/netroy/n8n/compare/n8n@1.55.0...n8n@1.56.0) (2024-08-20) ### Bug Fixes * Better errors in Switch, If and Filter nodes ([n8n-io#10457](https://github.com/netroy/n8n/issues/10457)) ([aea82cb](aea82cb)) * **core:** Fix payload property in `workflow-post-execute` event ([n8n-io#10413](https://github.com/netroy/n8n/issues/10413)) ([d98e29e](d98e29e)) * **core:** Fix XSS validation and separate URL validation ([n8n-io#10424](https://github.com/netroy/n8n/issues/10424)) ([91467ab](91467ab)) * **core:** Use explicit types in configs to ensure valid decorator metadata ([n8n-io#10433](https://github.com/netroy/n8n/issues/10433)) ([2043daa](2043daa)) * **editor:** Add workflow scopes when initializing workflow ([n8n-io#10455](https://github.com/netroy/n8n/issues/10455)) ([b857c2c](b857c2c)) * **editor:** Buffer json chunks in stream response ([n8n-io#10439](https://github.com/netroy/n8n/issues/10439)) ([37797f3](37797f3)) * **editor:** Fix flaky mapping tests ([n8n-io#10453](https://github.com/netroy/n8n/issues/10453)) ([fc6d413](fc6d413)) * **editor:** Highlight matching type in filter component ([n8n-io#10425](https://github.com/netroy/n8n/issues/10425)) ([6bca879](6bca879)) * **editor:** Show item count in output panel schema view ([n8n-io#10426](https://github.com/netroy/n8n/issues/10426)) ([4dee7cc](4dee7cc)) * **editor:** Truncate long data pill labels in schema view ([n8n-io#10427](https://github.com/netroy/n8n/issues/10427)) ([1bf2f4f](1bf2f4f)) * Filter component - improve errors ([n8n-io#10456](https://github.com/netroy/n8n/issues/10456)) ([61ac0c7](61ac0c7)) * **Google Sheets Node:** Better error when column to match on is empty ([n8n-io#10442](https://github.com/netroy/n8n/issues/10442)) ([ce46bf5](ce46bf5)) * **Google Sheets Node:** Update name and hint for useAppend option ([n8n-io#10443](https://github.com/netroy/n8n/issues/10443)) ([c5a0c04](c5a0c04)) * **Google Sheets Node:** Update to returnAllMatches option ([n8n-io#10440](https://github.com/netroy/n8n/issues/10440)) ([f7fb02e](f7fb02e)) * **Invoice Ninja Node:** Fix payment types ([n8n-io#10462](https://github.com/netroy/n8n/issues/10462)) ([129245d](129245d)) * **n8n Form Trigger Node:** Show basic authentication modal on wrong credentials ([n8n-io#10423](https://github.com/netroy/n8n/issues/10423)) ([0dc3e99](0dc3e99)) * **OpenAI Node:** Throw node operations error in case of openAi client error ([n8n-io#10448](https://github.com/netroy/n8n/issues/10448)) ([0d3ed46](0d3ed46)) * Project Viewer always seeing a connection error when testing credentials ([n8n-io#10417](https://github.com/netroy/n8n/issues/10417)) ([613cdd2](613cdd2)) * Remove unimplemented Postgres credentials options ([n8n-io#10461](https://github.com/netroy/n8n/issues/10461)) ([17ac784](17ac784)) * Require mfa code to change email ([n8n-io#10354](https://github.com/netroy/n8n/issues/10354)) ([39c8e50](39c8e50)) * **Respond to Webhook Node:** Fix issue preventing the chat trigger from working ([n8n-io#9886](https://github.com/netroy/n8n/issues/9886)) ([9d6ad88](9d6ad88)) * Show input names when node has multiple inputs ([n8n-io#10434](https://github.com/netroy/n8n/issues/10434)) ([973956c](973956c)) ### Features * **core:** Support bidirectional communication between specific mains and specific workers ([n8n-io#10377](https://github.com/netroy/n8n/issues/10377)) ([d0fc9de](d0fc9de)) * **Facebook Graph API Node:** Update node to support API v18 - v20 ([n8n-io#10419](https://github.com/netroy/n8n/issues/10419)) ([e7ee10f](e7ee10f)) Co-authored-by: netroy <196144+netroy@users.noreply.github.com>
MiloradFilipovic
added a commit
that referenced
this pull request
Aug 21, 2024
* master: fix(core): Replace `sanitize-html` with `xss` in XSS validator constraint (#10479) refactor(core): Track metrics state and categories in telemetry (no-changelog) (#10483) fix: Rename Assistant back (#10481) test(editor): Add AI Assistant e2e tests (no-changelog) (#10476) feat(core): Support bidirectional communication between specific mains and specific workers (#10377) refactor(editor): Add types to global link actions event bus (no-changelog) (#10452)
Merged
Got released with |
riascho
pushed a commit
that referenced
this pull request
Aug 26, 2024
…s and specific workers (#10377)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR allows specific a main to message one or more specific workers via a pubsub channel, and for a worker to message specific one or more specific mains via another pubsub channel. This is needed for Val's code execution agents setup - in scaling mode, workers will need to request script execution jobs from mains, and mains will need to send workers the results of those jobs completed by agents so that workers can continue executing.
Context
Scaling mode relies on two pubsub channels for mains and workers to communicate:
Implementation
In our current setup, we have
worker/handleCommandMessageWorker.ts
for worker actions in reaction to commands from the main process via the command channel,main/handleCommandMessageMain.ts
for main process actions in reaction to messages received from peers via the command channel, andmain/handleWorkerResponseMessageMain.ts
for main process actions in reaction to responses from workers via the worker response channel.Main-to-main and worker-to-main communications already support targeting specific recipients, so this PR extends the existing setup to support targeting specific recipients in main-to-worker communications. Please note the existing pubsub implementation needs heavy rework - this PR extends it as little as possible to unblock the agents initiative, until we have time to improve these foundations.
Testing
To test:
queueModeId
for a worker and for a main,handleCommandMessageWorker
andhandleWorkerResponseMessageMain
to see the messages, and