# n8n

Install: **Settings → Community Nodes → Install → `n8n-nodes-sirdas`**. Self-hosted n8n only (community nodes are not available on n8n Cloud's starter plans).

The node reads the binary from the previous node (Gmail, Google Drive, Webhook, Read Binary File…) and never sends it anywhere.

| Operation | Output |
|---|---|
| **Read Document** | `document_type`, `fieldValues` (flat object for Sheets/Airtable), `fields` with page and bbox, `tables`, `form`, `documents`, `markdown`, `chunks`, `next_steps` |
| **Convert to Markdown** | `format`, `markdown`, `tables` |
| **Split Batch** | one item + PDF binary per document |
| **Read Form** | `fields`, `checkboxes` |
| **Protect PDF** / **Unlock PDF** | PDF binary |

## Recipes

- **Invoices from email to a sheet:** Gmail Trigger (attachments) → Sırdaş *Read Document* → IF `{{$json.document_type}}` equals `factura` → Google Sheets *Append* `{{$json.fieldValues.numero_factura}}`, `{{$json.fieldValues.nit_emisor}}`, `{{$json.fieldValues.total}}`.
- **Scanned batches:** Drive Trigger → Sırdaş *Split Batch* → Drive *Upload* (`{{$json.type}}` folder).
- **AI without exposing patients:** Webhook → Sırdaş *Read Document* (anonymize on) → OpenAI/Claude node with `{{$json.markdown}}`.

OCR in n8n needs the Tesseract language data on the host once: `npx sirdas ocr --download-models --lang spa+eng`.
