DEV Community

Srijith Kartha
Srijith Kartha

Posted on • Originally published at blog.rynko.dev

Launching Rynko Flow: A Self-Correcting Validation Gateway for AI Agent Outputs

When we launched Rynko, the focus was document generation — templates, PDFs, Excel files. But the more we worked with teams building AI-powered workflows, the more we noticed the same problem showing up everywhere: the agent produces structured data, and the developer writes validation code to check it before passing it downstream. Schema checks, business rule enforcement, sometimes a human review step. Every team was building some version of this from scratch.

So, we built Flow.

What Flow Does

Rynko Flow is a validation gateway that sits between your AI agent and your downstream systems. You define a gate with a schema and business rules, your agent submits payloads to it, and Flow validates the data before it moves forward. If the payload fails, the agent gets a clear error response it can act on. If it passes, Flow returns a tamper-proof validation_id that downstream systems can verify to confirm the data hasn't been modified in transit.

The pipeline looks like this:

Each stage is independent. Schema validation checks field types, required fields, and constraints like min/max values and allowed enums. Business rules evaluate cross-field expressions — things like endDate > startDate or quantity * price == total. If you need a human to review before delivery, add an approval step with internal team members or external reviewers. Once everything passes, Flow delivers the payload to your webhook endpoints.

Gates, Not Middleware

A gate is a named validation checkpoint. It has a schema (the structure you expect), business rules (the constraints that cross fields), and optionally an approval configuration and delivery channels. Each gate gets its own API endpoint.

Creating a gate takes about a minute in the dashboard:

  1. Open the Flow dashboard and click Create Gate

  2. Name your gate — give it something descriptive like "Order Validation". Flow generates a URL-friendly slug automatically (order-validation)

  3. Define the schema — use the schema builder to add fields. For an order gate, you'd add orderId (string, required), amount (number, required, min 0), currency (string, required, allowed values: USD/EUR/GBP), and customerEmail (string, required, email format). Each field has a type dropdown and constraint options — no JSON to write by hand

  4. Add business rules — click Add Rule and write expressions like amount >= 10 with an error message ("Order amount must be at least $10"). The rule editor validates your expression as you type, so you know it'll work before you save

  5. Save the gate — it's immediately active and ready to receive payloads

If you already have your data models defined in code, you don't have to recreate the schema manually. Flow supports importing schemas directly from Pydantic (Python) and Zod (TypeScript). In the schema builder, click Import Schema, pick the format, and paste the JSON Schema output from model_json_schema() (Pydantic) or zodToJsonSchema() (Zod). Flow maps the types, constraints, and required fields automatically. There's a full tutorial with code examples for both.

This means if you have a Pydantic model like:

class Order(BaseModel):
    order_id: str
    amount: float = Field(ge=0)
    currency: Literal["USD", "EUR", "GBP"]
    customer_email: EmailStr
Enter fullscreen mode Exit fullscreen mode

You run Order.model_json_schema(), paste the output into the import dialog, and your gate schema is ready — field types, constraints, and all.

{
    "title": "Order",
    "type": "object",
    "properties": {
      "order_id": {
        "title": "Order Id",
        "type": "string"
      },
      "amount": {
        "title": "Amount",
        "type": "number",
        "minimum": 0
      },
      "currency": {
        "title": "Currency",
        "type": "string",
        "enum": ["USD", "EUR", "GBP"]
      },
      "customer_email": {
        "title": "Customer Email",
        "type": "string",
        "format": "email"
      }
    },
    "required": ["order_id", "amount", "currency", "customer_email"]
  }
Enter fullscreen mode Exit fullscreen mode

When your agent submits a payload to this gate, the response tells you exactly what happened at each validation layer:

{
  "success": true,
  "runId": "550e8400-e29b-41d4-a716-446655440000",
  "status": "validated",
  "validation_id": "v_abc123...",
  "layers": {
    "schema": "pass",
    "business_rules": "pass"
  }
}
Enter fullscreen mode Exit fullscreen mode

If validation fails, the response includes specific error details — which field failed, which constraint was violated, which business rule returned false. The agent gets actionable feedback it can use to fix the data and resubmit.

Why This Matters for AI Agents

LLMs hallucinate. They produce plausible-looking data that might have an invalid enum value, a missing required field, or a number that violates a business constraint. When you're generating a single document, you catch these by eye. When an agent is processing hundreds of payloads autonomously, you need systematic validation.

