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 withname,keywords(array), andmatch_modematch_mode- Default match mode for topics:any(OR),all(AND), orexact(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
anymode for broad topics (matches if any keyword found),allfor strict topics (all keywords required) exactmode 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_topicsarray includes all matches - Order topics from most specific to least specific if you want priority matching
- Disable
case_sensitivefor general news; enable it for code-related topics or proper nouns - Empty
matched_topicsmeans no topics matched—use a Branch node to filter these out
Inputs
inputRequiredconfigOptionalitemsRequired
Outputs
items
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
topics | array<record> | No | Topics to filter for |
base_config | record | No | Shared 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). |