Create a high-performance semantic search index for Brazilian medical procedures (TUSS) using this automated n8n workflow. Leverages Google Gemini embeddings and PGVector for RAG.
Download this n8n workflow template and start using it instantly.
Healthcare IT professionals managing large regulatory databases (like TUSS).
Data engineers requiring robust ETL pipelines for vector database ingestion.
Developers building Retrieval-Augmented Generation (RAG) systems for medical queries.
Users seeking powerful, customizable n8n templates for advanced database operations.
Handling vast tables of regulatory medical codes, such as the TUSS (Terminologia Unificada da Saúde Suplementar), is essential for many healthcare systems. Traditional searching using exact keywords often fails to capture the true intent behind a user's query. This sophisticated n8n workflow solves this by creating a semantic search index. It automates the entire vectorization process, extracting codes and descriptions from an Oracle database, utilizing the Google Gemini embedding model to generate high-quality vectors, and storing these vectors reliably in a PostgreSQL database using the PGVector extension. This entire n8n workflow acts as a powerful data ingestion engine, providing the foundation for highly accurate and context-aware medical knowledge retrieval.
This efficient n8n workflow begins with the VECTORIZE TUSS TABLE n8n trigger, configured as a manual execution point.
ORACLE DATABASE CONNECTION n8n node, which executes a custom query to fetch the CDITEM (code) and DSITEM (description) for all relevant medical procedures.COLLECTION OF MEDICAL PROCEDURES Code n8n node processes the Oracle output, extracting the array of rows for iterative processing.FOR - MEDICAL PROCEDURES n8n node (Split In Batches) ensures that data is processed item by item, managing resource usage and ensuring robustness during the high-load embedding process.Data Loader n8n node formats each procedure into a document, combining the code and description into a structured text string. Crucially, it attaches the original cd_item and procedureName as metadata, vital for lookup after semantic search.Embeddings Google Gemini n8n node takes the prepared text and generates a vector embedding. The n8n node uses the specified Gemini credentials to connect to the Google service.Postgres PGVector Store2 n8n node performs the insertion. This LangChain-based n8n node receives both the document data and the vector embedding, seamlessly inserting them into the configured PostgreSQL table, completing this complex n8n workflow. The presence of the Token Splitter n8n node shows the capability to handle larger documents by chunking them before embedding, though the main flow is optimized for the current structure.To deploy this powerful n8n workflow, follow these steps:
ORACLE DATABASE CONNECTION n8n node with your specific connection details (credentials named 'PROTHEUS - PRODUÇÃO (APPN8N)' in the template).Embeddings Google Gemini n8n node using your Google Palm API key (credentials named 'GEMINI - PRODUÇÃO' in the template).Postgres PGVector Store2 n8n node, ensuring your connection points to a PostgreSQL instance with the PGVector extension enabled.ORACLE DATABASE CONNECTION query parameter to reflect your actual TUSS table name ({sua tabela aqui }).Postgres PGVector Store2 n8n node's table name parameter ({yourtablename_here}) to match your target vector table structure. This ensures the n8n template functions correctly. VECTORIZE TUSS TABLE (Manual Trigger): Serves as the starting point, initiating the entire data extraction and vectorization sequence of this n8n workflow.
ORACLE DATABASE CONNECTION (Oracle Database with Parameterization):
Function: Connects to the Oracle database to extract raw TUSS procedure codes and descriptions.
Key Configuration: Query configured to SELECT CDITEM, DSITEM FROM {sua tabela aqui }.
COLLECTION OF MEDICAL PROCEDURES (Code n8n node):
Function: Extracts the result set (rows) from the Oracle query output, preparing the list for iteration.
FOR - MEDICAL PROCEDURES (Split In Batches n8n node):
Function: Iterates over the list of procedures, ensuring each item is processed individually.
Data Loader (Document Default Data Loader n8n node):
Function: Formats the procedure data into a LangChain document structure.
Key Configuration: Text data includes both code and description, with metadata fields cditem and procedureName dynamically set using expressions.
Embeddings Google Gemini (Embeddings Google Gemini n8n node):
Function: Interacts with the Google Gemini API to transform the textual procedure descriptions into dense vector representations.
Postgres PGVector Store2 (PGVector Store n8n node):
Function: The final action in this n8n workflow, responsible for inserting the generated vectors and their corresponding documents into the PGVector table for semantic search.
Key Configuration: Uses the insert mode and targets a user-defined table ({yourtablenamehere}).
Use this powerful n8n workflow to automatically search for configuration files in Google Drive, validate them using a LangChain AI Agent powered by Azure OpenAI, and log all validation results into Google Sheets.

Validate email addresses in your Airtable database automatically using this robust n8n workflow. Ensure data hygiene and update records efficiently with the Mailcheck n8n node.

Use this powerful n8n workflow to automatically validate new Mautic contacts. Prevent spam and ensure data quality by checking for disposable emails and poor deliverability via OneSimpleAPI, sending real-time alerts to Slack.

Secure your certificate lifecycle management using this advanced n8n workflow. Automate Certificate Signing Request (CSR) generation via Venafi, conduct real-time domain scanning with VirusTotal, and utilize OpenAI for instant risk assessment—all controlled directly from Slack.

Build high-quality ad scripts automatically using this multi-step n8n workflow. It uses an n8n trigger (form submission), chains multiple OpenAI nodes, and stores the final copy in Google Docs.


Building Custom Automations with n8n | Node.js Developer | Integration Specialist | Open Source Contributor If you need help with n8n workflows, API integrations, or custom nodes, feel free to connect on LinkedIn: http://linkedin.com/in/thiago-vazzoler-loureiro-24056227







































