Back to Catalog

Dynamic AI model selector with GDPR compliance via Requesty and Google Sheets

StefanStefan
865 views
2/3/2026
Official Page

Overview

This comprehensive n8n workflow provides a sophisticated solution for dynamically selecting and using AI models while maintaining GDPR compliance. It leverages Requesty's European-based AI routing service to ensure data privacy and automatically updates available model options based on real-time API availability.

Choose Your Integration Approach

Before diving into the setup, it's crucial to understand that this workflow offers two completely independent AI integration approaches:

Approach 1: Dynamic HTTP Request Workflow (Advanced)

Complete infrastructure with dynamic model selection

What it includes:

  • Automatic model discovery from Requesty's API
  • Dynamic dropdown updates in web forms
  • Model selection persistence in Google Sheets
  • Complex workflow orchestration with multiple phases
  • Full control over API parameters and response handling

Best for:

  • Teams needing multiple AI models for different tasks
  • Organizations requiring model usage auditing
  • Users who want maximum flexibility and control
  • Advanced n8n users comfortable with complex workflows

Setup complexity: High (requires multiple components and configurations)

Approach 2: Standalone AI Agent (Simple)

Plug-and-play solution without complexity

What it includes:

  • Direct use of n8n's native OpenAI Chat Model node
  • Simple configuration: just set base URL to https://router.requesty.ai/v1
  • Immediate GDPR compliance through European infrastructure
  • No model discovery or selection infrastructure needed

Best for:

  • Users wanting quick GDPR-compliant AI integration
  • Single-model use cases
  • Simple chat interfaces
  • Users preferring minimal configuration

Setup complexity: Low (5-minute setup)


Quick Start: Approach 2 (Simple AI Agent)

If you want to get started quickly with GDPR-compliant AI, follow these steps:

Step 1: Register with Requesty

  1. Visit https://www.requesty.ai
  2. Complete the registration process
  3. Choose "OpenAI-compatible" integration
  4. Note your API endpoint: https://router.requesty.ai/v1
  5. Create an API key (name it "n8n Integration")

Step 2: Configure n8n

  1. Add a new OpenAI credential in n8n
  2. Set the base URL to: https://router.requesty.ai/v1
  3. Enter your Requesty API key
  4. Add an OpenAI Chat Model node to your workflow
  5. Select your Requesty credential

Step 3: Test

Your AI agent is now ready and GDPR-compliant! All requests will be routed through Requesty's European infrastructure.


Advanced Setup: Approach 1 (Dynamic HTTP Workflow)

For users who need dynamic model selection and advanced features, follow this comprehensive setup:

Prerequisites

  • n8n instance (self-hosted or cloud)
  • Requesty API credentials
  • Google Sheets integration
  • Basic understanding of n8n workflows

Phase 1: Requesty Account Setup

1.1 Registration Process

  1. Navigate to https://www.requesty.ai
  2. Sign up with your email address
  3. Complete the welcome process

1.2 Integration Configuration

  1. Choose Integration Type: Select "OpenAI-compatible"
  2. Note API Endpoint: https://router.requesty.ai/v1
  3. Create API Key:
    • Provide a descriptive name (e.g., "n8n Dynamic Workflow")
    • Click "Create API Key"
    • Important: Save this key securely - you'll need it for n8n configuration

Phase 2: Google Sheets Preparation

2.1 Create Storage Sheet

  1. Create a new Google Sheet named "AI Model Selections"
  2. Add the following column:
    • A1: "Selected Model"
  3. Note the Google Sheet ID from the URL

2.2 Configure Google Sheets API

  1. Enable Google Sheets API in Google Cloud Console
  2. Create service account credentials
  3. Share your sheet with the service account email
  4. Download the credentials JSON file

Phase 3: n8n Workflow Configuration

3.1 Import Workflow

  1. Download the workflow JSON file
  2. Import into your n8n instance
  3. Review all nodes and connections

3.2 Configure Credentials

Requesty API Credentials:

  1. Go to n8n Credentials section
  2. Create new HTTP Request credential
  3. Set authentication type to "Header Auth"
  4. Header name: "Authorization"
  5. Header value: "Bearer YOUR_REQUESTY_API_KEY"

Google Sheets Credentials:

  1. Create new Google Sheets credential
  2. Upload your service account JSON file
  3. Test the connection

Google Sheets Nodes:

  • Update sheet ID in all Google Sheets nodes
  • Verify column mappings match your sheet structure

Phase 4: Troubleshooting Guide

Common Issues and Solutions

Models Not Loading:

  • Verify Requesty API credentials
  • Check network connectivity and API endpoint URL

Selection Not Persisting:

  • Verify Google Sheets credentials and write permissions
  • Check sheet ID configuration

