← All workflows

Workflow

Gemini document inputs, PDF to JSON and batch jobs

Choose inline, Files API or registered Cloud Storage input. Plan page slicing and record checks for PDF extraction and JSONL batches.

Sources checked:

What you can do

Put one document through the right request path and validate the extracted values.

Use inline content for small one-off requests, upload when reusing an asset or when inline limits apply, and use explicit registration for eligible Cloud Storage objects. Test each input as its own request path.

Build your execution checklist

Inputs are processed in this browser only and cleared when you close or refresh the page.

You have a PDF or Office file and need a usable model input reference.

Read the full steps

Inline, uploaded URI or registered GCS URI

You have a PDF or Office file and need a usable model input reference.

  1. Check MIME type, size and whether the selected model or endpoint accepts the type. Read the inline limits for the specific media.
  2. For Files API upload, retain the URI returned by the provider and check readiness if applicable. For an eligible bucket, register the gs:// object using the documented flow and send the returned reference with the request.
  3. Record file revision, byte size, credential scope and reuse deadline. Run a one-page extraction before processing the entire file.

Find an Office page, then inspect the layout

You want a focused extraction from a long Word document or slide deck.

  1. Upload once to a supported Document Interactions model. Use page text as a content layer to locate the target section.
  2. Reuse the provider URI with the documented page options, including start_page and end_page and the appropriate layout-preserving layer. Check a known page number to confirm the boundary.
  3. Record both physical page number and the source’s printed page label where they differ.

PDF to checked invoice JSON

You need stable fields and source pages from an invoice PDF.

  1. Use the downloadable schema specimen with the structured output envelope documented for the current endpoint. Request null for missing values and ask for the physical source page.
  2. Parse the fully completed response and apply the client’s own schema and rules for currencies, totals and page bounds.
  3. Compare the amount and currency to the original document. An HTTP success and a JSON parse are separate from field correctness.
Template preview: invoice-gemini.schema.json
{"type":"object","properties":{"invoice_number":{"type":["string","null"]},"amount_minor":{"type":["integer","null"]},"currency":{"type":["string","null"]},"source_page":{"type":["integer","null"],"minimum":1}},"required":["invoice_number","amount_minor","currency","source_page"],"additionalProperties":false}

Gemini generateContent batch JSONL

You want to process a large non-interactive queue of text requests.

  1. Choose a model that currently supports Batch API. Inline batch requests suit small payloads below the documented size threshold. For larger jobs, generate a JSONL file.
  2. Give each JSONL row a unique key and request object. Keep a key manifest to join results and separate per-row errors from whole-job failures.
  3. Check resulting status and receipts before using a retry file. Put known completed keys in the accepted set and apply a result check before excluding them from retries.
Template preview: gemini-batch-example.jsonl
{"key":"demo-1","request":{"contents":[{"role":"user","parts":[{"text":"Summarize this demo note: The office opens Monday at 9."}]}]}}

Scope & limits

  • Source file limits depend on the transport, model and MIME type. The specimen is synthetic and all extraction needs field review.

Questions & answers

Does GCS input use the same URI as a Files API upload?
Register supported GCS objects through the documented input flow. Use the reference returned by the method that actually imported the file.

Verified sources

Templates are authored by Kunavo. External product behavior depends on the linked sources and your account settings.

Related workflows