Skip to main content

Tutor English chat messages using OpenRouter with Postgres memory and log to Supabase

Workflow preview

Workflow preview
100%
Tutor English chat messages using OpenRouter with Postgres memory and log to Supabase preview
Open on n8n.io

1. Workflow Overview

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

Best for

  • Miscellaneous automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.respondtowebhook, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenrouter, @n8n/n8n-nodes-langchain.memorypostgreschat, n8n-nodes-base.stickynote, n8n-nodes-base.supabase

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Kanishka Shrivastava.

Original n8n.io source

1.1 Workflow description

Title
Tutor English chat messages using OpenRouter with Postgres memory and log to Supabase
Workflow name
Tutor English chat messages using OpenRouter with Postgres memory and log to Supabase

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 user_id and message.
  2. Extracts and standardizes the incoming fields so the workflow has clean user_id and message values.
  3. Sends the message to an AI English tutor powered by OpenRouter, using Postgres chat memory keyed by user_id 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 user_id.
  3. Add Supabase credentials and create a conversations table, then confirm the mapped columns (user_id, role, message) match your schema.
  4. Copy the webhook URL from n8n and configure your app to POST a JSON body with user_id and message to that endpoint.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 2 - Respond to Webhook

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 3 - Edit Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3.1

Block 5 - OpenRouter Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 6 - Postgres Chat Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryPostgresChat - memoryPostgresChat
Config choices
Version 1.3

Block 7 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Log to Supabase

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

3. Summary Table

Workflow Tutor English chat messages using OpenRouter with Postgres memory and log to Supabase
Complexity advanced
Nodes 15
Categories Miscellaneous, AI Chatbot
Author Kanishka Shrivastava
Published 03 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16094/16094.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Tutor English chat messages using OpenRouter with Postgres memory and log to Supabase do?

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

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Miscellaneous, AI Chatbot use case.