Public API - Tags should be OR not AND

The idea is:

The n8n public API should use tags as an OR instead of an AND so setting ?tags=tag1,tag2 would return workflows that contain either tag1 or tag2 not worklfows that contain both tag1 and tag2

My use case:

I would like to filter workflows based on groups of tags using the API

Any resources to support this?

Closed GitHub issue around some of this: Workflows Public API Tags Parameter Does Not Support Multiple, Comma Separated, Tags · Issue #10348 · n8n-io/n8n · GitHub

Hi @Jon

What a good idea, would be nice to have both options though.

Please don’t forget to vote yourself :wink:

@BramKn Both is probably the best option, I think I popped that on the GH issue :wink:

2 Likes

Based on this post?

Expanding on the notion of doing “both”, it would also be useful to consider argument parsing support for:

  • sub-grouping - so logical AND/OR/NOT combinations wouldn’t be limited to just first-to-last precedence
  • quoted values - so that special characters like commas or logical operator terms could be distinguished from characters/keywords that happen to be embedded in the actual tag-value text.

Examples: (not URL encoded for easier reading)

  • tags= ((‘project1’ OR ‘project2’) AND ‘Q2-release’)
  • tags=‘Question AND Answer Automation’ OR ‘Errors,Omissions’

Maybe part of what I’m expressing here is that opening this can-of-worms probably asks for a common mini-DSL logical-expression-parser library to deal with the same issue on more than just the workflow tags argument. I could imagine the same library sitting underneath a “Complex Filter” node in n8n (similar to the flat/linear “Filter” node that currently exists, but with logical sub-groups).

Yes… it’s related to this. Wishing for a more straightforward way to reach the same end.