The interesting thing we've seen in practice is that agents self-correct. When an MCP-connected agent submits a payload that fails validation, it reads the error response, fixes the issues, and resubmits — often without any human involvement. We ran tests where we intentionally gave agents incomplete or incorrect data, and the validation-resubmission loop resolved the issues in one or two attempts. (ref: Flow MCP — AI Agent Integration Test Report | Rynko Documentation)

Flow has a built-in circuit breaker for this pattern. If an agent (identified by its MCP session) keeps submitting payloads that fail the same gate, Flow backs off — first warning, then temporarily blocking submissions from that session. This prevents a malfunctioning agent from burning through your quota with an infinite retry loop. The circuit breaker tracks failures per gate per session, with configurable thresholds and cooldown periods.

Multi-Agent Workflows

The single-agent case is straightforward, but Flow was really designed for multi-agent architectures — the kind you build with LangGraph, CrewAI, AutoGen, or your own orchestration layer. In these setups, you have multiple specialized agents handling different parts of a pipeline: one agent researches, another drafts, a third formats, and a fourth submits to your system of record. Each agent is good at its job, but none of them knows what the others are doing, and any of them can produce data that doesn't meet your downstream requirements.

Gates are the shared contract between these agents and your systems. A "Customer Order" gate doesn't care whether the payload comes from a single monolithic agent or from the last step in a five-agent chain — it validates the same schema and business rules regardless. This means you can swap agents, change your orchestration graph, or add new agents to the pipeline without touching your validation logic. The gate is stable while the agents evolve around it.

In practice, this plays out in a few ways:

Pipeline validation. An orchestrator runs Agent A (data extraction) → Agent B (enrichment) → Agent C (formatting), and the final output goes through a Flow gate before hitting your database. If Agent C produces bad data, the orchestrator gets structured errors it can route back to the responsible agent for correction — not a generic 400 from your API.

Parallel agents, same gate. Multiple agents process different inputs concurrently — say, ten order-processing agents each handling a different customer. They all submit to the same "Order Validation" gate. Flow validates each independently, the circuit breaker tracks failures per session so one misbehaving agent doesn't affect the others, and your downstream system only receives validated payloads.

Cross-agent consistency. When Agent A writes to the "Invoice" gate and Agent B writes to the "Payment" gate, and both gates have business rules referencing amount ranges and currency constraints, you get consistent validation across your entire agent fleet without encoding those rules in each agent's prompt.

The analytics dashboard makes this observable — you can see which agents (by session) are hitting which gates, what their failure rates look like, and which business rules are triggering most often. When you're running dozens of agents in production, this is how you find the one that's drifting.

Human-in-the-Loop When You Need It

Not everything should be auto-approved. For high-value transactions, sensitive data changes, or any scenario where you want a human to verify before the data moves downstream, Flow supports approval workflows.

You configure approvers on a gate — either team members who review from the dashboard, or external reviewers who get a magic link via email. External reviewers don't need a Rynko account. They click a link, see the payload, and approve or reject it. The magic links are HMAC-SHA256 signed, expire after 72 hours, and are single-use for approval actions.

The approval model is any-approves: the first approver to act determines the outcome. For high-volume gates, we batch notification emails into 5-minute digests so reviewers don't get buried in individual emails. There's also a hard safety cap of 30 emails per hour per approver to prevent notification fatigue.

The review experience for freetext content (Markdown, HTML, plain text) includes scroll-to-approve guardrails — the approve button stays disabled until the reviewer has scrolled through the entire content. For long documents, we auto-generate a table of contents from Markdown headers so reviewers can navigate quickly.

MCP Integration: Dynamic Tools per Gate

This is where Flow connects directly to the AI agent workflow. When you connect an AI tool (Claude Desktop, Cursor, VS Code, or any MCP client) to Flow's MCP endpoint at https://api.rynko.dev/api/flow/mcp, Flow auto-generates a validation tool for each active gate in your workspace.

A gate with slug order-validation becomes a tool called validate_order_validation. The tool's input schema is generated from the gate's current schema — each field becomes a typed JSON Schema property with its constraints. The tool description includes the gate's business rule error messages, so the agent understands the constraints before submitting.

When you update a gate's schema, Flow pushes a notifications/tools/list_changed event to connected agents. They automatically see the updated tool list without reconnecting. No redeploy, no config change.

A conversation with an MCP-connected agent might look like this:

You: Validate this order before submitting.

Agent: I'll validate it against your Order Validation gate.
       [calls validate_order_validation]

       The order passed validation:
       - Schema validation: pass
       - Business rules: pass
       - Validation ID: v_abc123...

       You can use the validation ID to confirm this data
       hasn't been modified when it reaches your order system.
Enter fullscreen mode Exit fullscreen mode

Freetext Mode

