Skip to main content
Version: V11

Search Web tool 🌐

Use the Search Web tool to enable AI-powered workflows to search the internet for current information using Google Search. When you connect this tool to an AI node, the AI model can dynamically query the web for recent updates, news, and data beyond its knowledge cutoff.

In this article, you learn how to add, configure, and test the Search Web tool in your workflow.

Overview

The Search Web tool is a tool node that provides AI models with access to current information from the internet through Google Search. Unlike regular workflow nodes that execute in sequence, this tool is invoked by an AI node only when the model determines that web search is needed.

Key capabilities:

  • Current information access - Retrieve up-to-date information beyond the AI model's knowledge cutoff
  • Google Search integration - Leverage Google's search capabilities for comprehensive results
  • Domain restriction - Limit searches to specific trusted domains
  • Configurable results - Control the number of search results returned
  • URL extraction - Get URLs for potential content extraction and deeper research

Understand how the tool works

This section explains how the Search Web tool operates within a workflow and how it connects to other nodes.

Tool connectors

In the Workflow Designer, nodes use colored connectors to indicate the type of connection and data flow. The Search Web tool uses the green connector, which is specific to tool nodes.

  • Green connector - Connects tool nodes to AI nodes for AI-driven invocation

Green connector behavior

The green connector distinguishes tool nodes from regular workflow nodes:

  • AI-driven invocation - Tools connected through green connectors don't execute automatically in sequence. The AI node decides when to invoke them based on user input and context.
  • On-demand execution - The Search Web tool executes only when the AI model determines that web search is required.
  • Multiple tools support - An AI node can have multiple tools connected through green connectors. The AI model selects which tool to use based on the task.

Execution flow

When a workflow runs, the Search Web tool operates in this sequence:

  1. The AI node receives user input from the chatbot.
  2. The AI model analyzes the input and determines whether web search is needed.
  3. If web search is needed, the AI invokes the Search Web tool through the green connector.
  4. The tool sends a search request to Google Custom Search API using the configured credentials.
  5. Google returns search results including titles, snippets, and URLs.
  6. Search results are stored in the field specified in Output Field as a WebSearchResponse object.
  7. The AI node accesses the results and generates a response for the user.
┌─────────────┐      ┌─────────────┐      ┌──────────────────┐      ┌──────────────┐
│ User Query │ ───► │ AI Node │ ───► │ Search Web │ ───► │ Google API │
└─────────────┘ └─────────────┘ │ (Green Connector)│ └──────────────┘
▲ └──────────────────┘ │
│ │
└────────── state.data.web_results ◄────────────┘

When to use this tool

Use the Search Web tool when your workflow requires:

  • Time-sensitive information such as news, prices, exchange rates, weather, or events
  • Topics that change frequently and need verification
  • External research and public information
  • Any query explicitly requesting current or latest data
  • Information beyond the AI model's knowledge cutoff date

Add the Search Web tool to your workflow

Follow these steps to add the Search Web tool to your workflow canvas.

  1. Go to Portal Settings > Chatbot > Workflow.

  2. Select an existing workflow or create a new workflow.

  3. In the Node Library, expand the Tools category.

  4. Drag Search Web Tool onto the canvas.

Connect the tool to an AI node

After you add the Search Web tool to the canvas, connect it to an AI node.

  1. Locate your AI node (such as an LLM node) on the canvas.

  2. Drag a connection line from the green connector to the input connector on the Search Web tool node.

  3. Release to create the connection. A green connector () indicates a successful tool connection.

Connecting Search Web to an LLM node using the green connector

NOTE: The green connector indicates that the tool is available to the AI node for on-demand invocation. The tool doesn't execute in sequence with other nodes, it executes only when the AI model decides to invoke it.

Configure the Search Web tool

Select the Search Web node to open the Node Configuration Panel. You can configure the following options:

Description

Instructions for the LLM on how and when to use this tool. The default description provides comprehensive guidance including:

  • Guidelines for when to use web search (time-sensitive information, recent updates, current events)
  • Types of queries appropriate for web search versus internal knowledge
  • Instructions for query formatting and best practices
  • Expected output format and how to interpret results

