Data & Databases

Analyze queries and store AI responses in databases

12 nodes 326 137 Automatic trigger
Download

Workflow Description

An automation that receives inquiries through a chat interface, processes them with OpenAI, and automatically stores results in PostgreSQL and MySQL databases while maintaining conversation history to enhance context and response quality.

How it works

  1. 1.Trigger the workflow when a new user inquiry arrives
  2. 2.Process the text through OpenAI's language model using previous conversation history
  3. 3.Apply conditional logic to route responses to the appropriate database
  4. 4.Save the inquiry and response to PostgreSQL for reference and audit
  5. 5.Log data in MySQL for analytics and pattern detection
  6. 6.Send an HTTP request to external systems if additional actions are needed

Use cases

  • Intelligent customer service platform that archives every conversation for retrieval and coaching
  • Data analyst system that collects user insights and automatically categorizes issues by frequency
  • Technical support automation that provides instant answers while tracking recurring problems

Requirements

  • Valid OpenAI API key with sufficient usage quota
  • PostgreSQL and MySQL connection credentials configured securely
  • Pre-defined conversation model or prompt template in OpenAI

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

OpenAI Chat Trigger Postgres MySQL HTTP Request

Details

Trigger Automatic trigger
Nodes 12
Apps 5
Views 326
Downloads 137

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (12)

/

If

If

#1

Edit Fields1

Set

#2

Edit Fields2

Set

#3

OpenAI

OpenAI

#4

Chat Trigger

Chat Trigger

#5

Postgres Chat Memory

Memory Postgres Chat

#6

Postgres Chat Memory1

Memory Postgres Chat

#7

Products in Daatabase

My Sql Tool

#8

Knowledge Base

HTTP Request

#9

External API

HTTP Request

#10

Sticky Note

Sticky Note

#11

OpenAI2

OpenAI

#12