This discussion is about troubleshooting a document processing automation that uses an AI model to extract findings from files and insert them into a database, specifically focusing on fixing JSON mapping errors and database security settings

:bullseye: What is your goal?

Step 1: The “Digital Watchman”
First, I set up a monitoring system that constantly watches a specific folder in my cloud storage. The moment a new file—containing both text and images—is uploaded, my automation “wakes up” and grabs the file’s ID so it knows exactly which document to work on.

Step 2: The “File Fetcher”
Once the file is detected, I have the system perform a “Download” action. This step is crucial because it converts the file from a simple link into a raw “binary buffer”—essentially the digital DNA of the document—that an AI can actually “see” and analyze.

Step 3: The “AI Brain” Analysis
This is where the magic happens. I send that raw file data to a high-powered AI model. I’ve written specific JSON instructions to tell the AI: “Look at this document and extract all the key findings and defects into a structured list”. This replaces the 20 minutes I would usually spend reading the report myself.

Step 4: The “Secure Vault” Storage
Finally, I take the structured text the AI produced and tell my database to “Create a New Row”. The goal is for those findings to appear instantly in my findings table so I have a clean, searchable record of every document processed.

:thinking: What is the problem?

I can’t get the standard “File Data” input field to appear in the module’s interface. To get around this, I turned on the Map toggle to manually write the JSON structure.

Even though I’ve tried to format the JSON exactly as the API expects, I keep getting this error:

BundleValidationError: Validation failed for 1 parameter(s). Array of objects expected in parameter ‘contents’.

:test_tube: What have you tried so far?

I successfully ran the preceding file download step, so I know I have a valid binary buffer (the yellow “Data” variable).

I removed the double quotes around the Data variable so it stays as raw data rather than a text string.

My current JSON structure looks like this:
[{“role”: “user”, “parts”: [{“fileData”: {“mimeType”: “application/pdf”, “data”: {{data}} }}, {“text”: “Extract details…”}]}].

:camera_with_flash: Screenshots: scenario setup, module configuration, errors






1 Like

Hi @Bakari_Autman ,

From my understanding of your query, it appears that the data field is not being passed into the Gemini module on your end. However, when I tested the same configuration, it worked as expected.

I replicated the setup exactly as you described. Please refer to this configuration and compare it with yours - it may help identify any differences.

If the issue persists, please feel free to reach out with additional details so we can review it further.

With regards,
Mohamed Jahar

1 Like

Thank you for all your help. The yellow data section is the only item that does not match your example. This is the current error.