Skip to content

Conversation

@akramcodez
Copy link

Summary

Fixes workflow tag filtering so that workflows inside folders are included, not just workflows at the project root level.

Closes: #23948

Problem

When filtering workflows by tag on the Project Workflows page, only workflows at the root level were shown.
Workflows inside folders were incorrectly excluded from the results.

Steps to reproduce

  1. Go to the project workflows page
  2. Create a folder and add a workflow inside it with a tag (e.g. test)
  3. Create another workflow at the root level with the same tag
  4. Filter workflows by the test tag

Only the workflow at the root level appears
Expected: both workflows should appear

Root Cause

Two issues were identified in workflow.repository.ts:

  1. Folder hierarchy expansion was limited to text search

    • Subfolder expansion only occurred when a query filter was present
    • Tag-based filtering did not trigger hierarchy expansion
  2. PROJECT_ROOT always restricted results to root-level workflows

    • The parentFolderId IS NULL condition was always applied at the project root
    • This excluded workflows inside folders even when filtering by tags or search query

Solution

Change 1: Extend folder hierarchy expansion to include tag filtering

- options.filter.query
+ (options.filter.query ||
+   (Array.isArray(options.filter.tags) && options.filter.tags.length > 0))

Change 2: Skip root-level folder restriction when tag or query filter is active

+ const hasSearchFilter =
+   filter?.query ||
+   (Array.isArray(filter?.tags) && filter.tags.length > 0);
+
  if (filter?.parentFolderId === PROJECT_ROOT) {
-   qb.andWhere('workflow.parentFolderId IS NULL');
+   if (!hasSearchFilter) {
+     qb.andWhere('workflow.parentFolderId IS NULL');
+   }
  }

How to Verify

  1. Go to the project workflows page
  2. Create a folder with a workflow tagged test
  3. Create another workflow at the root level with the same tag
  4. Filter by tag test

Both workflows (inside and outside folders) should appear

Copy link
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 1 file

@n8n-assistant n8n-assistant bot added community Authored by a community member in linear Issue or PR has been created in Linear for internal review labels Jan 7, 2026
@n8n-assistant
Copy link
Contributor

n8n-assistant bot commented Jan 7, 2026

Hey @akramcodez,

Thank you for your contribution. We appreciate the time and effort you’ve taken to submit this pull request.

Before we can proceed, please ensure the following:
• Tests are included for any new functionality, logic changes or bug fixes.
• The PR aligns with our contribution guidelines.

Regarding new nodes:
We no longer accept new nodes directly into the core codebase. Instead, we encourage contributors to follow our Community Node Submission Guide to publish nodes independently.

If your node integrates with an AI service that you own or represent, please email [email protected] and we will be happy to discuss the best approach.

About review timelines:
This PR has been added to our internal tracker as "GHC-6205". While we plan to review it, we are currently unable to provide an exact timeframe. Our goal is to begin reviews within a month, but this may change depending on team priorities. We will reach out when the review begins.

Thank you again for contributing to n8n.

@akramcodez
Copy link
Author

akramcodez commented Jan 7, 2026

PTAL @MookieLian thanks

@CLAassistant
Copy link

CLAassistant commented Jan 7, 2026

CLA assistant check
All committers have signed the CLA.

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

Labels

community Authored by a community member in linear Issue or PR has been created in Linear for internal review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants