workflows.fit
Back to n8n workflows
n8n templateFreeBy Alfonso Corretti

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

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 resulti...

DevelopmentData & StorageAILangchainCore NodesSetConvert To FileRead Write File
Loading interactive preview...

Template notes

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