Email Integration
How email processing works
Every Tavnit flow can have its own inbox address. When you enable the email trigger and send a document to that address, Tavnit takes each supported attachment, creates a separate extraction run for it, and processes it exactly as if you had uploaded it in the app.
Nothing is installed and nothing polls your mailbox: you forward mail to the address and Tavnit reacts. That makes it the shortest path from “invoices arrive by email” to “invoices arrive as structured rows”, with no code involved. Collections, Splitters, Pipelines, Matchers and Subjects have their own addresses too.
- Forwarding invoices or receipts straight from your inbox
- A shared accounts-payable mailbox with an auto-forward rule
- Letting suppliers send documents in without giving them a Tavnit login
- Extracting data that arrives in the message itself, such as order confirmations with no attachment
Turn on the email trigger
The trigger is off by default. Turn it on from the flow's detail page, copy the address it gives you, and send one document as a test before you point a forwarding rule at it.
- 1Go to Flows and open the flow you want to receive documents.
- 2Open the Email Trigger panel and switch it on. The flow's Inbox Address appears.
- 3Click Copy next to the address. In the same panel you can add Allowed Senders or turn on Process Email Body (both explained below).
- 4Send one PDF to it and check the Runs page. A new run appears with the source Email, and the sender's address is recorded on the run.
- 5Once that works, add the forwarding rule in your mail client or shared inbox.
An email with three invoices attached produces three separate runs, each with its own result and its own row in the Runs list. It does not produce one run containing three documents.
Mail sent to an address whose trigger is switched off (or to an inactive Collection) is accepted and discarded: the sender gets no bounce and no error. If documents seem to vanish, check the toggle first.
Allowed Senders
By default any sender can trigger a run by emailing the address. Add addresses to Allowed Senders in the Email Trigger panel and only those senders are accepted; mail from anyone else is silently discarded.
- Entries are full email addresses, not domains. Matching ignores letter case and display names.
- Leave the list empty to accept email from any sender.
- The list is available on the email trigger of flows, Collections, Splitters, Pipelines, Matchers and Subjects.
- When you forward through a shared mailbox, the sender Tavnit sees is usually the mailbox doing the forwarding, so that is the address to allow.
Process the email body
Some data never arrives as an attachment: an order confirmation, a booking notice, a supplier writing the quantities in the message. Turn on Process Email Body and Tavnit converts the message body to a PDF and processes it like any other document. It is available on flows and Collections.
| Mode | What happens |
|---|---|
| Only when nothing is attached (default) | The body is processed only when the email has no document attachment. A “see attached” cover note next to an invoice is skipped, so one email never starts two runs. |
| Always | The body is processed alongside every attachment, each in its own run. |
- The body PDF appears in review like any other document, and the run is marked as coming from the email body.
- Quoted reply chains and signatures are dropped where the mail provider can identify them.
- Images inside the message are not read. Inline signature images do not count as attachments when deciding whether the body should be processed.
- A body with almost no text (“ok”, “thanks”, an empty forward) is not processed.
Which features have an email address
The email trigger is not limited to flows. Point an address at a whole sorting stage, a pipeline or a comparison instead of a single document type.
| Send to | Address shape | What happens |
|---|---|---|
| A flow | flow-name-<id>@mg.tavnit.io | Each attachment is extracted by that flow. |
| A Collection | name-<id>-collection@mg.tavnit.io | Each attachment is classified and routed to the right flow or Splitter. See how Collections route documents. |
| A Splitter | <id>-splitter@mg.tavnit.io | Each attachment is broken into its separate documents first. See splitting multi-document files. |
| A Pipeline | <id>-pipeline@mg.tavnit.io | Each PDF or image attachment starts one execution. See Pipelines. |
| A Matcher | <id>-matcher@mg.tavnit.io | All the PDF or image attachments of one email are compared together in a single match (always in multilateral mode), and the result is replied in the same thread. See Matchers. |
| A Subject | <id>-subject@mg.tavnit.io | Each attachment is filed into the right case by a reference in the subject line, body or filename, or by the case's own plus-address. See Subjects. |
If a sender only ever sends one document type, give them the flow address. If they send a mix (invoices, purchase orders, delivery notes), give them the Collection address and let Tavnit sort it. If they send one PDF containing several documents, give them the Splitter address.
What Tavnit accepts
Flows, Collections, Splitters and Subjects read PDFs, common images and spreadsheets. Pipelines and Matchers read PDFs and images only. Anything else in the message is skipped without failing the rest: one unsupported file does not stop the other attachments from being processed.
| Accepted | Extensions |
|---|---|
| PDF documents | .pdf |
| Images | .png .jpg .jpeg .jfif .tif .tiff .webp .bmp .gif |
| Spreadsheets (not Pipelines or Matchers) | .xlsx .xls .csv |
An attachment is skipped rather than processed when any of these is true:
| Reason skipped | What it looks like |
|---|---|
| Unsupported file type | Word documents, archives, .eml forwards and anything without a recognised extension. |
| Empty attachment | A zero-byte file, usually a broken forward. |
| Unreadable file | The file has a valid extension but cannot be opened: a truncated download, a renamed file, or a spreadsheet that does not parse. |
A logo in an email signature often arrives as an image attachment, and a flow will process it like any other image. If that creates unwanted runs, forward only the documents, or use Allowed Senders and a forwarding rule that strips inline images.
Your mail provider's attachment size limit applies before Tavnit ever sees the message. If a large scan bounces at the sending end, upload it in the app or post it to the REST API instead.
How spreadsheets are handled
A spreadsheet attachment is treated as a document, not as a table to import. What happens depends on where you send it.
| Sent to | What Tavnit does |
|---|---|
| A flow | Extracts from the first visible sheet. |
| A Collection | Classifies the file by its first sheet, then hands it to the chosen flow, which reads the first visible sheet. |
| A Splitter | Treats every visible, non-empty sheet as its own document, classifies each one and sends it onward as a single-sheet file. |
Very large sheets are rejected with an error. To load a spreadsheet as structured rows instead, use a Cleaner sweep.
Duplicate protection
Mail servers sometimes deliver the same message more than once, for example after a timeout. Tavnit recognises a redelivered message to the same address and does not process it again, so a retry never creates duplicate runs.
- Tavnit acknowledges the message within seconds and processes the attachments in the background, so an email with many attachments is safe to send.
- If processing is interrupted, it resumes where it stopped instead of starting over.
- One message sent to two different Tavnit addresses is processed once at each address.
- Sending the same file again in a new email is a new message and is processed again.
Email the results back out
Email Output is the return leg: when a run finishes successfully, Tavnit emails the result to the addresses you configure. It is independent of the email trigger: you can use either on its own, or both to make a full send-in, get-back-out loop.
- 1Open the flow's detail page.
- 2Open the Email Output panel.
- 3Add one or more Recipient Addresses.
- 4Choose what each message carries under Attachments, then save.
| Option | What arrives |
|---|---|
| JSON extraction | The extracted result as formatted JSON in the message body. |
| CSV extraction | The rows as a rows.csv attachment, the fastest way to get results into a spreadsheet. |
| Form results | The filled PDFs, when the flow fills a form template. |
| Original document | The source file (PDF, image or spreadsheet) that was processed, attached alongside the results. |
Fields that hold a file or an image are not embedded in the JSON. They come through as time-limited links, because Tavnit keeps stored documents private: a raw storage path would not be fetchable from an inbox.
- Output email only fires on runs that complete successfully. A failed run sends nothing.
- The subject line carries the flow name plus a per-run detail, so mail clients do not collapse every run of a flow into one thread.
- If the flow has human review enabled, the email waits until a reviewer approves the run.
- For machine-to-machine delivery, a webhook is a better fit than email.
Worked example: an accounts-payable inbox
The common setup is a shared mailbox that already receives supplier invoices, forwarded into a Collection so each supplier's format lands in the right flow, with results emailed to the finance team and pushed into a Bucket.
- 1Build one flow per document type you receive, for example Supplier Invoices and Delivery Notes, and give each a clear description.
- 2Put both flows in a Collection and enable the Collection's email trigger. Add the shared mailbox to Allowed Senders.
- 3In the shared mailbox, forward any message with an attachment from your supplier domains to the Collection address.
- 4On each flow, turn on Email Output with the CSV attachment for the finance team, and add a Bucket export so the data accumulates in one table.
- 5Add a Cleaner with a conditional action that sends anything over your approval threshold to human review before it is delivered.
Nobody in finance has to open Tavnit. Invoices arrive where they always did, and the structured data comes back to the same inbox.
Troubleshooting
Because inbound mail is accepted silently, a document that does not turn up leaves no error in your inbox. Work down this list: the cause is almost always the trigger toggle, Allowed Senders, the attachment type, or a forwarding rule that strips attachments.
| Symptom | Likely cause | Fix |
|---|---|---|
| No run appears at all | The email trigger is off, the address belongs to a different flow, or the sender is not in Allowed Senders. | Re-check the toggle and the Allowed Senders list, and copy the address again from the Email Trigger panel. |
| Some attachments processed, others not | The missing ones are an unsupported type, empty, or unreadable. | Check the extensions against the accepted list above. |
| Only the signature image was processed | The real document was not attached: it was linked, or the forward dropped it. | Forward as an attachment rather than inline, and check the rule preserves attachments. |
| An email with no attachment did nothing | Process Email Body is off, or the body had almost no text. | Turn on Process Email Body in the Email Trigger panel (flows and Collections). |
| The cover note produced its own run | Process Email Body is set to Always. | Switch the mode to Only when nothing is attached. |
| Runs appear but fail | The document itself is the problem, not the email path. | Open the run and read its log; the failure is an extraction issue. |
| Results never arrive by email | Email Output is unset, the run failed, or it is waiting for review. | Check the run's status first, then the Email Output configuration. |
