AutomationFlowsAI & RAG › Novel Generate From Plot

Novel Generate From Plot

novel-generate-from-plot. Uses readWriteFile, lmChatGoogleGemini, chainLlm, executeCommand. Event-driven trigger; 9 nodes.

Event trigger★★★★☆ complexityAI-powered9 nodesRead Write FileGoogle Gemini ChatChain LlmExecute Command
AI & RAG Trigger: Event Nodes: 9 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Chainllm → Google Gemini Chat recipe pattern — see all workflows that pair these two integrations.

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 →

Download .json
{
  "name": "novel-generate-from-plot",
  "nodes": [
    {
      "parameters": {
        "fileSelector": "D:/Projects/Novels/sweet_love/plots/*_*.md",
        "options": {}
      },
      "type": "n8n-nodes-base.readWriteFile",
      "typeVersion": 1,
      "position": [
        -200,
        30
      ],
      "id": "ad2889ac-5cf2-404a-a73b-ae9c9ac689e1",
      "name": "Read/Write Files from Disk"
    },
    {
      "parameters": {
        "modelName": "models/gemini-2.0-flash",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        548,
        0
      ],
      "id": "76de9a5d-2130-4d6c-a3e3-924d0a107d15",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "text",
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        20,
        30
      ],
      "id": "45f83e03-72f3-47a1-aff7-5cda05401c7c",
      "name": "Extract from File"
    },
    {
      "parameters": {
        "operation": "write",
        "fileName": "=D:/Projects/Novels/sweet_love/chapters/{{ $('Read/Write Files from Disk').item.json.fileName }}",
        "dataPropertyName": "data:{ $json.text }}",
        "options": {}
      },
      "type": "n8n-nodes-base.readWriteFile",
      "typeVersion": 1,
      "position": [
        836,
        180
      ],
      "id": "dde3c8c9-e25e-47ac-8db5-1d1565db6546",
      "name": "Read/Write Files from Disk1"
    },
    {
      "parameters": {
        "operation": "toText",
        "sourceProperty": "text",
        "binaryPropertyName": "=data:{ $json.text }}",
        "options": {
          "encoding": "utf8"
        }
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        538,
        180
      ],
      "id": "b09039c3-c312-45a5-8579-7fb4c685922b",
      "name": "Convert to File"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -420,
        30
      ],
      "id": "321d67ed-5915-4dde-8376-5fd14d54dc33",
      "name": "When clicking \u2018Test workflow\u2019"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        240,
        30
      ],
      "id": "86f9c16b-0e62-48bf-a976-c758faab27ed",
      "name": "Loop Over Items"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.data }}",
        "messages": {
          "messageValues": [
            {
              "message": "\u0e04\u0e38\u0e19\u0e40\u0e1b\u0e47\u0e19\u0e19\u0e31\u0e01\u0e40\u0e02\u0e35\u0e22\u0e19\u0e19\u0e34\u0e22\u0e32\u0e22 \u0e40\u0e23\u0e35\u0e22\u0e1a\u0e40\u0e23\u0e35\u0e22\u0e07\u0e40\u0e19\u0e37\u0e49\u0e2d\u0e2b\u0e32 \u0e42\u0e17\u0e19: \u0e42\u0e23\u0e41\u0e21\u0e19\u0e15\u0e34\u0e01 \u0e04\u0e07\u0e40\u0e19\u0e37\u0e49\u0e2d\u0e2b\u0e32\u0e40\u0e14\u0e34\u0e21\u0e44\u0e27\u0e49 \u0e41\u0e25\u0e30\u0e15\u0e31\u0e49\u0e07\u0e0a\u0e37\u0e48\u0e2d\u0e15\u0e2d\u0e19\n\n{\u0e0a\u0e37\u0e48\u0e2d\u0e15\u0e2d\u0e19}\n\n{\u0e40\u0e19\u0e37\u0e49\u0e2d\u0e2b\u0e32}"
            }
          ]
        }
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.6,
      "position": [
        460,
        -220
      ],
      "id": "9264fff0-6eef-4b55-ab39-52af08a20cc6",
      "name": "LLM Revise Chain",
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "command": "=cd {{ $json.fileName.split(\"chapters\")[0] }}\npowershell -ExecutionPolicy Bypass -File gen.ps1\n"
      },
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        1056,
        180
      ],
      "id": "0124b635-debe-4db8-896e-888a24490f0b",
      "name": "Execute Command",
      "alwaysOutputData": true,
      "executeOnce": false
    }
  ],
  "connections": {
    "Read/Write Files from Disk": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "LLM Revise Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Read/Write Files from Disk1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Read/Write Files from Disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read/Write Files from Disk1": {
      "main": [
        [
          {
            "node": "Execute Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "LLM Revise Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM Revise Chain": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "854b3c68-218b-49a7-8497-86e3738bfb3e",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "KTa8gvHYNfUFPaYY",
  "tags": []
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

novel-generate-from-plot. Uses readWriteFile, lmChatGoogleGemini, chainLlm, executeCommand. Event-driven trigger; 9 nodes.

Source: https://gist.github.com/anoochit/9a4d3571888e22e5f1f5a31875de2171 — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow creates a multi-talented AI assistant named Simran that interacts with users via Telegram. It can handle text and voice messages, understand the user's intent, and perform various tasks.

MongoDB, Chain Llm, Google Gemini Chat +11
AI & RAG

🤖🧑‍💻 AI Agent for Top n8n Creators Leaderboard Reporting. Uses httpRequest, lmChatOpenAi, executeWorkflowTrigger, toolWorkflow. Event-driven trigger; 49 nodes.

HTTP Request, OpenAI Chat, Execute Workflow Trigger +8
AI & RAG

🤖🧑‍💻 AI Agent for Top n8n Creators Leaderboard Reporting. Uses httpRequest, lmChatOpenAi, executeWorkflowTrigger, toolWorkflow. Event-driven trigger; 49 nodes.

HTTP Request, OpenAI Chat, Execute Workflow Trigger +8
AI & RAG

This n8n workflow is designed to automate the aggregation, processing, and reporting of community statistics related to n8n creators and workflows. Its primary purpose is to generate insightful report

HTTP Request, OpenAI Chat, Execute Workflow Trigger +8
AI & RAG

Turbo Videogen. Uses lmChatOpenRouter, agent, httpRequest, formTrigger. Event-driven trigger; 41 nodes.

OpenRouter Chat, Agent, HTTP Request +7