Flows
What a flow is
A flow is the definition of one document type: the fields you want extracted, the hints that tell the AI where to find them, and everything attached downstream. It is the object in Tavnit that turns a document into data — Collections, Subjects, Splitters and Cleaners all exist to feed or refine what a flow produces.
There is no template to draw and no coordinates to map. You describe the fields in plain terms and the flow works across layouts, so one Supplier invoices flow can handle twenty vendors whose invoices look nothing alike. That is also why the schema and its hints are where nearly all extraction quality is won or lost.

A flow needs at least one field. Everything else in the rail — Cleaner, agent, webhook, email, Bucket export, review — is optional and can be added later without rebuilding anything. Owners and Admins can create and edit flows.
Create a flow
Click Create Flow on the Flows page and Tavnit asks “How do you want to start?”. All three paths end in the same editable flow, so pick whichever gets you to a good first draft fastest.
| Option | What it does | Best when |
|---|---|---|
| From a template | Opens a gallery with two tabs. Tavnit templates are ready-made flows with fields and hints already filled in; My flows lets you Create Copy of one of your own active flows. | Your document is a common type, or close to a flow you already have. |
| AI suggestion | Upload a sample PDF or image. The AI reads it, detects the fields and drafts a name, a description and a schema with hints. Uncheck what you do not need and edit any field before creating the flow. | Your document is specific to your business and you want a head start. |
| Start from scratch | An empty schema. You define every field yourself. | You know exactly what you need, or you are rebuilding an existing process. |
Tavnit templates cover invoices, purchase orders, receipts, bank statements, delivery notes, lab results, contracts, quotes, credit notes, ID documents and resumes. If you answered the welcome questions when you set up your organization, the templates that match your documents are shown first, and the empty Flows page offers to create them all in one click with Create these flows.
Every path finishes with a name (at least 3 characters) and a description (at least 10 characters). The flow opens in the builder with a short “Set up your flow” guide, and it is Active from the start — use the switch in the top bar to deactivate it. An inactive flow cannot be run.
Drafting a flow from a sample document does not create a run. Treat the draft as a starting point — delete what you will not use, because every extra field is more to review and more that can go wrong.
Metadata fields and table fields
Every field is one of two kinds, decided by whether the value appears once per document or once per line. This is the most consequential choice in the schema: it determines the shape of your webhook payload, your Bucket rows, your CSV and your review screen.
| Metadata field | Table field | |
|---|---|---|
| Appears | Once per document | Once per row of a repeating table |
| On an invoice | Invoice number, issue date, supplier, total | Description, quantity, unit price, amount |
| In the output | The metadata object | One entry per row in rows |
| In a Bucket | Repeated onto every row exported from that document | One Bucket row each |
Defining a line-item column as a metadata field gets you one value from a table of twenty. Defining an invoice total as a table field repeats the same number on every row. If you are unsure, ask whether a second copy of the value could ever appear on the same document.
A flow with only metadata fields — an ID document, a certificate, a one-page form — returns a single row per document holding those values, so the result still lands in your table view, Bucket, webhook and email like any other run.
A flow can also stamp System Columns onto every row it outputs — the flow ID, the flow name and the run ID. Turn these on when several flows write into one Bucket and you need to know which document a row came from.
Data types
Each field carries a type. Types are not cosmetic: they decide whether a value sorts, sums, compares in a Cleaner rule and charts correctly. Setting them right at the flow saves work at every later stage.
| Type | Use for | Notes |
|---|---|---|
| Text | Names, addresses, descriptions, reference codes | The safe default. |
| Number | Totals, quantities, prices, rates | Required if you want to sum, compare or chart the value later. |
| Date | Issue dates, due dates, delivery dates | Reformatting to a consistent output format is a Cleaner job, not an extraction one. |
| Mixed/Alphanumeric | Values that blend letters and digits — part numbers, container codes, tax IDs | Use this rather than Number when leading zeros or letters must survive. |
| Image | Figures printed in the document: photos, logos, signatures, stamps | Extracted and stored securely, then delivered as a time-limited link. |
Do not use the type to reformat. Pull the value the way the document shows it, then let a Cleaner convert currencies, restate dates and fix decimal separators. Extraction that also transforms is harder to debug when a number comes back wrong.
Extraction hints
Hints are how you disambiguate a field without writing a template. They matter most when a document contains several values that look alike — three dates, two totals, an order number and an invoice number in the same header block.
For a metadata field you can combine any of these:
| Hint | What it tells the AI | Good for |
|---|---|---|
| Example values | Real values copied from your documents. | Almost everything. The single highest-value hint — it shows format, length and shape at once. |
| Next to a label | The printed label the value sits beside. List the variants: Invoice Number, Invoice #, Inv No. | Header fields that different vendors label differently. |
| In a specific page area | One of nine zones — top-left through bottom-right. | Values that are always in the same corner, like a document number top-right. |
| Expected range | A minimum, a maximum, or both. Treated as guidance, not a hard rule. | Catching a decimal-point misread — a total of 27,030 where 270.30 was meant. |
| Additional hints | Free text for anything the options above do not cover. | Rules like “use the net figure, never the gross one”. |
For a table field the hints are different, because the AI is locating a column rather than a point on the page:
| Hint | What it tells the AI |
|---|---|
| Source type | Table for data in a real table with columns; Free-form for row-like values in unstructured text, such as a contract. |
| Column headers | The header text as printed. List every variant your vendors use so one field matches them all. |
| Expected range | A sanity range for the numbers in that column. |
| Example values | Real cell values from your documents. |
| Additional info | What the column actually represents, when the header alone is ambiguous — “unit price before discount”. |
Add fields, run one real document, and only add hints where the result was wrong. Hinting everything up front costs time on fields that were never ambiguous, and an over-specified hint can make extraction worse by ruling out a layout you did not anticipate. Once the flow has a few runs, Diagnose can propose hints for you.
Example values are skipped for Date and Image fields, so put any date guidance in the additional-hints box instead.
Composite fields
Some table columns hold several values in one cell — a size-and-quantity breakdown like S:2 M:5 L:3 printed in a single box. A composite field splits that cell into sub-fields so each part becomes its own value instead of a string you have to parse later.
- 1Add a table field and switch Composite Field on.
- 2Define the sub-fields that make up the cell — for example
sizeas text andquantityas a number. - 3Add example values showing how the grouping appears in your documents.
Sub-fields hold single values, so they can be Text, Number, Date or Mixed/Alphanumeric — but not Image. Composite fields are only available on table fields, because the whole point is unpacking a repeating cell.
The metadata equivalent is Accept multiple values. Turn it on when a single document can legitimately carry several of the same thing — a set of receipt numbers, several purchase-order references — and the field returns a list instead of one value. It is not available on Image fields.
Extracting images
An Image field pulls a figure out of the document rather than text: a product photo, a signature, a stamp, a logo. A metadata image field holds one image per document; a table image field gives each row the image belonging to it.
- Images are stored privately, so they arrive downstream as time-limited links rather than raw bytes
- The same kind of link appears in the webhook payload, the email output and the CSV cell; an export from the run page generates fresh links
- Links in deliveries are valid for seven days — download the image rather than storing the link
- Image fields cannot be composite or accept multiple values, and example-value hints do not apply to them
Build the schema
Build metadata fields first, then table fields, then hints. Test against a real document early — a schema that looks right on paper and a schema that survives your actual paperwork are different things.
- 1Click Create Flow and pick a template, an AI suggestion or a blank flow. Give it a name that describes the document (Supplier invoices) and a real description — it improves extraction accuracy and is what a Collection matches on later.
- 2Under Metadata Fields, click Add Field for each value that appears once per document, setting the data type as you go.
- 3Under Table Fields, add a field for each column of the repeating line-item table.
- 4Add extraction hints only to the fields that need them.
- 5The flow is already Active. Click Run, process one real document, and compare the result against the source.
Drag fields by their handle to reorder them.
Renaming a field changes the key in every downstream consumer: the webhook payload, the Bucket column mapping, the CSV header and any Cleaner that reads it. Check what is attached before renaming a field on a flow that is already running.
What files a flow reads
A flow accepts PDFs, images and spreadsheets, through every route — upload, email and API. Tavnit decides how to read each file, so you do not configure anything per format.
| File | Formats | How it is read |
|---|---|---|
| Digital PDFs are read directly. Scanned PDFs are detected automatically and read with OCR first. | ||
| Image | PNG, JPG, JPEG, JFIF | Read like a scanned page. JFIF is the JPEG variant some Windows browsers save by default, and works like any JPEG. |
| Spreadsheet | XLSX, XLS, CSV | The first visible sheet is read. Other and hidden sheets are ignored, so put the data you want on the first sheet. |
Very large sheets are rejected with a clear error. To process each sheet of a workbook as its own document, send it through a Splitter instead.
Scanned documents already get OCR automatically. Some files look digital but carry a broken text layer — a scan with a poor embedded transcript, a PDF exported from an odd tool. For those, open Bad Scan in the flow's settings and turn it on: every file in the flow is then read with OCR first, and extraction works from the recovered text. If OCR is unavailable or fails, the run falls back to the standard pipeline automatically.
What you can attach to a flow
The schema decides what comes out; the rest of the flow decides what happens to it. Each item below is independent — attach only what you need, in any order, at any time.
| Stage | Attachment | What it does |
|---|---|---|
| Inputs | Email Trigger | Gives the flow its own inbox address so forwarded documents (PDF, image or spreadsheet) are processed automatically. |
| Inputs | Collections | Lists the Collections that can route documents to this flow. |
| Processing | Cleaner | Sweeps every run's rows: reformat, convert, compute, look up, and fire rules. |
| Processing | Agent | Runs after extraction, using extracted fields as its inputs. |
| Processing | Form Templates | Fills a PDF template from a run's extracted values. |
| Outputs | Email Output | Emails results to one or more addresses after each successful run, with optional JSON, CSV, filled-form and original-document attachments. |
| Outputs | Webhook | POSTs results to your endpoint. HTTPS only. |
| Outputs | Bucket Export | Appends each run's rows to a structured table, with fields mapped onto columns. |
| Settings | Human in the Loop | Pauses runs for a reviewer before anything is delivered. |
| Settings | Bad Scan | Forces OCR for every file in the flow (see above). |
| Settings | Flow ID | The identifier you pass when calling the API. |
Email Trigger options. Once the trigger is on, the panel shows the flow's inbox address and two settings. Allowed Senders limits who can start a run by email; leave it empty to accept any sender. Process Email Body also extracts from the message text itself, either Only when nothing is attached (the default, so a cover note never starts a second run) or Always. The sender's address is recorded on each run and shown on the Runs page. Email Integration covers the details.
Diagnose a flow
Once a flow has processed some documents, the Diagnose button in the flow's top bar opens the Flow doctor. It studies your recent completed runs, finds the fields that keep coming back empty or with the wrong type, and proposes corrections.
- 1Open the flow and click Diagnose. The button appears once the flow has at least one field, for Owners and Admins.
- 2Tavnit reads the recent runs, re-reads a few of the documents where fields failed, and drafts corrections. This takes a moment.
- 3Review the result. Each problem field shows how often it was empty or had the wrong type, with the Current hint beside the Proposed one. It may also offer a Suggested description.
- 4Keep or edit the fixes you agree with and click Apply. Nothing changes until you apply; closing the panel discards the proposals.
If everything looks fine you will see “Extraction looks healthy”. Diagnose only runs when you click it. Re-run a real document after applying fixes to confirm they helped.
Runs: what happens when a document is processed
Every document becomes a run, and every run moves through the same sequence. Knowing the order tells you where to look when something arrives late, arrives wrong, or does not arrive at all.
- 1The document is stored and the run is queued.
- 2Extraction reads it and produces metadata values and table rows.
- 3If a Cleaner is attached, it sweeps those rows — conversions, computed columns, lookups.
- 4Conditional rules fire: rows can be dropped, notifications sent, review requested.
- 5If review is required, the run pauses and nothing is delivered until a reviewer approves.
- 6Outputs run: email, Bucket export and webhook. The run is then marked completed, and a linked agent, if any, starts.
| Run status | Meaning |
|---|---|
| Pending (queued) | Stored and waiting for a worker. |
| Processing | Being extracted, cleaned or delivered. The run page shows the current stage. |
| Retrying | A previous attempt failed for a temporary reason and the run was queued again automatically (see below). |
| Awaiting HITL review | Paused for human review. Nothing has been delivered yet. |
| Completed | Extraction finished and every configured output has run. |
| Cancelled | Someone cancelled the run while it was queued or processing, or a reviewer rejected it. Nothing more is delivered. |
| Failed | The document could not be processed. The run's log says why. |
Working with runs
The Runs page lists every run in your organization; each flow also has its own Recent Runs tab. Use Filter to narrow by status, date range, flow, user, source or a pasted run ID.
| Action | Where | Notes |
|---|---|---|
| View Details | Run actions menu, or click the row | Extracted data beside the source file, the run information and the processing log. |
| Download CSV | Run actions menu | Completed runs only. Export CSV and Export JSON are also on the run page. |
| Download File | Run actions menu, or Download on the run page | The original source file. Spreadsheets cannot be previewed inline, so download them to view. |
| Cancel Run | Run actions menu | Only for runs still queued or running. |
The Triggered By column shows who started the run — the user for an upload, or the sender's address for a run that arrived by email. The Source column says how it arrived: manual upload, API, email and so on.
Failed runs and automatic retries
Most failures are the document's fault — an unreadable file or an unsupported type — and retrying would not help. A few are not: a processing worker restarts mid-run, or an AI provider has a temporary outage. For those, an organization can have Tavnit retry on its own.
- 1Go to Settings → Organization → Failed runs. Only the Owner can see this tab.
- 2Turn on Automatically retry failed runs.
- 3Set Maximum retries per run to 1, 2 or 3.
- A retried run keeps the same run ID, so API polling, webhooks and links keep working.
- Outputs only fire when a run completes, so a retry never delivers a document twice.
- Never retried: invalid files, unsupported types, cancelled runs, runs paused for review, and runs created more than a day ago.
- A run lost to a worker restart is detected automatically. With auto-retry on it is queued again; with it off, it is marked Failed.
- The run page lists Previous attempts, each marked Lost worker or Failed with its error, and the Runs list shows a retry badge.
To hear about runs that end in failure, add addresses under Run Failure Notifications in the same tab.
Improving extraction quality
When a field comes back wrong, the fix is nearly always in that field's definition rather than in the document. Start with Diagnose if the flow has runs, then work through these — the first two solve most cases.
| Symptom | Likely cause | Fix |
|---|---|---|
| The wrong one of several similar values | Nothing distinguishes them. | Add the label the value sits next to, or the page area it appears in. |
| A field comes back empty | The field name alone did not identify it. | Add two or three real example values — usually enough on its own. |
| Only one line item, when there are many | It was defined as a metadata field. | Redefine it as a table field. |
| The same value repeated on every row | A document-level value was defined as a table field. | Redefine it as a metadata field. |
| Numbers off by a factor of a hundred | Decimal and thousands separators read the wrong way round. | Set an expected range, and normalise the format in a Cleaner. |
| Leading zeros or letters dropped | The field is typed as Number. | Change it to Mixed/Alphanumeric. |
| Columns confused with each other | Two columns have similar headers. | Add the printed column headers, and describe the column in Additional info. |
| Good on some vendors, poor on others | The hints describe one vendor's layout. | Add the other vendors' label and header variants to the same field. |
| Garbled text from a file that looks digital | The PDF's embedded text layer is broken. | Turn on Bad Scan so the flow reads it with OCR. |
| A spreadsheet comes back empty or partial | The data is not on the first visible sheet. | Move it to the first sheet, or use a Splitter for multi-sheet workbooks. |
Re-run the same document after each change. Editing four hints at once and re-running tells you the result improved but not which change did it — and one of the four may have made things worse.
If the value is right but the format is not — dates, currencies, units, casing — leave the flow alone and add a Cleaner.
