Form filling (agent mode)
An AI Agent node in Form filling mode fills the fillable fields of a PDF form: membership application, government form, account opening form… Wired to the PDF form output, it turns the pipeline into a form portfolio, which returns the PDF it received with its fields filled.
The values come from four sources:
- the support documents attached to the job: customer file, ID card, company registration, CV…;
- the agent's knowledge base, when a RAG node is wired to its "RAG" handle;
- its tools: MCP connectors, skills, HNS packages;
- its expert agents, which it queries before filling.
A form portfolio is wired like this:
Support document ─┐
▼ (support)
Document to annotate → Agent (Form filling) → PDF form output
▲ experts
Agent (Consultable expert)
The document to annotate is the form, blank or partly filled. For a scan or a photo among the support documents, put an OCR node on their flow.
Ports
- Input (left, content type): the form. Only one incoming edge. A Page Filter can sit before it: the fields of the pages it drops are left untouched.
- "Form" output (right): only connects to the PDF form output.
- Skills, RAG, MCP, experts (bottom): the agent's tools and sources.
Configuration
- Agent: the Designer agent that fills the form. Its role, objective and constraints are its filling instructions: mapping between sources and fields, fixed values (« Place: Paris »), expected formats (« dates as DD/MM/YYYY »), boxes to leave empty. The same agent serves in every pipeline that uses it.
- AI model: optional override of the agent's model. Avoid models that reason before answering (qwen3, gemma-4…) unless you give them a large output limit (see Limits).
- Document reading: how the model locates each field in the form.
- Extracted text (default): the layout of each page, with an
[F3]marker where each field sits. Works with every model and is the cheapest. - Page images: each page rendered as an image, the fields framed in red and numbered. Useful for complex layouts (scattered boxes, tables without text). Requires a model that reads images.
- Text + images: both.
- Extracted text (default): the layout of each page, with an
- Rewrite fields already filled: unchecked by default, a field already filled in the received PDF is kept as is and not asked to the model. Checked, every field is asked again, and the model sees its current value.
- Use support documents: checked by default in this mode.
- Execution loop: the budgets of the research step (turns, duration, tokens).
Advanced settings
- Pages per window: empty, the form goes in a single call if it fits the model's context window, with 60 fields per call at most. Beyond that it is handled by consecutive pages, and each call sees the values already entered above so as to stay consistent.
- Correction passes (default 2): how many times a non-conforming answer is sent back to the model with the list of deviations, for example an option that does not exist or a checkbox neither checked nor unchecked. 0 disables correction. Each pass is billed.
- Image size (image reading): longest side of the pages sent, 1568 px by default.
How it runs
- Reading the form: fillable fields, labels, options, maximum lengths.
- Sources: the support documents, plus the knowledge-base excerpts found with a query built from the labels of the fields to fill.
- Research, only when the agent has tools or experts. The agent receives the form, the list of fields and the sources, then uses its tools to find the missing values. It ends with a summary « F3: value — source ». That summary and the tool answers join the sources.
- Filling: the agent gives the value of each field as structured output, with the same guarantees as the JSON extraction.
- Writing into the PDF, editable or flattened depending on the PDF form output.
With no source at all (no support document, knowledge base, tool or instruction), the agent makes no call and says so.
How the model understands the form
Technical field names are often meaningless (Text12, topmostSubform[0].Page1[0].f1_03[0]). The printed text around a field is what says what it is for. With Extracted text reading, the model therefore receives the page as it reads, with one marker per field:
Nom de naissance : [F1] Prénom(s) : [F2]
Date de naissance (JJ/MM/AAAA) : [F3]
Sexe : [F4=Choice1] Masculin [F4=Choice2] Féminin
Situation : [F8 ▾]
Prénom Date de naissance Ayant droit
[F9] [F10] [F11 ☐]
On top of this layout, it receives for each field:
- its type: text box, checkbox, radio button or list;
- the options on offer;
- the maximum length;
- the nearby label (the text on its left, on its right for a checkbox, or its column header in a table);
- the tooltip and the technical name.
The model answers field by field:
- text box: the text to enter. It is brought back to one line if the box is not multiline, and cut at the maximum length;
- checkbox: checked, unchecked, or nothing when the sources don't allow a decision;
- radio buttons and lists: one of the options on offer, otherwise nothing;
- nothing (
null) when the information is missing. The field stays empty: the agent makes nothing up.
Supported fields
| Field | Filled | Note |
|---|---|---|
| Text box (single or multiline) | ✓ | maximum length enforced |
| Checkbox | ✓ | the form's own « checked » state (Yes, On, Oui…) |
| Radio buttons | ✓ | one option of the group |
| Checkboxes of one group (« European » / « Other country », « yes » / « no ») | ✓ | read as a choice: the agent answers with the text printed next to the box, and that very box is checked |
| Drop-down or list box | ✓ | free entry if the list allows it |
| Read-only field | — | skipped, reported in the trace |
| Signature, action button, password | — | skipped, reported in the trace |
Dynamic XFA forms (without AcroForm fields) are not supported: the agent says so. A hybrid form (AcroForm + XFA) is filled, and its XFA layer is removed so that every viewer shows the values entered.
In the trace
The test panel shows:
- the tools and experts offered to the agent, its tool calls and its knowledge-base queries;
- the summary of its research;
- for each field, its key, its page, its label and the value entered (☑ / ☐ for a checkbox, — when the field stays empty). An unusable answer is reported under the value, for example « Italie is not an option of the field » or « cut to 10 characters »;
- one entry per expert consulted, with its questions and answers.
Interceptors
Interceptors apply to the form layout, the support documents and the knowledge-base excerpts. An IBAN masked by an interceptor therefore stays masked: the model cannot copy it. An answer containing the replacement text (<REDACTED>…) is not written. The field stays empty and the trace says « value masked by an interceptor ».
With image reading, as for the JSON extraction, data to mask on a page of the form blocks the job: an image cannot be masked.
Limits
- Only PDFs are accepted as the main document of a form portfolio.
- A PDF protected by an opening password cannot be filled. A PDF with usage restrictions only is filled, and the result is no longer encrypted.
- Reasoning models: if the answer is cut off although it fits easily within the model's output limit, the agent stops and says so instead of retrying the call. Raise the model's output limit (Admin → AI models) or pick a model without reasoning.
- The form-filling agent cannot run inside a chunking loop: it reads the whole form.
- A form portfolio appears neither in the Benchmark nor among the pipelines offered in Microsoft Teams, and cannot be called from a Pipeline node.