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.
Related Templates
AI Weather Forecasts with MCP Integration
Real-time Weather Forecasts with MCP Tools This n8n workflow demonstrates how to integrate real-time weather intelligen...
Google Sheets UI for n8n Workflow
Google Sheets UI for Workflow Control This n8n template provides a practical and efficient way to manage your n8n workf...
Demo Workflow - How to use workflowStaticData()
This workflow demonstrates how to use the workflowStaticData() function to set any type of variable that will persist wi...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments