Skip to content

feat(AwsS3 Node): Add option to return common prefixes in bucket search#28571

Merged
Joffcom merged 4 commits intomasterfrom
node-4853-aws-s3-node-add-option-to-return-common-prefixes
Apr 23, 2026
Merged

feat(AwsS3 Node): Add option to return common prefixes in bucket search#28571
Joffcom merged 4 commits intomasterfrom
node-4853-aws-s3-node-add-option-to-return-common-prefixes

Conversation

@Joffcom
Copy link
Copy Markdown
Member

@Joffcom Joffcom commented Apr 16, 2026

Summary

Adds an Include Common Prefixes boolean option (default: false) to the AWS S3 node's bucket:search operation (Additional Fields).

When a Delimiter is set (e.g. /), the S3 ListObjectsV2 API returns two distinct result sets:

  • Contents — individual objects that don't share the delimiter grouping
  • CommonPrefixes — grouped "virtual folder" entries (e.g. photos/, logs/)

Previously the node always returned Contents only. With this option enabled, the node returns CommonPrefixes instead, allowing users to do shallow directory-style listings.

Changes:

  • New includeCommonPrefixes field in additionalFields (description notes it only works when Delimiter is set)
  • Both the returnAll and paginated paths respect the new option
  • Single-object xml2js responses are now normalised to arrays in the else branch (correctness fix)
  • Added first-ever unit tests for the bucket:search operation (6 test cases)

How to test:

  1. Configure an AWS S3 node with bucket:search operation
  2. Set a Delimiter (e.g. /) and a Prefix pointing at a "folder"
  3. Toggle Include Common Prefixes on — output should contain { Prefix: "..." } entries
  4. Toggle off — output should contain { Key: "...", Size: "..." } entries

Images showing it in action:
image

image image image image

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/NODE-4853

Review / Merge checklist

  • I have seen this code, I have run this code, and I take responsibility for this code.
  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)

🤖 PR Summary generated by AI

@Joffcom Joffcom marked this pull request as ready for review April 16, 2026 11:16
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Bundle Report

