PatternsAgent Patterns

Evaluator Workflow Pattern

Loading pattern preview

Loading preview…

Problems solved

Technical challenges this implementation handles out of the box.
  • Run an evaluator-optimizer loop inside Workflow DevKit
  • Score outputs with structured evaluation schemas
  • Iterate translation or content quality until thresholds pass
  • Persist workflow progress with Workflow DevKit durable steps

Use cases

Products and workflows this pattern is designed to support.
  • Translation quality loops
  • Iterative content improvement workflows
  • Workflow DevKit evaluator-optimizer demos
  • Multi-step AI QA processes

Setup

Requirements, wiring steps, and what this pattern adds to your project.

Getting started

Pick how you want to pull this pattern in — then wire env vars and routes the same way.

  1. 1

    Install from the preview toolbar

    Shadcn Icon

    Copy the install command above and run it in your project — Pro patterns include a short-lived token.

  2. 2

    Add environment variables to .env.local

    OPENAI_API_KEY

  3. 3

    Run your dev server and open the pattern route

    Install dependencies if needed, then start the app and verify responses.

Environment variables

Capabilities

AI SDK APIs

generateObjectgenerateText

Providers

OpenAI

Files added

3 files
  • app/page.tsx
  • app/layout.tsx
  • workflows/evaluator-workflow.ts

Dependencies

8 total

npm packages

6
AISDKNext.jsReactsonnerworkflowZod

Shadcn IconRegistry components

2
buttonselect

Requirements

Complexity
Advanced
Setup time
~15 minutes
Node
24+
Memory
512MB
Workflow DevKit setup