Overview
The node performs a search query using the Tavily service. It allows users to send a custom search query and retrieve relevant results based on various configurable options such as topic, search depth, time range, and filtering by domains. This node is useful for scenarios where you want to programmatically gather information from the web or specific sources, filter results by relevance or recency, and optionally include detailed content like images or raw data.
Practical examples:
- Searching recent news articles about technology within the past week.
- Retrieving concise answers to questions with direct responses included.
- Filtering search results to only include trusted domains like "wikipedia.org" or exclude spammy sites.
Properties
| Name | Meaning |
|---|---|
| Query | The search query string to send to Tavily. Example: "N8N community nodes". |
| Options | A collection of optional parameters to customize the search behavior: |
| - Topic | The category/topic of the search, e.g., "general", "sports", "technology". |
| - Search Depth | How thorough the search should be: "Basic" (faster, less thorough), "Advanced", or "Comprehensive". |
| - Maximum Results | Maximum number of search results to return, between 1 and 100. For example, 1 for a single result or 10 for multiple results. |
| - Time Range | Limits results to a certain timeframe: "Any Time", "Past 24 Hours", "Past Week", or "Past Month". |
| - Days | Number of days to look back in history, from 1 up to 365. |
| - Include Answer | Boolean flag to include a direct answer in the response. Set true to get a concise answer. |
| - Include Raw Content | Boolean flag to include unformatted/raw content in the response. Useful if you want full original text. |
| - Include Images | Boolean flag to include related images in the response. |
| - Include Image Descriptions | Boolean flag to include descriptions for any included images. |
| - Include Domains | List of domains to specifically include in the search results. Example: ["wikipedia.org", "news.com"]. |
| - Exclude Domains | List of domains to exclude from the search results. Example: ["ads.com", "spam.net"]. |
Output
The node outputs JSON data containing the search results returned by Tavily. The structure typically includes:
- The main search results matching the query.
- Optional direct answers if requested.
- Raw content of the results if enabled.
- Related images and their descriptions if those options are selected.
If images are included, binary data may also be part of the output representing those images.
Dependencies
- Requires access to the Tavily search service API.
- Needs an API key or authentication token configured in n8n credentials to authorize requests to Tavily.
- No other external dependencies are indicated in the provided source code.
Troubleshooting
Common issues:
- Missing or invalid API credentials will cause authentication errors.
- Exceeding maximum allowed results or invalid option values may lead to request failures.
- Network connectivity problems can prevent successful queries.
Error messages:
- Authentication errors: Check that the API key or token is correctly set up in n8n.
- Validation errors: Ensure all required properties like "Query" are provided and options are within valid ranges.
- Timeout or network errors: Verify internet connection and Tavily service status.
Links and References
- Tavily official website (for more details on the search service)
- n8n documentation on creating and configuring API credentials