Fill any PDF from JSON data with JustFill and Google Gemini vision
Fill any PDF from JSON data with JustFill and Google Gemini vision
Quick overview This workflow collects a PDF and a JSON payload via an n8n form, uses JustFill to detect fields and render previews, then uses Google Gemini Vision to map data to field IDs and visually review the filled result before generating a downloadable filled PDF. How it works Receives a PDF upload and a “Data JSON” object through an n8n form. Requests an upload slot from JustFill, uploads the PDF, and opens it to detect fillable fields and create a workspace. Renders labelled page previews for all pages with detected fields using JustFill. Sends the labelled previews plus the user’s JSON keys to Google Gemini to map each data key to a specific JustFill field ID. Renders filled previews with the proposed values and asks Google Gemini to independently review the placement and readability across pages. If Gemini approves with no issues, fills the PDF in JustFill and returns a redirect link to download the completed document. Setup Add a JustFill API key and a Google Gemini API key, then paste them into the Config step (including the model name, if you want to change it). Ensure your JustFill account can access the MCP tools used by the workflow (request_file_upload, open_pdf, render_preview, render_filled_preview, and fill_pdf). Customize the n8n form fields (and any sample JSON) to match the kinds of data you plan to submit, then copy the form URL for users who will upload PDFs. Requirements A JustFill API key. The free plan works for testing, downloads are watermarked. You also need a Google Gemini API key for the vision model set in Config. Customization Swap the n8n form for a webhook, a Google Sheets row or your CRM, and change the model name in Config if you prefer another Gemini model. For a form you fill often, save it as a JustFill template and use the simpler template-based workflow instead.