Skip to content

Add optional n8n Teams backend for alert reports and follow-up conversations - #96

Closed
JeffPengCoder wants to merge 10 commits into
NVIDIA:mainfrom
JeffPengCoder:feat/n8n-teams-bridge-upstream-20261105
Closed

JeffPengCoder wants to merge 10 commits into
NVIDIA:mainfrom
JeffPengCoder:feat/n8n-teams-bridge-upstream-20261105

Conversation

@JeffPengCoder

Copy link
Copy Markdown
Contributor

Description

Add an optional n8n Teams backend so a completed MOSAIC alert report can be delivered to a fixed Teams DM and the recipient can ask ordinary follow-up questions in that chat. Replies are read through n8n, submitted to the MOSAIC Agent with the complete report context, and published back to the same conversation. The existing native-channel backend remains the default and keeps its configuration, credentials and persistent state for switching back.

Depends on #89. The n8n implementation is commit be893bcc644f88ee9e7e0a1d892862f2886e7ce9; the n8n-only comparison contains 13 files. Until #89 merges, this PR's comparison against main also includes its parent alert-automation implementation. This branch includes the current upstream main, with the installation-guide conflict resolved by retaining both the new inference guidance and alert installation option, and the agent documentation bundle regenerated.

Behavior

  • Select modules.alertAutomation.delivery.backend: native | n8n. Native remains the default. The n8n profile has separate credentials, durable state and a View-only conversation for one configured sender/recipient pair.
  • MOSAIC initiates HTTPS requests to two authenticated n8n Webhooks: /send publishes messages and /read reads replies at a configurable interval, 30 seconds by default. This does not require n8n to call a private MOSAIC endpoint or Microsoft to reach an internal Teams Trigger callback.
  • n8n owns the approved Microsoft Teams OAuth2 credential. Each workflow verifies the signed-in sender GUID and the fixed recipient before creating or reusing their one-to-one chat. The generator exports two inactive workflows without credential values; approved OAuth and Header Auth credentials must be selected before publication.
  • MOSAIC retains the Agent loop, complete report context, conversation history, message deduplication and delivery evidence. Complete messages are chunked losslessly, platform message receipts are retained, and ambiguous outgoing sends are preserved for reconciliation instead of automatically retried.

The configured sender must be an identity authorized to use the selected Teams application. Logging into n8n does not establish that authorization. Enterprise OAuth, service-account eligibility and real Teams DM acceptance remain unverified; this PR does not claim they have passed. The current implementation supports one fixed one-to-one conversation, rather than arbitrary employee chats.

Validation

  • Final source merged with upstream 399614acfd1089c8539c60ceb56d9897046b48ac: 267 repository tests, 265 passed, 2 existing skips, 0 failures.
  • Dedicated backend/workflow coverage: 17 tests, including complete alert delivery, ordinary DM follow-up with full report context, native-context retention, peer isolation, pagination, restart deduplication, interrupted-run recovery and uncertain-send handling.
  • Actual n8n 2.46.6 engine: both generated workflows imported, activated and executed successfully against an isolated Microsoft Graph fixture. Complete Unicode message round-trip and recipient-message reads passed. No real Teams messages were sent; the temporary engine was removed.
  • Both Helm charts linted; inference chart tests passed; the agent documentation bundle freshness check passed.
  • Sphinx HTML build passed with warnings treated as errors; git diff --check passed.
  • Scope audit found no repository-wide tooling changes, personal identifiers, credential values or deployment-specific configuration in the n8n increment. Existing PR feat: add Helm-managed native alert automation plugin #89 and the deployed native backend were not modified by this submission.

Checklist

  • I am familiar with the Contributing Guidelines.
  • Every commit is signed off under the Developer Certificate of Origin.
  • New or existing validation covers these changes.
  • Documentation is up to date with these changes. Helm values and generator help describe the code-only preview; the n8n operational runbook and enterprise acceptance remain pending.

…delivery

Signed-off-by: Jeff Peng <jepeng@nvidia.com>
Signed-off-by: Jeff Peng <jepeng@nvidia.com>
Signed-off-by: Jeff Peng <jepeng@nvidia.com>
Signed-off-by: Jeff Peng <jepeng@nvidia.com>
Signed-off-by: Jeff Peng <jepeng@nvidia.com>
Signed-off-by: Jeff Peng <jepeng@nvidia.com>
Signed-off-by: Jeff Peng <jepeng@nvidia.com>
Signed-off-by: Jeff Peng <jepeng@nvidia.com>
Signed-off-by: Jeff Peng <jepeng@nvidia.com>
Retain the upstream Qwen inference guidance and the alert installation option. Regenerate the agent documentation bundle from the merged sources.

Signed-off-by: Jeff Peng <jepeng@nvidia.com>
@JeffPengCoder

Copy link
Copy Markdown
Contributor Author

Withdrawing this PR temporarily while contribution review coverage and third-party licensing requirements are confirmed. The code branch is retained for a later submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant