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": "\u53e4\u8bd7\u6587\u5b66\u4e60\u6d41\u7a0b",
"nodes": [
{
"parameters": {},
"id": "webhook-start",
"name": "\u5b66\u4e60\u5f00\u59cb\u89e6\u53d1\u5668",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
240,
300
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$json.userAction}}",
"operation": "equal",
"value2": "start"
}
]
}
},
"id": "if-start",
"name": "\u5224\u65ad\u662f\u5426\u5f00\u59cb\u5b66\u4e60",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
460,
300
]
},
{
"parameters": {
"url": "http://localhost:5000/api/poems/{{$json.poemId}}",
"options": {}
},
"id": "get-poem",
"name": "\u83b7\u53d6\u8bd7\u8bcd\u6570\u636e",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
680,
200
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$json.userAction}}",
"operation": "equal",
"value2": "answer"
}
]
}
},
"id": "if-answer",
"name": "\u5224\u65ad\u662f\u5426\u63d0\u4ea4\u7b54\u6848",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
460,
500
]
},
{
"parameters": {
"jsCode": "// \u68c0\u67e5\u7528\u6237\u7b54\u6848\u662f\u5426\u6b63\u786e\nconst userAnswers = $input.first().json.userAnswers || [];\nconst correctAnswers = $input.first().json.correctAnswers || [];\n\nconst isCorrect = userAnswers.length === correctAnswers.length && \n userAnswers.every((answer, index) => answer === correctAnswers[index]);\n\nconst result = {\n isCorrect,\n userAnswers,\n correctAnswers,\n poemId: $input.first().json.poemId,\n stepId: $input.first().json.stepId,\n timestamp: new Date().toISOString()\n};\n\nreturn result;"
},
"id": "check-answer",
"name": "\u68c0\u67e5\u7b54\u6848\u6b63\u786e\u6027",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
680,
500
]
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{$json.isCorrect}}",
"value2": true
}
]
}
},
"id": "if-correct",
"name": "\u5224\u65ad\u7b54\u6848\u662f\u5426\u6b63\u786e",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
900,
500
]
},
{
"parameters": {
"url": "http://localhost:5000/api/ai/generate-image",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"poemId\": \"{{$json.poemId}}\",\n \"stepId\": {{$json.stepId + 1}},\n \"description\": \"{{$json.nextStepDescription}}\",\n \"style\": \"traditional\"\n}",
"options": {}
},
"id": "pregenerate-image",
"name": "\u9884\u751f\u6210\u4e0b\u4e00\u6b65\u56fe\u7247",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
1120,
400
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$json.userAction}}",
"operation": "equal",
"value2": "hint"
}
]
}
},
"id": "if-hint",
"name": "\u5224\u65ad\u662f\u5426\u8bf7\u6c42\u63d0\u793a",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
460,
700
]
},
{
"parameters": {
"url": "http://localhost:5000/api/ai/generate-hint",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"poemId\": \"{{$json.poemId}}\",\n \"stepId\": {{$json.stepId}},\n \"context\": {{JSON.stringify($json.context)}},\n \"currentLine\": \"{{$json.currentLine}}\",\n \"blanks\": {{JSON.stringify($json.blanks)}}\n}",
"options": {}
},
"id": "generate-hint",
"name": "\u751f\u6210\u667a\u80fd\u63d0\u793a",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
680,
700
]
},
{
"parameters": {
"url": "http://localhost:5000/api/n8n/progress/update",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"poemId\": \"{{$json.poemId}}\",\n \"stepId\": {{$json.stepId}},\n \"userAnswers\": {{JSON.stringify($json.userAnswers)}},\n \"isCorrect\": {{$json.isCorrect}},\n \"timeSpent\": {{$json.timeSpent || 0}},\n \"hintsUsed\": {{$json.hintsUsed || 0}}\n}",
"options": {}
},
"id": "update-progress",
"name": "\u66f4\u65b0\u5b66\u4e60\u8fdb\u5ea6",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
1120,
600
]
},
{
"parameters": {
"jsCode": "// \u51c6\u5907\u54cd\u5e94\u6570\u636e\nconst inputData = $input.first().json;\n\nconst response = {\n success: true,\n action: inputData.userAction,\n poemId: inputData.poemId,\n stepId: inputData.stepId,\n timestamp: new Date().toISOString()\n};\n\n// \u6839\u636e\u4e0d\u540c\u7684\u7528\u6237\u884c\u4e3a\u6dfb\u52a0\u76f8\u5e94\u7684\u54cd\u5e94\u6570\u636e\nswitch (inputData.userAction) {\n case 'start':\n response.poemData = inputData.poemData;\n response.currentStep = inputData.currentStep;\n break;\n \n case 'answer':\n response.isCorrect = inputData.isCorrect;\n response.feedback = inputData.isCorrect ? '\u56de\u7b54\u6b63\u786e\uff01' : '\u518d\u8bd5\u8bd5\u770b';\n if (inputData.isCorrect && inputData.nextStep) {\n response.nextStep = inputData.nextStep;\n response.preGeneratedImage = inputData.preGeneratedImage;\n }\n break;\n \n case 'hint':\n response.hint = inputData.hint;\n response.hintsUsed = (inputData.hintsUsed || 0) + 1;\n break;\n}\n\nreturn response;"
},
"id": "prepare-response",
"name": "\u51c6\u5907\u54cd\u5e94\u6570\u636e",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1340,
500
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{JSON.stringify($json)}}"
},
"id": "webhook-response",
"name": "\u8fd4\u56de\u54cd\u5e94",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
1560,
500
]
},
{
"parameters": {
"jsCode": "// \u8bb0\u5f55\u9519\u8bef\u7b54\u6848\uff0c\u7528\u4e8e\u540e\u7eed\u5206\u6790\nconst inputData = $input.first().json;\n\nconst errorLog = {\n poemId: inputData.poemId,\n stepId: inputData.stepId,\n userAnswers: inputData.userAnswers,\n correctAnswers: inputData.correctAnswers,\n timestamp: new Date().toISOString(),\n sessionId: inputData.sessionId || 'anonymous'\n};\n\n// \u8fd9\u91cc\u53ef\u4ee5\u53d1\u9001\u5230\u5206\u6790\u7cfb\u7edf\u6216\u6570\u636e\u5e93\nconsole.log('\u9519\u8bef\u7b54\u6848\u8bb0\u5f55:', errorLog);\n\nreturn {\n ...inputData,\n errorLogged: true,\n suggestion: '\u4ed4\u7ec6\u601d\u8003\u8bd7\u8bcd\u7684\u610f\u5883\u548c\u4f5c\u8005\u7684\u60c5\u611f'\n};"
},
"id": "log-error",
"name": "\u8bb0\u5f55\u9519\u8bef\u7b54\u6848",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1120,
700
]
},
{
"parameters": {
"conditions": {
"number": [
{
"value1": "={{$json.stepId}}",
"operation": "equal",
"value2": "={{$json.totalSteps}}"
}
]
}
},
"id": "if-completed",
"name": "\u5224\u65ad\u662f\u5426\u5b8c\u6210\u5168\u8bd7",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
1340,
300
]
},
{
"parameters": {
"url": "http://localhost:5000/api/poems/{{$json.poemId}}/complete",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"completedAt\": \"{{new Date().toISOString()}}\",\n \"totalTime\": {{$json.totalTime || 0}},\n \"accuracy\": {{$json.accuracy || 100}}\n}",
"options": {}
},
"id": "mark-completed",
"name": "\u6807\u8bb0\u8bd7\u8bcd\u5b8c\u6210",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
1560,
200
]
},
{
"parameters": {
"url": "http://localhost:5000/api/ai/personalized-suggestions",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"learningHistory\": {{JSON.stringify($json.learningHistory)}},\n \"currentPerformance\": {{JSON.stringify($json.performance)}},\n \"preferences\": {{JSON.stringify($json.preferences)}}\n}",
"options": {}
},
"id": "generate-suggestions",
"name": "\u751f\u6210\u4e2a\u6027\u5316\u5efa\u8bae",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [
1780,
200
]
}
],
"connections": {
"webhook-start": {
"main": [
[
{
"node": "if-start",
"type": "main",
"index": 0
},
{
"node": "if-answer",
"type": "main",
"index": 0
},
{
"node": "if-hint",
"type": "main",
"index": 0
}
]
]
},
"if-start": {
"main": [
[
{
"node": "get-poem",
"type": "main",
"index": 0
}
]
]
},
"get-poem": {
"main": [
[
{
"node": "prepare-response",
"type": "main",
"index": 0
}
]
]
},
"if-answer": {
"main": [
[
{
"node": "check-answer",
"type": "main",
"index": 0
}
]
]
},
"check-answer": {
"main": [
[
{
"node": "if-correct",
"type": "main",
"index": 0
}
]
]
},
"if-correct": {
"main": [
[
{
"node": "pregenerate-image",
"type": "main",
"index": 0
},
{
"node": "if-completed",
"type": "main",
"index": 0
}
],
[
{
"node": "log-error",
"type": "main",
"index": 0
}
]
]
},
"pregenerate-image": {
"main": [
[
{
"node": "update-progress",
"type": "main",
"index": 0
}
]
]
},
"if-hint": {
"main": [
[
{
"node": "generate-hint",
"type": "main",
"index": 0
}
]
]
},
"generate-hint": {
"main": [
[
{
"node": "prepare-response",
"type": "main",
"index": 0
}
]
]
},
"update-progress": {
"main": [
[
{
"node": "prepare-response",
"type": "main",
"index": 0
}
]
]
},
"prepare-response": {
"main": [
[
{
"node": "webhook-response",
"type": "main",
"index": 0
}
]
]
},
"log-error": {
"main": [
[
{
"node": "prepare-response",
"type": "main",
"index": 0
}
]
]
},
"if-completed": {
"main": [
[
{
"node": "mark-completed",
"type": "main",
"index": 0
}
]
]
},
"mark-completed": {
"main": [
[
{
"node": "generate-suggestions",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"timezone": "Asia/Shanghai"
},
"versionId": "1",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "learning-flow",
"tags": [
"poetry-learning",
"education",
"ai"
]
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
古诗文学习流程. Uses httpRequest. Webhook trigger; 16 nodes.
Source: https://github.com/OmagariHare258/classical-poetry-learning/blob/7ce1335124e2943167578bf58815deefdff9d3dc/n8n-workflows/backup/08-learning-flow-complex.json.bak — 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 .
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
Sign PDF documents with legally-compliant digital signatures using X.509 certificates. Supports multiple PAdES signature levels (B, T, LT, LTA) with optional visible stamps.
📡 This workflow serves as the central Alpha Vantage API fetcher for Tesla trading indicators, delivering cleaned 20-point JSON outputs for three timeframes: , , and . It is required by the following a