Chat Not Responding:

  • Verify selected model availability
  • Check API request formatting and response processing

Debug Procedures

  1. Enable debug mode and detailed logging
  2. Check node outputs and data flow
  3. Validate API calls with external tools
  4. Review n8n execution logs

Conclusion

The choice between approaches depends on your specific requirements:

  • Simple AI Agent: Perfect for straightforward AI integration with minimal setup
  • Dynamic HTTP Workflow: Ideal for complex requirements with multiple models and advanced features

Dynamic AI Model Selector with GDPR Compliance via Requesty and Google Sheets

This n8n workflow provides a robust solution for dynamically selecting AI models based on user input and ensuring GDPR compliance by checking user consent stored in Google Sheets. It leverages an n8n Form Trigger to receive user requests, queries a Google Sheet for consent, and then uses an AI Agent (powered by OpenAI Chat Model) to process the request.

What it does

  1. Listens for User Requests: The workflow is triggered by submissions to an n8n Form, allowing users to input their AI model requests.
  2. Extracts User ID: It extracts a unique user ID from the incoming form data.
  3. Checks GDPR Consent: It queries a Google Sheet to determine if the user has provided GDPR consent.
  4. Dynamically Sets AI Model: Based on the GDPR consent status, it dynamically sets the AI model to be used. If consent is given, it might use a more advanced model; otherwise, it defaults to a compliant model or handles the request appropriately.
  5. Processes Request with AI Agent: An AI Agent, configured with an OpenAI Chat Model, processes the user's request, taking into account the dynamically selected model.
  6. Merges Data: It merges the original form data with the AI agent's response.
  7. Sends HTTP Request (Requesty): It sends an HTTP request, likely to a service like Requesty, to handle the final output or further processing, potentially for GDPR-compliant data handling or response delivery.

Prerequisites/Requirements

  • n8n Instance: A running n8n instance.
  • Google Sheets Account: A Google Sheets account with a spreadsheet configured to store user GDPR consent information (e.g., a column for User ID and a column for consent status).
  • OpenAI API Key: An OpenAI API key for the AI Agent node.
  • Requesty Account/Endpoint: Access to a Requesty endpoint or a similar service that can receive HTTP requests for further processing or response delivery.
  • n8n Form: An n8n Form configured to capture user input, including a user ID.

Setup/Usage

  1. Import the Workflow: Import the provided JSON into your n8n instance.
  2. Configure Credentials:
    • Google Sheets: Set up your Google Sheets credentials. Ensure the sheet containing GDPR consent information is accessible and correctly referenced in the "Google Sheets" node.
    • OpenAI: Configure your OpenAI credentials for the "OpenAI Chat Model" node.
    • HTTP Request: Configure the "HTTP Request" node with the appropriate URL and authentication for your Requesty (or similar) endpoint.
  3. Configure n8n Form Trigger:
    • Ensure the "n8n Form Trigger" node is active and configured to receive the necessary user input, including a field for the User ID.
  4. Customize Logic (Optional):
    • Review the "Edit Fields (Set)" node to understand how the AI model is dynamically selected based on GDPR consent. Adjust the logic as needed for your specific use case and available AI models.
    • Modify the "Code" node if custom JavaScript logic is required for data transformation or conditional processing.
  5. Activate the Workflow: Once all credentials and configurations are set, activate the workflow.

This workflow provides a flexible framework for building AI-powered applications that respect user privacy and data regulations.

Related Templates

Two-way property repair management system with Google Sheets & Drive

