Skip to content

Battle / Arena Nodes

Battle nodes automate the full LenserFight battle lifecycle — from creating a battle definition through executing contenders, collecting votes, aggregating scores, and updating leaderboards.

NodeTypeOutput
Battle Createbattle_createjson
Battle Executebattle_executebattle_result
Contender Runcontender_runlens_result
Judge Battlejudge_battlebattle_result
Vote Collectorvote_collectorjson
Score Aggregatorscore_aggregatorbattle_result
Leaderboard Updateleaderboard_updatejson

Battle Create

Type: battle_create · Category: Battle / Arena

Create a battle definition from a prompt and contender list. Returns a battleId and draft status.

Inputs

NameTypeRequired
jsonjsonYes

Required Config

FieldTypeDescription
battleIdstringBattle identifier or mapping.

Optional Config

FieldTypeDefault
visibilityselectworkspace

Example

json
{ "title": "RAG answer showdown", "visibility": "workspace" }

Expected output: { "battleId": "battle_123", "status": "draft" }

Downstream:battle_execute

Battle Execute · Form / Input Trigger


Battle Execute

Type: battle_execute · Category: Battle / Arena

Execute contenders and apply a judge strategy for a battle. The central orchestration node for automated AI battles.

Inputs

NameTypeRequired
prompttextYes — battle prompt
contendersarrayYes — contender definitions

Outputs

NameTypeShape
battleResultbattle_result{ battleId: text, winner: text, scores: json }

Required Config

FieldTypeDescription
contendersjsonContender configs: [{ id, lensId }] or [{ id, agentId }].
judgeStrategyselectsingle_judge · panel · vote

Optional Config

FieldTypeDefaultOptions
promptSourcestringPath to the battle prompt.
fundingSourceselectplatform_creditplatform_credit · user_byok_cloud · user_byok_local
resultVisibilityselectworkspaceprivate · workspace · public

Example

json
{
  "contenders": [
    { "id": "concise", "lensId": "lens_concise_answer" },
    { "id": "sourced", "lensId": "lens_sourced_answer" }
  ],
  "promptSource": "$.prompt",
  "judgeStrategy": "panel",
  "fundingSource": "platform_credit",
  "resultVisibility": "workspace",
  "retry": { "attempts": 2, "backoffMs": 2000 }
}

Scenario: Run two RAG-answer contenders and produce a judged winner.

Expected output: { "battleId": "battle_123", "winner": "sourced", "scores": { "sourced": 94, "concise": 78 } }

Downstream:leaderboard_update with { "battleId": "$.battleId", "winner": "$.winner" }

Valid Connections

leaderboard_update, score_aggregator, slack_notify, judge_battle

Battle Create · Judge Battle · Judge / Eval · Vote Collector


Contender Run

Type: contender_run · Category: Battle / Arena

Run one battle contender against a prompt. Use when you want fine-grained control over individual contender execution before aggregating.

Required Config

FieldTypeDescription
contenderIdstringContender identifier.

Example

json
{
  "contenderId": "sourced",
  "lensId": "lens_sourced_answer",
  "model_id": "openai:gpt-4.1-mini"
}

Expected output: { "contenderId": "sourced", "output": "Answer with citations..." }

Downstream:judge_battle


Judge Battle

Type: judge_battle · Category: Battle / Arena

Judge contender outputs and emit a battle result with winner and scores.

Required Config

FieldTypeDescription
rubricstringEvaluation rubric.

Example

json
{
  "rubric": "Prefer correctness and source coverage.",
  "judgeModel": "anthropic:claude-3-7-sonnet"
}

Expected output: { "winner": "sourced", "scores": { "sourced": 94, "concise": 78 } }

Downstream:score_aggregator

Battle Execute · Vote Collector · Judge / Eval


Vote Collector

Type: vote_collector · Category: Battle / Arena

Collect human or automated votes for a battle and emit aggregated vote data.

Required Config

FieldTypeDescription
battleIdstringBattle id or mapping (e.g. $.battleId).

Optional Config

FieldTypeDescription
closeAfterVotesnumberAutomatically close voting after N votes.

Example

json
{ "battleId": "$.battleId", "closeAfterVotes": 7 }

Expected output: { "votes": [{ "voter": "u1", "contenderId": "sourced" }] }

Downstream:score_aggregator


Score Aggregator

Type: score_aggregator · Category: Battle / Arena

Aggregate judge scores and votes into final rankings using a weighted strategy.

Required Config

FieldTypeDescription
aggregationstringAggregation strategy (e.g. weighted_average).

Example

json
{
  "aggregation": "weighted_average",
  "weights": { "judge": 0.8, "vote": 0.2 }
}

Expected output: { "winner": "sourced", "finalScore": 91.6 }

Downstream:leaderboard_update

Judge Battle · Vote Collector · Leaderboard Update


Leaderboard Update

Type: leaderboard_update · Category: Battle / Arena

Write battle results to a leaderboard. The terminal node of most battle automation pipelines.

Inputs

NameTypeRequired
battleResultbattle_resultYes

Required Config

FieldTypeDescription
leaderboardIdstringLeaderboard identifier.

Optional Config

FieldTypeDefaultOptions
scorePathstring$.finalScore
visibilityselectworkspaceprivate · workspace · public

Example

json
{
  "leaderboardId": "arena_weekly",
  "scorePath": "$.finalScore",
  "visibility": "workspace"
}

Expected output: { "updated": true, "rank": 1 }

Downstream:slack_notify

Valid Connections

slack_notify, discord_notify, email_send, logger

Invalid Connections

✗ Cannot receive text or json — requires a battle_result typed input from battle_execute, judge_battle, or score_aggregator.

Score Aggregator · Battle Execute · Slack Notify


See also: Node Catalog Index · AI Primitive Nodes · Workflow Studio · Battle concepts