Tutor English chat messages using OpenRouter with Postgres memory and log to Supabase
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
Nodes used (7)
- Webhook
n8n-nodes-base.webhook - Respond to Webhook
n8n-nodes-base.respondToWebhook - Edit Fields (Set)
n8n-nodes-base.set - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenRouter Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenRouter - Postgres Chat Memory
@n8n/n8n-nodes-langchain.memoryPostgresChat - Supabase
n8n-nodes-base.supabase
What it does
Quick overview This workflow receives English practice messages via a webhook, uses an OpenRouter chat model with Postgres-backed conversation memory to generate tutoring feedback, logs the exchange to Supabase, and returns the tutor’s reply as a JSON response. How it works 1. Receives a POST webhook request containing a userid and message. 2. Extracts and standardizes the incoming fields so the workflow has clean userid and message values. 3. Sends the message to an AI English tutor powered by OpenRouter, using Postgres chat memory keyed by userid to maintain per-student context. 4. Logs the tutor output to a Supabase conversations table along with the user identifier and original message. 5. Returns a JSON response to the caller containing the tutor’s reply. Setup 1. Add an OpenRouter API credential and (optionally) choose a different model in the OpenRouter chat model configuration. 2. Add Postgres credentials and ensure the database is reachable from n8n so chat memory can persist sessions by userid. 3. Add Supabase credentials and create a conversations table, then confirm the mapped columns (userid, role, message) match your schema. 4. Copy the webhook URL from n8n and configure your app to POST a JSON body with userid and message to that endpoint.