unlob Docs
Browse documentation

n8n

An HTTP Request Tool on an AI Agent node — no code, and schedulable.

n8n is the right answer when the agent needs to sit between other systems more than it needs to be clever: search on a schedule, filter, and put the result in Slack or a sheet. The person who owns that workflow can then change it without a deploy.

It is the wrong answer once the branching gets complicated. A canvas becomes unreadable well before code does; if you find yourself building the same subgraph three times, write it in code.

Nothing to install — this works on n8n Cloud or your own instance.

Store the key as a credential

Create a Header Auth credential with the name x-api-key and your key as the value.

Do not paste the key into a node parameter. Credentials are encrypted and are excluded from workflow exports; a key typed into a node travels with the JSON when you share the workflow.

Add an HTTP Request Tool

Add an AI Agent node, then attach an HTTP Request Tool to it.

{
  "toolDescription": "Search the web on unlob's own index. Returns passages — the snippet IS the text, so you rarely need to fetch a page afterwards. Each hit carries independent_sources: how many distinct sites assert it.",
  "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": "collapse", "value": "story" },
      { "name": "limit", "value": "8" }
    ]
  }
}

Two of those parameters are pinned rather than exposed to the model, deliberately. min_independent_sources pinned at 3 is a corroboration floor the model cannot lower; left to $fromAI it becomes a suggestion. collapse=story folds near-duplicates, so a news query does not return the same wire copy five times.

Schedule it

Put a Schedule Trigger in front and a Slack node behind, and you have a monitoring workflow that runs itself:

Schedule (every 6h) → AI Agent → Slack
                        ├── Anthropic Chat Model (claude-opus-5)
                        └── HTTP Request Tool (unlob search)

This is the shape n8n is genuinely best at, and it is worth asking whether you need the agent at all. If the job is “run this query every hour and post anything new”, a Schedule Trigger, a plain HTTP Request node and a filter do it deterministically and for no model cost. Add the agent only when something needs judgement.

Worth knowing

  • $fromAI() is what lets the model fill a parameter. A hard-coded q gives you a tool that runs the same search every time and an agent that appears to ignore the question.
  • The tool description is the only thing the model sees. “Search the web” gets a tool called for everything. Describing what it returns and when to use it is what makes the agent selective.
  • Check for partial. When a search response has partial: true, part of the corpus was unreachable and the answer is incomplete rather than short. An IF node on {{ $json.partial }} is enough to catch it.
  • A 429 with no retry-after header means the monthly quota is hard-capped. n8n’s retry-on-fail will loop against something that cannot succeed this period — see Rate limits and quotas.

MCP, or REST?

REST, here. The HTTP Request Tool calls the API directly, which is fewer moving parts in a hosted instance and needs no bridge process. MCP is the better fit for desktop agent clients — see Connect a client.

Next