fix(Microsoft Outlook Trigger Node): Show nested subfolders in folder dropdowns#28759
Merged
BerniWittmann merged 1 commit intomasterfrom Apr 28, 2026
Conversation
… dropdowns Paginate child folder requests with microsoftApiRequestAllItems so folders with many children are returned in full, and prefix subfolder display names with their parent path so they are distinguishable from top-level folders in the picker.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Performance ComparisonComparing current → latest master → 14-day baseline docker-stats
Memory consumption baseline with starter plan resources
Idle baseline with Instance AI module loaded
How to read this table
|
Contributor
There was a problem hiding this comment.
No issues found across 6 files
Architecture diagram
sequenceDiagram
participant UI as n8n UI (Dropdown/Locator)
participant Node as Outlook Node (Methods)
participant Transport as Subfolder Helper (getSubfolders)
participant Helper as MS API Helper (RequestAllItems)
participant Graph as Microsoft Graph API
Note over UI,Graph: Folder Retrieval Flow (loadOptions or listSearch)
UI->>Node: Request folders list
Node->>Helper: GET /mailFolders
Helper->>Graph: Request top-level folders
Graph-->>Helper: Return folder list
Helper-->>Node: Return folder objects
Node->>Transport: CHANGED: getSubfolders(folders, addPath=true)
loop For each folder where childFolderCount > 0
Transport->>Helper: CHANGED: Fetch ALL children via microsoftApiRequestAllItems
loop Pagination
Helper->>Graph: GET .../childFolders
Graph-->>Helper: Return items + @odata.nextLink
end
Helper-->>Transport: Return flattened list of subfolders
opt NEW: if addPathToDisplayName is true
Transport->>Transport: Recursively prepend parent path<br/>(e.g., "Inbox/Work/Q2")
end
end
Transport-->>Node: Return complete flat list with paths
Node-->>UI: Return INodePropertyOptions (Display Name + ID)
alexander-gekov
approved these changes
Apr 28, 2026
Member
alexander-gekov
left a comment
There was a problem hiding this comment.
Tested and subfolders appear correctly in the two places mentioned in the description 👍
Merged
Contributor
|
Got released with |
This file contains hidden or 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
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.
Summary
The Microsoft Outlook Trigger's "Folders to Include" / "Folders to Exclude" dropdowns only surfaced top-level mail folders, so users couldn't target Inbox subfolders. Two bugs combined:
getSubfoldersused a non-paginated request (dropping children past the first page), andgetFolderscalled it without theaddPathToDisplayNameflag, so subfolders rendered as bare names and looked indistinguishable from top-level folders.This change switches child folder fetches to
microsoftApiRequestAllItemsfor full pagination and enables the path prefix in bothgetFolders(loadOptions) andsearchFolders(resource locator), so picker entries now render asInbox/Work/Q2. The action node's message-filter dropdown benefits from the same fix.How to test: Add a Microsoft Outlook Trigger, open Filters → Folders to Include, and confirm nested subfolders appear with full paths. Verify the same on Microsoft Outlook → Message → Get Many → Filters. Unit tests cover pagination via
@odata.nextLink, recursive path building, and thechildFolderCount === 0short-circuit.Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/NODE-4852
Fixes #17078
Review / Merge checklist
🤖 PR Summary generated by AI