See llms.txt for all machine-readable content.

Back to Templates

Multi-AI agent router: compare OpenAI, Anthropic & Groq responses with webhooks

Introduction

This workflow connects to OpenAI, Anthropic, and Groq, processing requests in parallel with automatic performance metrics. Ideal for testing speed, cost, and response coverage across models.

How It Works

Webhooks trigger parameter extraction and routing. The same prompt is submitted to three providers. Responses merge with detailed metrics.

Workflow Template

Webhook → Extract Parameters → Router
├→ OpenAI Agent
├→ Anthropic Agent
├→ Groq Agent
→ Merge → Metrics → Respond

Workflow Steps

  1. Webhook receives POST with prompt and settings.
  2. Parameters extracted and validated.
  3. Router directs by cost, latency, or type.
  4. AI agents run in parallel.
  5. Results merged with metadata.
  6. Metrics compute time, cost, and response coverage.
  7. Response returns outputs and recommendation.

Setup Instructions

  1. Activate Webhook with authentication.
  2. Add API keys for all providers.
  3. Define models, tokens, and temperature.
  4. Adjust Router logic for selection.
  5. Tune Metrics scoring formulas.

Prerequisites

  • n8n v1.0+ instance
  • API keys: OpenAI, Anthropic, Groq
  • HTTP client for testing

Customization

Add providers like Gemini or Azure OpenAI.
Enable routing by cost or performance.

Benefits

Auto-select efficient providers and compare model performance in real time.

Connect the three provider credentials and header-authenticate the incoming webhook. Provide your actual per-million-token rates in OPENAI, ANTHROPIC and GROQ USD_PER_M_INPUT and USD_PER_M_OUTPUT variables to enable cost ranking. Section coverage and measured response time remain available when rates are unknown.