How to Summarize Documents with Gemini in a Jinba Workflow
Summary
- For PDFs, images, audio, or video, use
GEMINI_INVOKE_WITH_FILE; for plain text already extracted, useGEMINI_INVOKE. - Keep the Gemini API key in an encrypted secret manager and reference it as
{{secrets.GEMINI_API_KEY}}— never hardcode it. - Chain the summary output to Slack, Google Sheets, or a case log using
{{steps.summarize_document.result.text}}. - Credit tiers run from 100 monthly on Free to unlimited on Enterprise, but BYOK routes high-volume Gemini billing directly to Google Cloud.
- Jinba Flow brings the trigger, Gemini tool, secret management, downstream connectors, audit logging, and SOC 2 controls together in one workflow builder.
Condensing a 40-page technical report into a readable briefing is not a writing task. It is a pipeline problem. The document has to be ingested, understood, summarised, and delivered to the right place, reliably, every time. Doing that manually at scale is not sustainable. Doing it with a script that calls an API directly leaves credential management, error handling, and downstream delivery as unsolved problems.
This guide covers how to build a complete google gemini workflow automation inside Jinba: from securing your API key, through choosing the correct Gemini tool based on input type, to chaining the summary output to Slack, Google Sheets, or a case log.
Choose the Right Gemini Tool Before You Build
Jinba exposes two distinct tools for Gemini. The choice between them is determined by input type, not preference.
GEMINI_INVOKEaccepts plain text. Use it when the content has already been extracted and passed as a string.GEMINI_INVOKE_WITH_FILEaccepts a file URL and passes the file directly to Gemini's multimodal API. Use it for PDFs, images, audio, and video.
The distinction matters because GEMINI_INVOKE_WITH_FILE does not perform OCR before sending the file. Gemini receives the document natively and applies vision-level understanding to layout, tables, embedded images, and text simultaneously. For image-heavy PDFs, this also means Gemini can generate descriptive metadata for visual content, which is useful for downstream retrieval-augmented generation (RAG) pipelines.
For deterministic, rule-based text extraction across thousands of long documents where accuracy is the priority and AI interpretation is not required, Jinba also provides separate Document Processing and Extract from File tools. These are the right layer for hybrid systems that use structured extraction for ingestion and Gemini for summarisation.

Secure the Gemini API Key First
Every Gemini tool invocation in Jinba requires a credential. The key is never hardcoded into the workflow YAML. It is stored in Jinba's secret manager and referenced at runtime via a placeholder.
Jinba's credential documentation supports two paths for obtaining a Gemini API key:
- Google AI Studio (recommended): the key begins with
AIza. - Google Cloud Console: enable the Gemini API, then create a service credential.
Once you have the key, store it in Jinba using this path:
- Go to Workspace Settings.
- Select Secret.
- Choose Gemini.
- Click Configure or Add New.
- Paste the API key and click Save.
The key is then available inside any workflow as {{secrets.GEMINI_API_KEY}}. At runtime, Jinba fetches it from a dedicated secret manager (AWS Secrets Manager, GCP Secret Manager, or Azure Key Vault depending on your deployment). The key is never baked into container images or workflow definitions. As the security documentation states, treat keys as sensitive and never commit them to public repositories.
Build the Summarisation Workflow
Start with a Trigger
Every Jinba workflow begins with a trigger. For document summarisation, two triggers are appropriate:
- Scheduled trigger: runs the workflow on a set cadence, for example processing all reports added to a folder each morning.
- File Input trigger: fires when a user uploads a file directly, or when the workflow fetches a file from a URL on demand.
Advanced Input Tools extend this further, enabling workflows to start from a webhook or a Slack event. This covers the common pattern of a team member posting a document link in Slack and receiving a summary in reply.
Configure GEMINI_INVOKE_WITH_FILE
The step below assumes the trigger is a File Input step with the ID input_file. The file_url field uses Jinba's Jinja2 templating syntax to pull the file location from that step's result.
- id: summarize_document
tool: GEMINI_INVOKE_WITH_FILE
params:
prompt: >-
Summarize the following document into a concise list of key takeaways.
Focus on the main conclusions and any actionable items.
The summary should be no more than 200 words.
file_url: "{{steps.input_file.result.file_url}}"
credential: "{{secrets.GEMINI_API_KEY}}"
Three parameters define the step:
prompt: The instruction Gemini receives alongside the document. A specific, constrained prompt consistently produces tighter output. Setting a word limit and requesting bullet-point structure avoids the verbosity that emerges from open-ended prompts.file_url: The expression{{steps.input_file.result.file_url}}pulls the file location from the preceding trigger step. This is the hand-off mechanism that connects ingestion to analysis without any manual data passing.credential: The expression{{secrets.GEMINI_API_KEY}}injects the API key at runtime from the secret manager.
For plain text inputs, replace GEMINI_INVOKE_WITH_FILE with GEMINI_INVOKE and substitute file_url with a text parameter containing the extracted content.
Chain the Summary to a Downstream Step
Once summarize_document completes, its output is available to every subsequent step as {{steps.summarize_document.result.text}}. This is the same templating pattern used for the file hand-off, and it applies to any downstream tool Jinba supports.
Slack notification: Add a Slack tool step after the Gemini step. Set the message body to:
New Document Summary:
{{steps.summarize_document.result.text}}
This resolves the common friction of Slack integrations: the output arrives in the channel automatically, without any manual copy-paste or separate API call.
Google Sheets log: Add a Sheets "append row" tool. Map the columns to {{steps.input_file.result.filename}}, {{steps.summarize_document.result.text}}, and the workflow's execution timestamp. Each run appends one row, building a searchable summary archive over time.
Case log or database: For teams managing document review queues, the summary can be written directly to a database record. The same templating syntax applies regardless of the target system.
A reference architecture from Jinba's SOC 2 workflow documentation follows this pattern: trigger, AI step, conditional logic, approval gate, Slack notification, processing step, and a comprehensive audit log written to a database. Document summarisation workflows follow the same chain, with the Gemini step producing the content that flows into each subsequent action.

