Contents

Topic Filter

topic_filter · Nodes · Transform

Filters input items by topic relevance.

Filters items by topic keywords. Assigns topics to items based on keyword matching rules. Adds a matched_topics field to each item indicating which topics were detected.

Config:

  • topics - Array of topic objects, each with name, keywords (array), and match_mode
  • match_mode - Default match mode for topics: any (OR), all (AND), or exact (phrase)
  • case_sensitive - Boolean for case-sensitive matching (default: false)

Input: Array of items, each with title and content fields to match against

Output: Array of items with added matched_topics field containing matched topic names

Example:

[RSS Ingest] → [Topic Filter]
    { "items": [
        { "title": "Bitcoin hits new high", "content": "Crypto markets rally..." },
        { "title": "Fed raises interest rates", "content": "Banking sector reacts..." }
    ]}
    → { "items": [
        { "title": "Bitcoin hits new high", "content": "...", "matched_topics": ["Crypto"] },
        { "title": "Fed raises interest rates", "content": "...", "matched_topics": ["Finance"] }
    ]}

Tips:

  • Use any mode for broad topics (matches if any keyword found), all for strict topics (all keywords required)
  • exact mode matches the exact phrase—useful for multi-word terms like "machine learning"
  • Keep keywords specific to reduce false positives; "AI" matches "pain", "wait", etc. in case-insensitive mode
  • Items can match multiple topics—the matched_topics array includes all matches
  • Order topics from most specific to least specific if you want priority matching
  • Disable case_sensitive for general news; enable it for code-related topics or proper nouns
  • Empty matched_topics means no topics matched—use a Branch node to filter these out

Inputs

  • inputRequired
  • configOptional
  • itemsRequired

Outputs

  • items

Configuration

FieldTypeRequiredDescription
topicsarray<record>NoTopics to filter for
base_configrecordNoShared node configuration. failure_mode decides what a failure of this node does to the workflow; leave it at the default stop unless the workflow handles the failure itself on the node's error output (route_to_error) or the node is a rare emergency kill switch (stop_workflow).