The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Chat Interface",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "chat",
"responseMode": "onReceived"
},
"id": "webhook-chat",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"method": "POST",
"url": "https://api.openai.com/v1/embeddings",
"authentication": "genericCredentialType",
"genericCredentialType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer {{ $env.OPENAI_API_KEY }}"
}
]
},
"bodyParametersJson": "={\n \"model\": \"text-embedding-3-small\",\n \"input\": \"{{ $node[\\\"Webhook\\\"].json.query }}\"\n}"
},
"id": "query-embedding",
"name": "Query Embedding",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
450,
300
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $env.SUPABASE_DB_URL }}/rest/v1/rpc/search_embeddings",
"authentication": "genericCredentialType",
"genericCredentialType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer {{ $env.SUPABASE_SERVICE_ROLE_KEY }}"
}
]
},
"bodyParametersJson": "={\n \"query_embedding\": {{ $node[\\\"Query Embedding\\\"].json.data[0].embedding }},\n \"match_threshold\": 0.7,\n \"match_count\": 5\n}"
},
"id": "semantic-search",
"name": "Semantic Search",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
650,
300
]
},
{
"parameters": {
"method": "POST",
"url": "https://api.openai.com/v1/chat/completions",
"authentication": "genericCredentialType",
"genericCredentialType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer {{ $env.OPENAI_API_KEY }}"
}
]
},
"bodyParametersJson": "={\n \"model\": \"gpt-4\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant. Use the provided context to answer questions.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Context: {{ $node[\\\"Semantic Search\\\"].json | json.stringify }}\\n\\nQuestion: {{ $node[\\\"Webhook\\\"].json.query }}\"\n }\n ],\n \"temperature\": 0.7\n}"
},
"id": "gpt-response",
"name": "Generate Response",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
850,
300
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $env.SUPABASE_DB_URL }}/rest/v1/chat_history",
"authentication": "genericCredentialType",
"genericCredentialType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer {{ $env.SUPABASE_SERVICE_ROLE_KEY }}"
}
]
},
"bodyParametersJson": "={\n \"user_query\": \"{{ $node[\\\"Webhook\\\"].json.query }}\",\n \"ai_response\": \"{{ $node[\\\"Generate Response\\\"].json.choices[0].message.content }}\",\n \"user_id\": \"{{ $node[\\\"Webhook\\\"].json.user_id }}\"\n}"
},
"id": "save-history",
"name": "Save Chat History",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4,
"position": [
1050,
300
]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Query Embedding",
"type": "main",
"index": 0
}
]
]
},
"Query Embedding": {
"main": [
[
{
"node": "Semantic Search",
"type": "main",
"index": 0
}
]
]
},
"Semantic Search": {
"main": [
[
{
"node": "Generate Response",
"type": "main",
"index": 0
}
]
]
},
"Generate Response": {
"main": [
[
{
"node": "Save Chat History",
"type": "main",
"index": 0
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Chat Interface. Uses httpRequest. Webhook trigger; 5 nodes.
Source: https://github.com/Busraaozkan1/n8n-project/blob/568cf19ed9a57e6b5b4444c3e62d9b9a781e6930/n8n-workflows/chat-interface.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This n8n template provides enterprise-level version control for your workflows using GitHub integration. Stop losing hours to broken workflows and manual exports – get proper commit history, visual di
This flow creates dummy files for every item added in your *Arrs (Radarr/Sonarr) with the tag .
eek-Go v2 (Batch-Then-Review). Uses httpRequest. Webhook trigger; 75 nodes.
This workflow receives webhook requests from a content calendar and uses the X API v2 to publish text posts, threads, image/video posts, and polls, as well as delete existing posts and run a credentia
This workflow acts as a central API gateway for all technical indicator agents in the Binance Spot Market Quant AI system. It listens for incoming webhook requests and dynamically routes them to the c