Governance, Security, and Cost
Audit Logging
Every execution of a Jinba workflow is logged. The SOC 2 documentation confirms that Jinba provides detailed audit logs covering who built each workflow, who ran it, and what data was processed. Usage is tracked per workflow, per tool, and per user on a dedicated usage page, which gives teams per-invocation accountability without building a separate logging layer.
Logs are retained for a minimum of six months. Operational and audit logs from every container are written to CloudWatch, where they are available for review and alerting, as detailed in the security documentation.
Security Architecture
Jinba holds SOC 2 Type 2 certification. Network traffic is protected by TLS with IDS/IPS monitoring. User data is isolated through virtualisation, and private network deployments are supported on AWS, GCP, and Azure. For teams with data residency requirements, the private deployment option keeps all processing within a defined network boundary.
Credit Costs and BYOK
Jinba's credit cost documentation defines two billing models for Gemini tool invocations:
- Jinba Credits: drawn from the organisation's pooled credit allocation. Subscription tiers run from Free (100 credits per month) through Standard (800 per month) and Professional (10,000 per month) to Enterprise (unlimited). Token estimates are dynamically priced against these credits.
- Bring Your Own Key (BYOK): the workflow uses the API key stored in your Gemini credential. Invocations under BYOK do not consume Jinba credits. Billing flows directly to your Google account.
BYOK is the appropriate model for teams running high-volume summarisation pipelines, or for organisations that need to keep AI spend consolidated under a single Google Cloud billing account. It also gives operators direct visibility into per-model usage through Google's own cost reporting.
What to Configure Next
The workflow described here covers the core path: trigger, GEMINI_INVOKE_WITH_FILE, summary output, downstream delivery. Once that is running, the next configurations to consider are:
- Conditional routing: add a condition step after the Gemini step to route the summary to different destinations depending on document type, file size, or a keyword in the output.
- Prompt versioning: as prompts are refined, track changes in a version-controlled configuration rather than editing the live workflow directly.
- Cost monitoring: if running under Jinba credits, set usage alerts on the usage page. If running under BYOK, configure budget alerts in Google Cloud Console.
- Image metadata extraction: for image-heavy PDFs that feed a RAG pipeline, extend the prompt to request descriptive metadata for visual elements alongside the summary.
Build the trigger and the Gemini step first. Confirm the output is structured correctly before adding downstream tools. Each additional step in the chain depends on a clean, consistent output from summarize_document, so validating that step in isolation saves time when the full workflow is assembled.
Frequently Asked Questions
What is Jinba Gemini workflow automation?
Jinba Gemini workflow automation is a way to connect Google Gemini's multimodal AI capabilities to document pipelines inside Jinba. It uses triggers, tool steps like GEMINI_INVOKE and GEMINI_INVOKE_WITH_FILE, and downstream actions to ingest, summarise, and deliver content without manual API scripting.
How do I choose between GEMINI_INVOKE and GEMINI_INVOKE_WITH_FILE?
Choose GEMINI_INVOKE when the content is already available as plain text. Choose GEMINI_INVOKE_WITH_FILE when you need to send a PDF, image, audio, or video file directly to Gemini's multimodal API. The file-based tool does not perform OCR first, so it is the right choice for layout-heavy documents that benefit from native vision understanding.
How do I pass a file to GEMINI_INVOKE_WITH_FILE in Jinba?
Use the file_url parameter with Jinja2 templating. For a File Input trigger with the step ID input_file, set file_url: "{{steps.input_file.result.file_url}}". Jinba resolves this expression at runtime and passes the file location to Gemini without hardcoding credentials or file paths.
What file types does GEMINI_INVOKE_WITH_FILE support?
GEMINI_INVOKE_WITH_FILE supports the same file types as Gemini's multimodal API, including PDFs, images, audio, and video. Jinba passes the file directly, so the supported types are determined by Gemini's current API capabilities. For deterministic text extraction from long documents, use Jinba's separate Document Processing or Extract from File tools.
How do I send a Gemini summary to Slack or Google Sheets?
After the Gemini step completes, reference its output as {{steps.summarize_document.result.text}} in a downstream tool. For Slack, add a Slack step and set the message body to include that expression. For Google Sheets, add an append row step and map columns to the summary text, file name, and execution timestamp.
What is the difference between Jinba Credits and BYOK for Gemini?
Jinba Credits are pooled from your Jinba subscription and are consumed when Gemini tools run with the credential stored in Jinba's secret manager. BYOK, or Bring Your Own Key, uses your existing Gemini API key and routes billing directly to your Google account rather than consuming Jinba credits. BYOK is recommended for high-volume pipelines and consolidated Google Cloud billing.
How does Jinba secure my Gemini API key?
Jinba stores Gemini API keys in an encrypted secret manager and references them at runtime with {{secrets.GEMINI_API_KEY}}. The key is never hardcoded into workflow YAML or container images. Jinba also maintains SOC 2 Type 2 certification, TLS encryption, and virtualisation-based data isolation.
Can I run a Jinba Gemini workflow on a schedule?
Yes, Jinba supports scheduled triggers. You can configure a workflow to run on a set cadence, such as processing all new files in a folder each morning. You can also use File Input triggers for on-demand uploads or Advanced Input Tools to start a workflow from a webhook or Slack event.