This workflow automates the repair request process between tenants and building managers, keeping all updates organized in a single spreadsheet. It is composed of two coordinated workflows, as two separate triggers are required — one for new repair submissions and another for repair updates. A Unique Unit ID that corresponds to individual units is attributed to each request, and timestamps are used to coordinate repair updates with specific requests. General use cases include: Property managers who manage multiple buildings or units. Building owners looking to centralize tenant repair communication. Automation builders who want to learn multi-trigger workflow design in n8n. --- ⚙️ How It Works Workflow 1 – New Repair Requests Behind the Scenes: A tenant fills out a Google Form (“Repair Request Form”), which automatically adds a new row to a linked Google Sheet. Steps: Trigger: Google Sheets rowAdded – runs when a new form entry appears. Extract & Format: Collects all relevant form data (address, unit, urgency, contacts). Generate Unit ID: Creates a standardized identifier (e.g., BUILDING-UNIT) for tracking. Email Notification: Sends the building manager a formatted email summarizing the repair details and including a link to a Repair Update Form (which activates Workflow 2). --- Workflow 2 – Repair Updates Behind the Scenes:\ Triggered when the building manager submits a follow-up form (“Repair Update Form”). Steps: Lookup by UUID: Uses the Unit ID from Workflow 1 to find the existing row in the Google Sheet. Conditional Logic: If photos are uploaded: Saves each image to a Google Drive folder, renames files consistently, and adds URLs to the sheet. If no photos: Skips the upload step and processes textual updates only. Merge & Update: Combines new data with existing repair info in the same spreadsheet row — enabling a full repair history in one place. --- 🧩 Requirements Google Account (for Forms, Sheets, and Drive) Gmail/email node connected for sending notifications n8n credentials configured for Google API access --- ⚡ Setup Instructions (see more detail in workflow) Import both workflows into n8n, then copy one into a second workflow. Change manual trigger in workflow 2 to a n8n Form node. Connect Google credentials to all nodes. Update spreadsheet and folder IDs in the corresponding nodes. Customize email text, sender name, and form links for your organization. Test each workflow with a sample repair request and a repair update submission. --- 🛠️ Customization Ideas Add Slack or Telegram notifications for urgent repairs. Auto-create folders per building or unit for photo uploads. Generate monthly repair summaries using Google Sheets triggers. Add an AI node to create summaries/extract relevant repair data from repair request that include long submissions.

Matt@VeraisonLabsBy Matt@VeraisonLabs
208

Automate invoice processing with OCR, GPT-4 & Salesforce opportunity creation

PDF Invoice Extractor (AI) End-to-end pipeline: Watch Drive ➜ Download PDF ➜ OCR text ➜ AI normalize to JSON ➜ Upsert Buyer (Account) ➜ Create Opportunity ➜ Map Products ➜ Create OLI via Composite API ➜ Archive to OneDrive. --- Node by node (what it does & key setup) 1) Google Drive Trigger Purpose: Fire when a new file appears in a specific Google Drive folder. Key settings: Event: fileCreated Folder ID: google drive folder id Polling: everyMinute Creds: googleDriveOAuth2Api Output: Metadata { id, name, ... } for the new file. --- 2) Download File From Google Purpose: Get the file binary for processing and archiving. Key settings: Operation: download File ID: ={{ $json.id }} Creds: googleDriveOAuth2Api Output: Binary (default key: data) and original metadata. --- 3) Extract from File Purpose: Extract text from PDF (OCR as needed) for AI parsing. Key settings: Operation: pdf OCR: enable for scanned PDFs (in options) Output: JSON with OCR text at {{ $json.text }}. --- 4) Message a model (AI JSON Extractor) Purpose: Convert OCR text into strict normalized JSON array (invoice schema). Key settings: Node: @n8n/n8n-nodes-langchain.openAi Model: gpt-4.1 (or gpt-4.1-mini) Message role: system (the strict prompt; references {{ $json.text }}) jsonOutput: true Creds: openAiApi Output (per item): $.message.content → the parsed JSON (ensure it’s an array). --- 5) Create or update an account (Salesforce) Purpose: Upsert Buyer as Account using an external ID. Key settings: Resource: account Operation: upsert External Id Field: taxid_c External Id Value: ={{ $json.message.content.buyer.tax_id }} Name: ={{ $json.message.content.buyer.name }} Creds: salesforceOAuth2Api Output: Account record (captures Id) for downstream Opportunity. --- 6) Create an opportunity (Salesforce) Purpose: Create Opportunity linked to the Buyer (Account). Key settings: Resource: opportunity Name: ={{ $('Message a model').item.json.message.content.invoice.code }} Close Date: ={{ $('Message a model').item.json.message.content.invoice.issue_date }} Stage: Closed Won Amount: ={{ $('Message a model').item.json.message.content.summary.grand_total }} AccountId: ={{ $json.id }} (from Upsert Account output) Creds: salesforceOAuth2Api Output: Opportunity Id for OLI creation. --- 7) Build SOQL (Code / JS) Purpose: Collect unique product codes from AI JSON and build a SOQL query for PricebookEntry by Pricebook2Id. Key settings: pricebook2Id (hardcoded in script): e.g., 01sxxxxxxxxxxxxxxx Source lines: $('Message a model').first().json.message.content.products Output: { soql, codes } --- 8) Query PricebookEntries (Salesforce) Purpose: Fetch PricebookEntry.Id for each Product2.ProductCode. Key settings: Resource: search Query: ={{ $json.soql }} Creds: salesforceOAuth2Api Output: Items with Id, Product2.ProductCode (used for mapping). --- 9) Code in JavaScript (Build OLI payloads) Purpose: Join lines with PBE results and Opportunity Id ➜ build OpportunityLineItem payloads. Inputs: OpportunityId: ={{ $('Create an opportunity').first().json.id }} Lines: ={{ $('Message a model').first().json.message.content.products }} PBE rows: from previous node items Output: { body: { allOrNone:false, records:[{ OpportunityLineItem... }] } } Notes: Converts discount_total ➜ per-unit if needed (currently commented for standard pricing). Throws on missing PBE mapping or empty lines. --- 10) Create Opportunity Line Items (HTTP Request) Purpose: Bulk create OLIs via Salesforce Composite API. Key settings: Method: POST URL: https://<your-instance>.my.salesforce.com/services/data/v65.0/composite/sobjects Auth: salesforceOAuth2Api (predefined credential) Body (JSON): ={{ $json.body }} Output: Composite API results (per-record statuses). --- 11) Update File to One Drive Purpose: Archive the original PDF in OneDrive. Key settings: Operation: upload File Name: ={{ $json.name }} Parent Folder ID: onedrive folder id Binary Data: true (from the Download node) Creds: microsoftOneDriveOAuth2Api Output: Uploaded file metadata. --- Data flow (wiring) Google Drive Trigger → Download File From Google Download File From Google → Extract from File → Update File to One Drive Extract from File → Message a model Message a model → Create or update an account Create or update an account → Create an opportunity Create an opportunity → Build SOQL Build SOQL → Query PricebookEntries Query PricebookEntries → Code in JavaScript Code in JavaScript → Create Opportunity Line Items --- Quick setup checklist 🔐 Credentials: Connect Google Drive, OneDrive, Salesforce, OpenAI. 📂 IDs: Drive Folder ID (watch) OneDrive Parent Folder ID (archive) Salesforce Pricebook2Id (in the JS SOQL builder) 🧠 AI Prompt: Use the strict system prompt; jsonOutput = true. 🧾 Field mappings: Buyer tax id/name → Account upsert fields Invoice code/date/amount → Opportunity fields Product name must equal your Product2.ProductCode in SF. ✅ Test: Drop a sample PDF → verify: AI returns array JSON only Account/Opportunity created OLI records created PDF archived to OneDrive --- Notes & best practices If PDFs are scans, enable OCR in Extract from File. If AI returns non-JSON, keep “Return only a JSON array” as the last line of the prompt and keep jsonOutput enabled. Consider adding validation on parsing.warnings to gate Salesforce writes. For discounts/taxes in OLI: Standard OLI fields don’t support per-line discount amounts directly; model them in UnitPrice or custom fields. Replace the Composite API URL with your org’s domain or use the Salesforce node’s Bulk Upsert for simplicity.