Changes will increase total bundle size by 31.17kB (0.07%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
editor-ui-esm 45.79MB 31.17kB (0.07%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: editor-ui-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/worker-*.js 528 bytes 3.17MB 0.02%
assets/constants-*.js -24 bytes 3.14MB -0.0%
assets/src-*.js -1.86MB 568.21kB -76.62%
assets/src-*.js (New) 2.44MB 2.44MB 100.0% 🚀
assets/DataTableTable-*.js 35 bytes 1.61MB 0.0%
assets/index-*.js 31 bytes 1.31MB 0.0%
assets/ParameterInputList-*.js 6.21kB 1.28MB 0.49%
assets/users.store-*.js 32 bytes 1.05MB 0.0%
assets/NDVEmptyState-*.js 15.65kB 737.05kB 2.17%
assets/src-*.css 50 bytes 495.51kB 0.01%
assets/useCanvasMapping-*.js 35 bytes 463.33kB 0.01%
assets/sanitize-*.js 1.63kB 421.97kB 0.39%
assets/RunData-*.js 33 bytes 345.9kB 0.01%
assets/InstanceAiView-*.js 35 bytes 345.61kB 0.01%
assets/useImportCurlCommand-*.js 317 bytes 324.58kB 0.1%
assets/WorkflowDiffView-*.js 35 bytes 207.19kB 0.02%
assets/WorkflowsView-*.js -2 bytes 201.71kB -0.0%
assets/NodeView-*.js 35 bytes 137.27kB 0.03%
assets/usePostMessageHandler-*.js 34 bytes 137.09kB 0.02%
assets/useRootStore-*.js 540 bytes 131.79kB 0.41%
assets/WorkflowLayout-*.js 35 bytes 127.87kB 0.03%
assets/router-*.js -994 bytes 118.32kB -0.83%
assets/canvas.eventBus-*.js -2 bytes 117.39kB -0.0%
assets/SettingsSso-*.js -2 bytes 106.37kB -0.0%
assets/NodeCreator-*.js 34 bytes 104.07kB 0.03%
assets/empty-*.js 76 bytes 100.55kB 0.08%
assets/useCanvasOperations-*.js 35 bytes 95.41kB 0.04%
assets/VirtualSchema-*.js 34 bytes 94.5kB 0.04%
assets/NodeSettings-*.js 34 bytes 84.64kB 0.04%
assets/CanvasRunWorkflowButton-*.js 34 bytes 78.31kB 0.04%
assets/ProjectSettings-*.js 34 bytes 74.1kB 0.05%
assets/FixedCollectionParameter-*.js 35 bytes 73.79kB 0.05%
assets/SettingsLdapView-*.js -2 bytes 71.37kB -0.0%
assets/WorkflowHistory-*.js -3 bytes 71.02kB -0.0%
assets/ChatGreetings-*.js 34 bytes 68.74kB 0.05%
assets/TriggerPanel-*.js 34 bytes 59.29kB 0.06%
assets/RunDataJsonActions-*.js -2 bytes 59.27kB -0.0%
assets/ChatView-*.js 34 bytes 58.04kB 0.06%
assets/core-*.js -570.36kB 57.59kB -90.83%
assets/CreditWarningBanner-*.js 35 bytes 55.21kB 0.06%
assets/semver-*.js 256 bytes 52.01kB 0.49%
assets/chat.store-*.js -2 bytes 49.27kB -0.0%
assets/SettingsMCPView-*.js -2 bytes 48.71kB -0.0%
assets/TemplatesSearchView-*.js -2 bytes 47.29kB -0.0%
assets/SettingsInstanceAiView-*.js -2 bytes 44.62kB -0.0%
assets/AppSidebar-*.js -2 bytes 43.24kB -0.0%
assets/NodeDetailsView-*.js 35 bytes 42.49kB 0.08%
assets/useLogsTreeExpand-*.js 34 bytes 41.28kB 0.08%
assets/readyToRunWorkflows.store-*.js 35 bytes 40.77kB 0.09%
assets/NodeDetailsViewV2-*.js 35 bytes 38.06kB 0.09%
assets/ExecutionsView-*.js 34 bytes 36.09kB 0.09%
assets/AgentEditorModal-*.js 34 bytes 34.61kB 0.1%
assets/WorkflowExecutionsView-*.js -2 bytes 33.27kB -0.01%
assets/ProjectRoleView-*.js 35 bytes 32.66kB 0.11%
assets/SettingsUsersView-*.js 34 bytes 32.62kB 0.1%
assets/RunDataTable-*.js -3 bytes 31.8kB -0.01%
assets/usePushConnection-*.js -2 bytes 31.37kB -0.01%
assets/WorkflowExecutionsPreview-*.js -2 bytes 31.24kB -0.01%
assets/ExecutionsTime-*.js -4 bytes 29.45kB -0.01%
assets/ResourcesListLayout-*.js 35 bytes 29.21kB 0.12%
assets/SettingsSecretsProviders.ee-*.js -3 bytes 28.73kB -0.01%
assets/useRunWorkflow-*.js 35 bytes 27.9kB 0.13%
assets/SettingsChatHubView-*.js -2 bytes 27.84kB -0.01%
assets/WorkerView-*.js -2 bytes 27.82kB -0.01%
assets/ProjectHeader-*.js 35 bytes 27.46kB 0.13%
assets/CredentialsView-*.js -2 bytes 24.75kB -0.01%
assets/InstanceAiOptinModal-*.js -2 bytes 24.73kB -0.01%
assets/SettingsSourceControl-*.js -3 bytes 24.67kB -0.01%
assets/RecommendedTemplateCard-*.js -2 bytes 24.07kB -0.01%
assets/EvaluationsRootView-*.js 34 bytes 22.98kB 0.15%
assets/readyToRun.store-*.js 35 bytes 22.85kB 0.15%
assets/resourceCenterData-*.js -2 bytes 21.58kB -0.01%
assets/ChatLayout-*.js -2 bytes 21.47kB -0.01%
assets/useCustomAgent-*.js -2 bytes 20.8kB -0.01%
assets/InsightsDashboard-*.js -2 bytes 20.64kB -0.01%
assets/ProjectVariables-*.js 35 bytes 20.48kB 0.17%
assets/AddDataTableModal-*.js -2 bytes 20.19kB -0.01%
assets/aiTemplatesStarterCollection.store-*.js 35 bytes 20.18kB 0.17%
assets/assistant.store-*.js -2 bytes 19.37kB -0.01%
assets/ToolsManagerModal-*.js 35 bytes 19.14kB 0.18%
assets/SettingsUsageAndPlan-*.js -3 bytes 19.09kB -0.02%
assets/EvaluationsView-*.js 34 bytes 18.84kB 0.18%
assets/MainSidebarHeader-*.js 34 bytes 18.31kB 0.19%
assets/DataTableActions-*.js -2 bytes 18.27kB -0.01%
assets/SecuritySettings-*.js 34 bytes 18.06kB 0.19%
assets/TestRunDetailView-*.js -2 bytes 17.91kB -0.01%
assets/SettingsLogStreamingView-*.js -2 bytes 17.48kB -0.01%
assets/SettingsPersonalView-*.js -2 bytes 17.15kB -0.01%
assets/SettingsCommunityNodesView-*.js -2 bytes 16.47kB -0.01%
assets/ResourceCenterView-*.js -2 bytes 15.76kB -0.01%
assets/DataTableView-*.js -2 bytes 14.96kB -0.01%
assets/ProviderSettingsModal-*.js -2 bytes 14.82kB -0.01%
assets/DataTableDetailsView-*.js -2 bytes 14.57kB -0.01%
assets/MigrationRules-*.js 35 bytes 14.36kB 0.24%
assets/useQuickConnect-*.js -2 bytes 14.27kB -0.01%
assets/ProjectSharing-*.js 35 bytes 14.06kB 0.25%
assets/CredentialPicker-*.js -2 bytes 13.83kB -0.01%
assets/SettingsApiView-*.js -3 bytes 13.75kB -0.02%
assets/ProjectRolesView-*.js -2 bytes 13.67kB -0.01%
assets/TemplatesCollectionView-*.js -2 bytes 13.47kB -0.01%
assets/SigninView-*.js 35 bytes 13.37kB 0.26%
assets/TemplateList-*.js -2 bytes 13.13kB -0.02%
assets/SetupTemplateFormStep-*.js -3 bytes 13.01kB -0.02%
assets/SetupWorkflowFromTemplateView-*.js -2 bytes 12.6kB -0.02%
assets/ToolSettingsContent-*.js -2 bytes 12.38kB -0.02%
assets/ToolsSelector-*.js -2 bytes 12.31kB -0.02%
assets/MigrationRuleDetail-*.js 35 bytes 12.27kB 0.29%
assets/SettingsExternalSecrets-*.js -3 bytes 11.26kB -0.03%
assets/collaboration.store-*.js -2 bytes 11.21kB -0.02%
assets/NodeCreation-*.js -2 bytes 10.85kB -0.02%
assets/MCPConnectWorkflowsModal-*.js -2 bytes 10.67kB -0.02%
assets/useActions-*.js -2 bytes 10.41kB -0.02%
assets/DependencyPill-*.js -2 bytes 10.2kB -0.02%
assets/OAuthConsentView-*.js -2 bytes 10.0kB -0.02%
assets/SettingsAiGatewayView-*.js -2 bytes 10.0kB -0.02%
assets/ProjectCardBadge-*.js -2 bytes 9.35kB -0.02%
assets/ResolversView-*.js -2 bytes 9.3kB -0.02%
assets/usePinnedData-*.js -2 bytes 9.13kB -0.02%
assets/folders.store-*.js -2 bytes 8.99kB -0.02%
assets/CommunityNodeUpdateInfo-*.js -2 bytes 8.96kB -0.02%
assets/SkeletonAgentCard-*.js 35 bytes 8.82kB 0.4%
assets/ResourceCenterSectionView-*.js -2 bytes 8.62kB -0.02%
assets/InsightsTableWorkflows-*.js -2 bytes 8.54kB -0.02%
assets/InsightsSummary-*.js -3 bytes 8.48kB -0.04%
assets/WorkflowExecutionsInfoAccordion-*.js -2 bytes 8.45kB -0.02%
assets/TagsDropdown-*.js 35 bytes 8.31kB 0.42%
assets/FolderBreadcrumbs-*.js -2 bytes 7.93kB -0.03%
assets/WorkflowPreview-*.js -2 bytes 7.92kB -0.03%
assets/RunDataParsedAiContent-*.js -2 bytes 7.89kB -0.03%
assets/ChatPersonalAgentsView-*.js 35 bytes 7.75kB 0.45%
assets/banners.store-*.js -2 bytes 7.71kB -0.03%
assets/ResourceFiltersDropdown-*.js -2 bytes 7.61kB -0.03%
assets/ExternalSecretsProviderConnectionSwitch.ee-*.js -2 bytes 7.61kB -0.03%
assets/WorkflowLocation-*.js -2 bytes 7.48kB -0.03%
assets/useCredentialResolvers-*.js -2 bytes 7.14kB -0.03%
assets/useGlobalEntityCreation-*.js -2 bytes 7.09kB -0.03%
assets/chatPanel.store-*.js -2 bytes 6.84kB -0.03%
assets/TemplatesWorkflowView-*.js -2 bytes 6.79kB -0.03%
assets/SettingsAIView-*.js -2 bytes 6.66kB -0.03%
assets/TimeAgo-*.js -2 bytes 6.57kB -0.03%
assets/useSettingsItems-*.js -2 bytes 6.43kB -0.03%
assets/useWorkflowActivate-*.js -2 bytes 6.25kB -0.03%
assets/insights.utils-*.js -2 bytes 6.18kB -0.03%
assets/ContactAdministratorToInstall-*.js -3 bytes 5.91kB -0.05%
assets/ChatWorkflowAgentsView-*.js 35 bytes 5.63kB 0.63%
assets/useExecutionDebugging-*.js -2 bytes 5.62kB -0.04%
assets/CredentialSelectorModal-*.js -2 bytes 5.6kB -0.04%
assets/RunDataSearch-*.js 35 bytes 5.55kB 0.63%
assets/LoadingView-*.js -2 bytes 5.4kB -0.04%
assets/SettingsLayout-*.js -2 bytes 5.19kB -0.04%
assets/AuthView-*.js -2 bytes 4.76kB -0.04%
assets/ModelByIdSelectorModal-*.js -2 bytes 4.64kB -0.04%
assets/ChangePasswordView-*.js -2 bytes 4.44kB -0.05%
assets/ToolSettingsModal-*.js -2 bytes 4.32kB -0.05%
assets/SetupWorkflowCredentialsButton-*.js -2 bytes 4.31kB -0.05%
assets/WorkflowExecutionsLandingPage-*.js -2 bytes 4.28kB -0.05%
assets/usePageRedirectionHelper-*.js -2 bytes 4.07kB -0.05%
assets/ProjectBreadcrumb-*.js -2 bytes 4.0kB -0.05%
assets/ChatAgentAvatar-*.js -2 bytes 3.8kB -0.05%
assets/SignupView-*.js -2 bytes 3.74kB -0.05%
assets/DemoDiffView-*.js -2 bytes 3.53kB -0.06%
assets/useExecutionHelpers-*.js -2 bytes 3.33kB -0.06%
assets/TemplatesView-*.js -2 bytes 3.29kB -0.06%
assets/CopyInput-*.js -2 bytes 3.25kB -0.06%
assets/SetupView-*.js -2 bytes 3.06kB -0.07%
assets/EntityNotFound-*.js -2 bytes 3.04kB -0.07%
assets/ForgotMyPasswordView-*.js -2 bytes 3.0kB -0.07%
assets/SettingsInstanceRegistryView-*.js -2 bytes 2.99kB -0.07%
assets/EntityUnAuthorised-*.js -2 bytes 2.86kB -0.07%
assets/ConnectionTracker-*.js -2 bytes 2.84kB -0.07%
assets/SelectedItemsInfo-*.js -2 bytes 2.67kB -0.07%
assets/ErrorView-*.js -2 bytes 2.66kB -0.08%
assets/utils-*.js -2 bytes 2.49kB -0.08%
assets/InsightsPaywall-*.js -2 bytes 2.4kB -0.08%
assets/InsightsChartTimeSaved-*.js -2 bytes 2.34kB -0.09%
assets/InsightsChartAverageRuntime-*.js -2 bytes 2.29kB -0.09%
assets/WorkflowOnboardingView-*.js -2 bytes 2.25kB -0.09%
assets/useFreeAiCredits-*.js -2 bytes 2.18kB -0.09%
assets/SamlOnboarding-*.js -2 bytes 2.18kB -0.09%
assets/InsightsChartFailureRate-*.js 35 bytes 2.08kB 1.71%
assets/dateFormatter-*.js -2 bytes 2.04kB -0.1%
assets/InsightsChartTotal-*.js 35 bytes 1.97kB 1.81%
assets/InsightsChartFailed-*.js 35 bytes 1.85kB 1.93%
assets/EmptySharedSectionActionBox-*.js -2 bytes 1.55kB -0.13%
assets/SignoutView-*.js -2 bytes 1.08kB -0.18%
assets/useActivationError-*.js -2 bytes 824 bytes -0.24%

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Architecture diagram
sequenceDiagram
    participant WF as Workflow Engine
    participant Node as AwsS3V2 Node
    participant Helpers as GenericFunctions (REST)
    participant S3 as AWS S3 API

    WF->>Node: execute("bucket:search")
    
    Node->>Helpers: awsApiRequestREST (Get Location)
    Helpers->>S3: GET /?location
    S3-->>Helpers: XML LocationConstraint
    Helpers-->>Node: Region string

    Note over Node: NEW: Determine property to extract<br/>based on 'delimiter' AND 'includeCommonPrefixes'

    alt returnAll is true
        Node->>Helpers: CHANGED: awsApiRequestRESTAllItems()
        Note right of Node: Pass 'ListBucketResult.CommonPrefixes' <br/>OR 'ListBucketResult.Contents'
        loop Pagination
            Helpers->>S3: GET Bucket (ListObjectsV2)
            S3-->>Helpers: XML Response
        end
        Helpers-->>Node: Combined items array
    else returnAll is false (Limit set)
        Node->>Helpers: awsApiRequestREST()
        Helpers->>S3: GET Bucket (ListObjectsV2)
        S3-->>Helpers: XML Response
        Helpers-->>Node: rawResponse (JSON)
        
        Note over Node: NEW: Extract property from rawResponse
        
        alt CHANGED: Result is single object (xml2js behavior)
            Node->>Node: Wrap in Array [item]
        else Result is already array
            Node->>Node: Keep as Array
        else Result is empty
            Node->>Node: Return []
        end
    end

    Node-->>WF: Return JSON Array
Loading

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ackages/nodes-base/nodes/Aws/S3/V2/AwsS3V2.node.ts 80.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Performance Comparison

Comparing currentlatest master14-day baseline

Idle baseline with Instance AI module loaded

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
instance-ai-heap-used-baseline 186.76 MB 186.83 MB 186.46 MB (σ 0.26) -0.0% +0.2% ⚠️
instance-ai-rss-baseline 393.34 MB 343.82 MB 366.71 MB (σ 22.88) +14.4% +7.3% ⚠️

Memory consumption baseline with starter plan resources

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
memory-rss-baseline 286.77 MB 286.68 MB 289.59 MB (σ 40.91) +0.0% -1.0%
memory-heap-used-baseline 115.02 MB 114.56 MB 114.47 MB (σ 0.23) +0.4% +0.5% 🔴

docker-stats

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
docker-image-size-n8n 1269.76 MB 1290.24 MB 1274.58 MB (σ 10.93) -1.6% -0.4%
docker-image-size-runners 413.00 MB 387.00 MB 391.94 MB (σ 10.84) +6.7% +5.4% ⚠️
How to read this table
  • Current: This PR's value (or latest master if PR perf tests haven't run)
  • Latest Master: Most recent nightly master measurement
  • Baseline: Rolling 14-day average from master
  • vs Master: PR impact (current vs latest master)
  • vs Baseline: Drift from baseline (current vs rolling avg)
  • Status: ✅ within 1σ | ⚠️ 1-2σ | 🔴 >2σ regression

@Joffcom Joffcom requested a review from elsmr April 16, 2026 14:08
@Joffcom Joffcom added this pull request to the merge queue Apr 22, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 22, 2026
@Joffcom Joffcom enabled auto-merge April 23, 2026 08:54
@n8n-assistant n8n-assistant Bot added n8n team Authored by the n8n team node/improvement New feature or request labels Apr 23, 2026
@Joffcom Joffcom added this pull request to the merge queue Apr 23, 2026
Merged via the queue into master with commit 13dbcf9 Apr 23, 2026
48 checks passed
@Joffcom Joffcom deleted the node-4853-aws-s3-node-add-option-to-return-common-prefixes branch April 23, 2026 09:27
@n8n-assistant n8n-assistant Bot mentioned this pull request Apr 28, 2026
@n8n-assistant
Copy link
Copy Markdown
Contributor

n8n-assistant Bot commented Apr 28, 2026

Got released with n8n@2.19.0

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

Labels

n8n team Authored by the n8n team node/improvement New feature or request Released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants