GenAiHub

Last checked 23 October 2026 — responded normally.

Debug AI agent tool calls with OpenRouter, calculator and webhook

Quick overview

Live
Open / InstallLast updated October 23, 2026

Description

Quick overview This workflow gives a support agent a Calculator tool and a simulated order lookup tool, so you can compare a correct calculation, a found order and an empty lookup that still reports success. It is Exercise 4 from the n8n Production AI Playbook on Audit & Trace. How it works Receives a POST webhook request with a natural-language query. Support Agent, an AI Agent using an OpenRouter chat model, decides whether to call a tool. Calculator Tool handles arithmetic questions such as 47 times 89. Order Lookup Tool returns a simulated order record, or an empty string when the order does not exist. Respond returns the agent's answer to the webhook caller. Setup Add an OpenRouter API credential to OpenRouter - Agent. If you change models, choose one that supports tool calling. Optionally enable OpenTelemetry tracing in Settings > OpenTelemetry to see a span for each tool call. Select Execute workflow and POST {"query":"What is 47 times 89?"} to the Webhook Test URL. Repeat with {"query":"How much was order ORD-1001? Use the order lookup."} and {"query":"How much was order ORD-8888? Tell the customer the amount."}. Compare the tool results in the agent logs with each reply to find the empty lookup. Requirements n8n Cloud or a self-hosted n8n instance An OpenRouter API key for a model with tool-calling support Customization Have Order Lookup Tool return a clear message such as "No order found" instead of an empty string, so the agent can tell the customer the order is missing. Additional info Order data is synthetic. An n8n automation workflow template by Elvis Sarvia.

Community Metrics

Views
0
Avg Rating
N/A
Ratings
0
Likes
0
Comments
—

Author

Elvis Sarvia

Platform

web

Pricing model

free

Categories

  • Automation
  • AI

Tags

  • n8n
  • workflow
  • ai-agent
  • calculator
  • code-tool
  • openrouter-chat-model

Capabilities

  • 4 nodes

Information

TypeWorkflow
Sourcen8n
AddedOctober 14, 2026

Comments

?

Others in the same category, ranked by how often they are opened.