Le NguyenBy Le Nguyen
942

Auto-reply & create Linear tickets from Gmail with GPT-5, gotoHuman & human review

This workflow automatically classifies every new email from your linked mailbox, drafts a personalized reply, and creates Linear tickets for bugs or feature requests. It uses a human-in-the-loop with gotoHuman and continuously improves itself by learning from approved examples. How it works The workflow triggers on every new email from your linked mailbox. Self-learning Email Classifier: an AI model categorizes the email into defined categories (e.g., Bug Report, Feature Request, Sales Opportunity, etc.). It fetches previously approved classification examples from gotoHuman to refine decisions. Self-learning Email Writer: the AI drafts a reply to the email. It learns over time by using previously approved replies from gotoHuman, with per-classification context to tailor tone and style (e.g., different style for sales vs. bug reports). Human Review in gotoHuman: review the classification and the drafted reply. Drafts can be edited or retried. Approved values are used to train the self-learning agents. Send approved Reply: the approved response is sent as a reply to the email thread. Create ticket: if the classification is Bug or Feature Request, a ticket is created by another AI agent in Linear. Human Review in gotoHuman: How to set up Most importantly, install the gotoHuman node before importing this template! (Just add the node to a blank canvas before importing) Set up credentials for gotoHuman, OpenAI, your email provider (e.g. Gmail), and Linear. In gotoHuman, select and create the pre-built review template "Support email agent" or import the ID: 6fzuCJlFYJtlu9mGYcVT. Select this template in the gotoHuman node. In the "gotoHuman: Fetch approved examples" http nodes you need to add your formId. It is the ID of the review template that you just created/imported in gotoHuman. Requirements gotoHuman (human supervision, memory for self-learning) OpenAI (classification, drafting) Gmail or your preferred email provider (for email trigger+replies) Linear (ticketing) How to customize Expand or refine the categories used by the classifier. Update the prompt to reflect your own taxonomy. Filter fetched training data from gotoHuman by reviewer so the writer adapts to their personalized tone and preferences. Add more context to the AI email writer (calendar events, FAQs, product docs) to improve reply quality.

gotoHumanBy gotoHuman
353