AutomationMart
Home/Browse/Email assistant: convert natural language to SQL queries with Phi4-mini and PostgreSQL
n8n

Email assistant: convert natural language to SQL queries with Phi4-mini and PostgreSQL

n8nn8n23 modulesv1.0
UNSUPPORTED_SLUG_FORMAT

Who is this for? πŸ§‘πŸ»πŸ«±πŸ»β€πŸ«²πŸ»πŸ€– Humans and Robots alike. This workflow can be used as a Chat Trigger, as well as a Workflow Trigger. It will take a natural language request, and then generate a SQL query. The resulting query parameter will contain the query, and a sqloutput parameter will contain the results of executing such query. What's the use case? This template is most useful paired with other workflows that extract e-mail information and store it in a structured Postgres table, and use LLMs to

At a glance

Email assistant: convert natural language to SQL queries with Phi4-mini and PostgreSQL is a ready-made n8n workflow you import as a workflow JSON file β€” no build required. It connects UNSUPPORTED_SLUG_FORMAT. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
UNSUPPORTED_SLUG_FORMAT
Modules
23
Price
Free
Version
v1.0
Email assistant: convert natural language to SQL queries with Phi4-mini and PostgreSQL workflow diagram

About this workflow

Who is this for? πŸ§‘πŸ»πŸ«±πŸ»β€πŸ«²πŸ»πŸ€– Humans and Robots alike. This workflow can be used as a Chat Trigger, as well as a Workflow Trigger. It will take a natural language request, and then generate a SQL query. The resulting query parameter will contain the query, and a sqloutput parameter will contain the results of executing such query. What's the use case? This template is most useful paired with other workflows that extract e-mail information and store it in a structured Postgres table, and use LLMs to understand inquiries about information contained in an e-mail inbox and formulate questions that needs answering. Plus, the prompt can be easily adapted to formulate SQL queries over any kind of structured database. Privacy and Economics As LLM provider I'm using Ollama locally, as I consider my e-mail extremely sensitive information. As model, phi4-mini does an excellent job balancing quality and efficiency. Setup Upon running for the first time, this workflow will automatically trigger a sub-section to read all tables and extract their schema into a local file. Then, either by chatting with the workflow in n8n's interface or by using it as a sub-workflow, you will get a query and a sqloutput response. Customizations If you want to work with just one particular table yet keep edits at bay, append a condition to the List all tables in a database step, like so: To repurpose this workflow to work with any other data corpus in a structured database, inspect the AI Agent user and system prompts and edit them accordingly.

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n β†’ click the menu β†’ Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Send email drafts to Google from Anthropic Claude messages

Automatically draft emails in Google from Anthropic Claude messages using a custom webhook. Streamline communication by converting messages into email drafts effortlessly.

Free

Run a SQL stored procedure on a schedule via a logic app

This template allows you to create a Logic App that will run a SQL stored procedure on schedule. Any arguments for the procedure can be put into the body section of the template.

Free

βš‘πŸ“½οΈ Ultimate AI-powered chatbot for YouTube summarization & analysis

YouTube Video AI Agent Workflow This n8n workflow template allows you to interact with an AI agent that extracts details and the transcript of a YouTube video using a provided video ID. Once the details and transcript are retrieved, you can chat with the AI agent to explore or analyze the video's content in a conversational and insightful manner. 🌟 How the Workflow Works 1. πŸ”— Input Video ID: The user provides a YouTube video ID as input to the workflow. 2. πŸ“„ Data Retrieval: The workflow fetche

Free

Bulk email validation and AI scoring with ZeroBounce

ZeroBounce Bulk Email Validation and Scoring This template uses the ZeroBounce node to validate and score email addresses. It is designed to first check if an email is deliverable and then uses A.I. Scoring to assess the sender's deliverability confidence. This is an example template to demonstrate ways to use the ZeroBounce node and how to manipulate the data with core n8n nodes. A ZeroBounce API key is needed to use this template. Generate one here. 1. Email Validation The Validate email node

Free

Google maps scraper

This workflow allows to scrape Google Maps data in an efficient way using SerpAPI. You'll get all data from Gmaps at a cheaper cost than Google Maps API. Add as input, your Google Maps search URL and you'll get a list of places with many data points such as: - phone number - website - rating - reviews - address And much more. Full guide to implement the workflow is here:

Free

Aws cost & usage report management for AI agents

Complete MCP server exposing 4 AWS Cost and Usage Report Service API operations to AI agents. ⚑ Quick Setup Need help? Want access to more workflows and even live Q&A sessions with a top verified n8n creator.. All 100% free? Join the community 1. Import this workflow into your n8n instance 2. Credentials Add AWS Cost and Usage Report Service credentials 3. Activate the workflow to start your MCP server 4. Copy the webhook URL from the MCP trigger node 5. Connect AI agents using the MCP URL πŸ”§ How

Free

Automate multilingual Slack communication (JA ⇄ EN) with Gemini 2.5 Flash

How it works This workflow automatically translates messages between Japanese and English inside Slack β€” perfect for mixed-language teams. In our real-world use case, our 8-person team includes Arif, an English-speaking teammate from Indonesia, while the rest mainly speak Japanese. Before using this workflow, our daily chat often included: - β€œCan someone translate this for Arif?” - β€œI don’t understand what Arif wrote β€” can someone summarize it in Japanese?” - β€œI need to post this announcem

Free

Evaluate tool usage accuracy in multi-agent AI workflows using evaluation nodes

Who's it for ------------ This workflow is ideal for AI developers running multi-agent systems in n8n who need to quantitatively evaluate tool usage behavior. If you're building autonomous agents and want to verify their decisions against ground-truth expectations, this workflow gives you plug-and-play observability. What it does ------------ This template uses n8n's built-in Evaluation Trigger and Evaluation nodes to assess whether an AI agent correctly used all the expected tools. It suppor

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint β€” instant download
  • Setup guide PDF included
  • 5 downloads Β· valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

β‚Ή2,499/ session
3 hrs Β· video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free