How to test n8n agents with OpenTelemetry and agentest
agentest (agentest-ai) — deterministic OpenTelemetry evals for AI agents. It scores recorded traces, not your n8n workflow source. There is a built-in n8n import dialect for exported execution data, and recorded n8n runs ship in this repository. Read the limitation below before you rely on per-episode tool-call checks.
pip install agentest-ai
Try it on a recorded n8n run
agentest std run --agent a01 --ids T1-001 --format md
| ID | status | detail |
|---|---|---|
| T1-001 | pass | canon: postconditions hold |
Output from agentest 3.5.0. This is a single recorded run, not a failure rate, and not a verdict on n8n. Other recorded n8n runs in agents/ include a08 and a23.
Judge your own n8n executions
A. Emit OpenTelemetry GenAI spans (preferred when you need per-step tool evidence). n8n has no built-in GenAI trace export. You can emit spans from a Code node to a Collector or to agentest std serve, then run agentest std run --otlp traces.otlp.jsonl.
B. Import an n8n execution export with dialect n8n. Limitation: per-episode tool calls are not recoverable from the export the importer reads. Tool definitions and results are recorded at run level, and are identical across episodes. Run-level calls actually made go to final_state["run_tool_calls"]. Checks that need per-episode arguments or order will return n/a unless you also emit OpenTelemetry execute_tool spans. The importer is covered by tests/test_import_n8n.py.
The full guide is docs/integrations/n8n.md.
Other frameworks
LangGraph · CrewAI · OpenAI Agents SDK · AutoGen · smolagents · MCP