---
title: "preflight document · RUAL Documentation"
description: "Convert a document (PDF, image, HTML, spreadsheet, text) to clean Markdown with a cheap model, stripping boilerplate; run before sending it to an expens…"
canonical: https://docs.rual.nl/block-types/anthropic/anthropicconnection_preflight
language: en
---

# preflight document

This block is part of the [`anthropic`](https://docs.rual.nl/block-types/anthropic) group and was last modified in core [`v15.0.0`](https://docs.rual.nl/core-versions/150000).

Convert a document (PDF, image, HTML, spreadsheet, text) to clean Markdown with a cheap model, stripping boilerplate; run before sending it to an expensive model to cut tokens.

- flow `flow`

- connection required `anthropicconnection`

- file required `file` The document to convert. Text and spreadsheets convert for free; PDFs/images/HTML use a cheap model.

- model `value` Model for the conversion. Defaults to claude-haiku-4-5 (cheap). • Suggestions: `claude-haiku-4-5` `claude-sonnet-4-6`

- max tokens `number` Max Markdown tokens to generate. Defaults to 16000.

- flow `flow`

- connection `anthropicconnection`

- success `condition`

- markdown `value` The cleaned Markdown; feed this to a message block instead of the raw file.

- file `file` The cleaned Markdown as a .md file; wire straight into a message block's attachments pin.

- format `value` Detected document kind: text | spreadsheet | pdf | image | html | unsupported.

- cost `number` USD cost of the conversion (0 for text/spreadsheet).

- usage `object`

- partial `value`

- warnings `array ` Non-fatal notices: unsupported_format (the file type can't be converted), cost_unknown.

- errors `array ` Error codes when the call fails (success=false): config_error, internal_error, model_not_allowed, budget_exceeded, concurrency_limit_exceeded, rate_limited, refused, max_tokens, transport_error.

- error detail `value`

| `document to markdown` |
| --- |
| `extract text` |
| `clean document` |
| `ocr` |
| `pdf to markdown` |
| `strip boilerplate` |

A typical wiring for [preflight document](https://docs.rual.nl/block-types/anthropic/anthropicconnection_preflight): a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) starts the flow; [get file from assets](https://docs.rual.nl/block-types/files/file_from_assets) feeds the `file` pin; the `flow` out pin feeds [debug](https://docs.rual.nl/block-types/state%20ui/state_debug).

![Studio canvas example for the preflight document block: typical wiring for preflight document.](https://docs.rual.nl/canvas-examples/anthropicconnection_preflight.png)

### Version history

Introduced in [`v15.0.0`](https://docs.rual.nl/core-versions/150000).
