Web Search

Search the web and return top results with titles, URLs, and snippets — essential for giving AI agents real-time access to information beyond their training data.

When to Use

Use Web Search when you need to:

  • Look up current events, documentation, or product information in a workflow
  • Give an AI Agent live web access via the Tools handle
  • Verify facts or gather context before responding to a user
  • Enrich workflow data with external search results

Supports two providers:

  • Tavily (recommended) — purpose-built for AI agents with optional advanced search depth
  • SerpAPI — Google search results via SerpAPI

Inputs

HandleTypeDescription
inputanyUpstream data for {{ input.field }} template references in settings fields.

Output

HandleTypeDescription
resultobjectSearch result envelope

The result (accessed as {{ web_search.* }}) shape:

FieldTypeDescription
successbooleanWhether the search succeeded
resultsarraySearch results, each with title, url, and snippet
querystringThe query that was searched
errorstringError message if success is false
{
  "success": true,
  "query": "Tensorify workflow automation",
  "results": [
    {
      "title": "Tensorify — Visual Backend Builder",
      "url": "https://tensorify.io",
      "snippet": "Build REST APIs and automations visually..."
    }
  ],
  "error": null
}

Access results downstream:

{{ web_search.results[0].title }}
{{ web_search.results[0].url }}
{{ web_search.results[0].snippet }}

Settings

Provider

SettingTypeDefaultDescription
providerenumtavilySearch provider: tavily (recommended) or serpapi. Excluded from the agent tool schema — configure once on the node.
SettingTypeDefaultDescription
querystringSearch query. Supports {{ }} bindings. Required.

Options

SettingTypeDefaultDescription
max_resultsnumber5Maximum number of results to return. Supports {{ }} bindings.
search_depthenumbasicTavily search depth: basic (fast) or advanced (more comprehensive). showWhen: provider = tavily. Ignored for SerpAPI.

Required Secrets

Sign up for a search provider and add your API key on the Env Vars page:

VariableDescription
SEARCH_API_KEYTavily API key (tvly-...) or SerpAPI key. Set Provider on the node to match your key.

Example

Canvas

Agent workflow with live web access:

  1. Add a Web Search node.
  2. Set Provider to tavily.
  3. Set Query to {{ input.question }}.
  4. Set Max Results to 5.
  5. Set Search Depth to advanced.
  6. Connect the node to an AI Agent Tools handle.

The agent supplies query and optionally max_results as tool arguments. The provider is configured on the node and is not exposed to the agent.

Standalone search in a workflow:

Manual Trigger → Web Search → Transform
  • Provider: tavily
  • Query: latest Tensorify release notes
  • Max Results: 3

Access the top result:

{{ web_search.results[0].url }}

TSL

import manual from @tensorify/manual-trigger:1.0.0
import search from @tensorify/web-search:1.0.0

node trigger @tensorify/manual-trigger:1.0.0 {}

node lookup @tensorify/web-search:1.0.0 {
    provider = "tavily"
    query = "Tensorify workflow automation"
    max_results = 5
    search_depth = "basic"
}

trigger.payload -> lookup.input

Error Handling

Web Search has an On Error control output branch. Enable it via the "Error output handle" toggle at the bottom of the settings panel.

The error branch fires when:

  • SEARCH_API_KEY is missing or invalid
  • The search provider returns an API error (rate limit, invalid query, etc.)
  • A network error occurs during the search request

Connect the error branch to a fallback response or logging action. You can also check {{ web_search.success }} and {{ web_search.error }} on the main output path.

Common Gotchas

  • Provider must match your API key: A Tavily key will not work with SerpAPI and vice versa. Set Provider to match the key you configured.
  • Provider is node-level, not agent-level: When connected to an AI Agent, the agent cannot change the provider — configure it on the node before connecting.
  • Search depth is Tavily-only: search_depth is ignored when Provider is set to serpapi.
  • Missing SEARCH_API_KEY: The node fails at runtime if the env var is not set.
  • Rate limits: Both Tavily and SerpAPI enforce API rate limits. Handle errors gracefully in production workflows.

See Also

On this page