Not all agent outputs are structured JSON. Sometimes the output is a Markdown document, an HTML email body, or a code snippet. Flow supports a freetext mode where the gate accepts content as a string instead of a structured schema.

Content format is declared at gate creation — plaintext, Markdown, HTML, or code. For Markdown and HTML content, Flow runs a sanitization pipeline on the backend using sanitize-html with a strict allowlist. Script tags, iframes, event handlers, and inline styles are stripped. Links get rel="noopener noreferrer". The reviewer sees sanitized content in a sandboxed view.

This is useful for agent workflows that produce reports, summaries, or email drafts where you need a human to review the content before it gets sent.

Delivery and Reliability

After validation (and approval, if configured), Flow delivers the payload to your webhook endpoints. Deliveries are signed with HMAC-SHA256 so you can verify the payload hasn't been tampered with.

The retry policy is straightforward: 5 attempts with delays at 30 seconds, 2 minutes, and 10 minutes. Each delivery attempt is logged, and failed deliveries can be retried manually from the dashboard or via the SDK.

Flow enforces per-team concurrency caps to keep the multi-tenant system fair — the exact limits scale with your tier, but even on the Scale plan, no single team can consume more than 25% of total worker concurrency. This prevents one team's spike from degrading service for everyone else.

SDKs

We've added Flow support to all three official SDKs. The pattern is the same across Node.js, Python, and Java — submit a run, poll for result, handle approvals:

import { Rynko } from '@rynko/sdk';

const client = new Rynko({ apiKey: process.env.RYNKO_API_KEY });

const run = await client.flow.submitRun('gate_abc123', {
  input: {
    orderId: 'ORD-2026-042',
    amount: 1250.00,
    currency: 'USD',
    customerEmail: 'buyer@example.com',
  },
});

const result = await client.flow.waitForRun(run.id, {
  pollInterval: 1000,
  timeout: 60000,
});

if (result.status === 'approved' || result.status === 'completed') {
  console.log('Validated:', result.validatedPayload);
} else if (result.status === 'validation_failed') {
  console.log('Errors:', result.errors);
}
Enter fullscreen mode Exit fullscreen mode

The SDKs are at version 1.3.1 with 14 Flow methods covering gates (read-only), runs, approvals, and deliveries. All three SDKs include automatic retry with exponential backoff for rate limits and transient errors.

Pricing

Flow is a separate subscription from Rynko's document generation (Render). The pricing is based on validation runs per month:

Tier Runs/Month Gates Price Overage
Free 500 3 $0
Starter 10,000 Unlimited $29/mo $0.005/run
Growth 100,000 Unlimited $99/mo $0.004/run
Scale 500,000 Unlimited $349/mo $0.002/run

The free tier is gate-limited to 3 — this is intentional. Most teams find they need more gates once they start connecting multiple agents to different validation checkpoints, and that's the natural upgrade trigger. Paid tiers have unlimited gates.

To celebrate the launch, we're opening a Founder's Previewsign up today and get 3 months of the Growth tier (100,000 runs/month, unlimited gates) completely free. No credit card required, no commitment. Once the preview ends, you can stay on Growth or switch to any tier that fits your usage.

If you also need document generation, Render Packs are available as add-ons on any tier — $19/month for 500 documents, $49 for 2,000, or $119 for 10,000.

The Dashboard

Flow comes with a full web dashboard for managing gates, reviewing runs, handling approvals, and tracking analytics. The gate configurator includes a visual schema builder (with Pydantic and Zod import), a business rule editor with live expression validation, and approval/delivery configuration. The runs view shows real-time status updates, validation error breakdowns, and a timeline of each run's journey through the pipeline.

The analytics dashboard covers the metrics you'd expect — run outcomes by gate, top failing rules, approval rates and decision times, throughput over configurable periods, and circuit breaker health. These metrics help you tune your gates and catch systemic issues early.

Getting Started

  1. Sign up for free — 500 Flow runs/month included, no credit card

  2. Create a gate in the Flow dashboard — define your schema and business rules

  3. Submit a test payload using the Quick Start guide or the dry-run endpoint (doesn't count against quota)

  4. Connect your AI agent via the MCP endpoint — Claude Desktop, Cursor, VS Code, Windsurf, Zed, or Claude Code

Flow is live and production-ready. We've been running it internally for weeks and the architecture has handled sustained load without surprises. If you're building with AI agents and need a systematic way to validate their outputs before they reach downstream systems, this is what we built it for.

Sign up | Documentation | MCP Setup | API Reference


Questions or feedback: support@rynko.dev or Discord.

Top comments (0)