Skip to content
unlob

n8n · No code

Build a research agent with n8n

Build a research workflow in n8n by wiring the unlob HTTP endpoint into an AI Agent node — no code, and schedulable.

What you are building

Trigger

Schedule

Every 6 hours

The agent

AI Agent node

Runs the tool loop

Anthropic Chat Model

claude-opus-5

HTTP Request Tool

unlob search

Output

Slack

Or email, sheet, database

Your side of the API. unlob is one HTTPS service among the others — nothing here is specific to how our index works, so this agent survives a change of framework.

Install

Dependenciesbash
Runs on n8n Cloud, or on your own Docker instance. No packages to install.

Already have n8n wired up? Then8n integration pagehas the connection config on its own — this page assumes you have it and gets on with building.

Step by step

  1. Store the key as a credential

    Create a Header Auth credential with name `x-api-key` and your key as the value. Never paste the key into a node parameter — credentials are encrypted and are not included when you export a workflow.

  2. Add an HTTP Request tool

    Add an AI Agent node, then attach an HTTP Request Tool to it. The description you write is what the model reads when deciding whether to call it, so it matters more than it looks.

    HTTP Request Tool nodejson
    {
      "name": "unlob_search",
      "description": "Search the web on unlob's own index. Returns metadata only — url, title, snippet and independent_sources. Never returns page bodies. Set min_independent_sources to 3 for factual claims.",
      "method": "GET",
      "url": "https://api.unlob.com/search",
      "authentication": "genericCredentialType",
      "genericAuthType": "httpHeaderAuth",
      "sendQuery": true,
      "queryParameters": {
        "parameters": [
          { "name": "q", "value": "={{ $fromAI('query', 'What to search for', 'string') }}" },
          { "name": "min_independent_sources", "value": "={{ $fromAI('min_sources', 'Independent sources required', 'number', 2) }}" },
          { "name": "limit", "value": "8" }
        ]
      }
    }
  3. Schedule it

    Put a Schedule Trigger in front and a Slack or email node behind, and you have a monitoring workflow that runs itself. This is the shape n8n is genuinely best at.

What happens when it runs

ScheduleAI AgentClaudeunlobtriggerprompt + tool schemastool callGET /searchhitstool resultanswer
One turn of the loop. Search returns metadata only, so the agent spends a few hundred tokens deciding rather than tens of thousands reading.

The whole thing

Complete and runnable. Set the two environment variables and it works.

workflow.json — importablejson
{
  "name": "unlob research agent",
  "nodes": [
    {
      "parameters": { "rule": { "interval": [{ "field": "hours", "hoursInterval": 6 }] } },
      "name": "Every 6 hours",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [200, 300]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "Research what changed in EU AI Act GPAI rules this week. Prefer claims carried by several independent sources, and say so when a claim rests on one. Cite URLs.",
        "options": { "systemMessage": "You are a research assistant. Search before you answer." }
      },
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [460, 300]
    },
    {
      "parameters": { "model": "claude-opus-5" },
      "name": "Anthropic Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [400, 500]
    },
    {
      "parameters": {
        "toolDescription": "Search the web on unlob's own index. Returns metadata only — url, title, snippet and independent_sources. Never returns page bodies.",
        "url": "https://api.unlob.com/search",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            { "name": "q", "value": "={{ $fromAI('query', 'What to search for', 'string') }}" },
            { "name": "min_independent_sources", "value": "3" },
            { "name": "limit", "value": "8" }
          ]
        }
      },
      "name": "unlob search",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [600, 500]
    },
    {
      "parameters": { "select": "channel", "text": "={{ $json.output }}" },
      "name": "Post to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [760, 300]
    }
  ],
  "connections": {
    "Every 6 hours": { "main": [[{ "node": "AI Agent", "type": "main", "index": 0 }]] },
    "Anthropic Chat Model": { "ai_languageModel": [[{ "node": "AI Agent", "type": "ai_languageModel", "index": 0 }]] },
    "unlob search": { "ai_tool": [[{ "node": "AI Agent", "type": "ai_tool", "index": 0 }]] },
    "AI Agent": { "main": [[{ "node": "Post to Slack", "type": "main", "index": 0 }]] }
  }
}

What will go wrong

The failures that cost an afternoon rather than a minute, because they produce something that looks like it is working.

Where this agent can go next

Every result the agent receives is a node in the coverage graph. These are the tools you can add to it without leaving n8n — each is one more entry in the same tools list.

relatedNear-duplicatescorroborateIndependent sourcesauthoritiesAuthoritative hostsdossierThe entity briefpathA second documentassemble_contextA packed context setA search resultwhat your agent has
The two marked in blue are the tools this tutorial wires up. The other four are the same shape.

Frequently asked questions

Do I need the MCP server for n8n?

No. The HTTP Request Tool node calls the REST API directly, which is fewer moving parts in a hosted n8n instance. MCP is the better fit for desktop agent clients.

Can I run this on a schedule without an AI model at all?

Yes, and often you should. If the job is "search this query every hour and post new results", a Schedule Trigger, an HTTP Request node and a filter do it deterministically and for no model cost. Add the agent only when something genuinely needs judgement.

You need a key to run this

10,000 requests a month on the free tier, no card. Enough to build the agent and put a real evaluation set through it.