Skip to main content

Flow + Extract Pipeline

When you enable Extract on a Flow gate, it adds Stage 0 to the pipeline. Files uploaded to the gate are first processed by AI to extract structured data, which is then validated against the gate's schema.

How It Works

┌──────────────┐    ┌──────────────┐    ┌──────────────┐    ┌──────────────┐
│ Stage 0 │ → │ Stage 1 │ → │ Stage 2 │ → │ Stage 3+ │
│ Extract │ │ Validate │ │ Render │ │ Approve │
│ (AI) │ │ (Schema │ │ (PDF/Excel) │ │ & Deliver │
│ │ │ + Rules) │ │ │ │ │
└──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘

Structured inputs skip Stage 0: If an agent submits JSON, YAML, or XML directly, Stage 0 is bypassed — no extraction needed, no extract credit consumed.

Enable Stage 0

Via Dashboard

  1. Open your gate in the Flow dashboard
  2. Click the Extract Source step (Step 0)
  3. Toggle Enable file extraction
  4. A linked Extract config is created automatically

Via API

curl -X PATCH https://api.rynko.dev/api/flow/gates/GATE_ID/extract/enable \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"extractEnabled": true,
"extractId": "uuid",
"extractShortId": "extr_abc12345",
"extractName": "Invoice Validator (Extract)"
}

Submit a File Run

Once Stage 0 is enabled, submit files via the pipeline endpoint:

curl -X POST https://api.rynko.dev/api/flow/gates/GATE_ID/runs/file \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "files=@invoice.pdf" \
-F "instructions=Focus on the totals section"

Run Lifecycle

A file-based run goes through these statuses:

StatusStageDescription
extracting0AI is processing the file
extract_review0Waiting for human review (if configured)
validating1Extracted data is being validated
validated1Schema + rules passed
rendering2Document being generated (if configured)
pending_approval3Waiting for approval (if configured)
delivered4Result sent via webhook
completed-Pipeline finished

Failure Statuses

StatusDescription
extraction_failedAI could not extract data (file unreadable, provider error)
extract_rejectedReviewer rejected the extracted data
extract_review_expiredReview window expired (5 days)
validation_failedExtracted data failed schema validation

Schema Ownership

The gate's schema is the extraction schema — there's no separate schema to maintain. When you edit the gate's schema, the extraction target updates automatically.

Credits

Each file-based run costs:

  • 1 extract credit (for Stage 0)
  • 1 flow run (for Stage 1+)

Structured input (JSON/YAML/XML) costs only 1 flow run — no extract credit.

Disable Stage 0

curl -X PATCH https://api.rynko.dev/api/flow/gates/GATE_ID/extract/disable \
-H "Authorization: Bearer YOUR_API_KEY"

The linked Extract config is archived (not deleted). Re-enabling Stage 0 reactivates it.