The AI uses this description to determine when web search is needed. For example, when a user asks "What is the current price of Bitcoin?" the AI reads the description to understand this requires real-time data and invokes the Search Web tool rather than relying on its knowledge cutoff.

TIP: Keep the default description unless you need to customize the AI's search behavior for specific use cases.

Search parameters

You can configure the following search options:

  • Search Query: The search terms sent to Google Custom Search. The AI typically constructs this from user queries that require current information. Keep queries concise (1-6 words) for best results. Enter a static query like AI regulation news 2024 or use ${state.data.system.user_query} to dynamically use the user's input. For complex queries, the AI may reformulate the user's question into effective search terms.

  • Number of Results: Controls how many search results to return from Google. Valid range is 1-100, with a default of 10. Use lower values (1-5) for quick lookups and simple queries. Use higher values (20-50) for comprehensive research where multiple sources are needed. Note that higher values may increase response time. Enter a fixed number or use an expression like ${state.data.result_count} for dynamic control.

Google API credentials

  • Google API Key: Your Google API key for Custom Search API access. This key authenticates requests to Google's search service. The API key format typically starts with AIza.... Obtain your API key from the Google Cloud Console by enabling the Custom Search API. Enter the key directly as a fixed value, or reference a secure variable like ${secrets.google_api_key} to avoid exposing credentials in the workflow definition.

  • Google CSE ID: Your Google Custom Search Engine ID that identifies which search engine configuration to use. Create a Custom Search Engine at Programmable Search Engine to obtain this ID. The CSE configuration determines default search behavior, allowed sites, and other search settings. Enter the ID directly or reference a variable like ${config.google_cse_id}.

NOTE: Store API keys securely. Consider using workflow variables or environment configuration to avoid exposing credentials in the workflow definition.

Domain restrictions

  • Restrict to Sites: Limits search results to specific trusted domains. Use this to ensure results come from authoritative or approved sources. Click Add sites to add domain restrictions. Enter domain names without the protocol (for example, example.com not https://example.com). You can add multiple domains to search across several trusted sources. Leave empty to search the entire web without restrictions.

Common domain restriction patterns:

  • gov - Restrict to government websites for official information
  • edu - Restrict to educational institutions for academic content

Output settings

  • Output Field: Variable name where search results are stored for use by other nodes. Click to select an existing variable or create a new one. The tool stores a WebSearchResponse object containing an array of results, where each result includes title, snippet, URL, and display URL. The AI node and subsequent workflow nodes access results using ${state.data.<variable_name>}. For example, if you name it web_results, access it as ${state.data.web_results}.

Test the configuration

After you configure the Search Web tool, test the workflow to verify correct behavior.

  1. Go to Portal Settings > Chatbot > Agents.

  2. Select the agent associated with your workflow, or create a new agent and assign your workflow.

  3. Open the chatbot interface in the portal.

  4. Enter a query that should trigger web search. For example:

    • "What are the latest news about climate change?"
    • "What is the current weather in New York?"
    • "Find recent articles about machine learning trends"
  5. Verify that the agent returns relevant and current information from the web.

  6. Check that results include source URLs for reference.

  7. If results don't match expectations, return to the Workflow Designer and adjust your configuration.

Supported values reference

Search query best practices

Follow these guidelines for effective search queries:

  • Keep queries concise - Use 1-6 words for best results
  • Use specific terms - Include relevant keywords and context
  • Avoid special characters - Use plain text queries
  • Include time context - Add year or "latest" for current information

Number of results guidelines

  • 1-5 results - Quick lookups and simple queries
  • 10 results - Standard searches (default)
  • 20-50 results - Comprehensive research
  • 50-100 results - Exhaustive research (longer response time)

WebSearchResponse structure

The output contains a WebSearchResponse object with the following information for each result:

  • Title - The title of the search result
  • Snippet - A brief description or excerpt from the page
  • URL - The web address for the result
  • Display URL - The formatted URL shown in search results