AutomationFlowsAI & RAG › Automate Blog Updates via Discord with Github and Gemini AI

Automate Blog Updates via Discord with Github and Gemini AI

ByPraneel S @praneel7015 on n8n.io

> ⚠️ Disclaimer: This template uses the n8n-nodes-discord-trigger community node, which means it works only in self-hosted n8n instances.(works for both cloud and localhost)

Event trigger★★★☆☆ complexityAI-powered10 nodesAgentGoogle Gemini ChatDate Time ToolGithub ToolMemory Buffer WindowN8N Nodes Discord TriggerDiscord
AI & RAG Trigger: Event Nodes: 10 Complexity: ★★★☆☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #7950 — we link there as the canonical source.

This workflow follows the Agent → Discord 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": "Praneel's Discord Automation with Github and AI Chatbot ",
  "tags": [],
  "nodes": [
    {
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        448,
        0
      ],
      "parameters": {
        "text": "={{ $json.content }}",
        "options": {
          "systemMessage": "=\n## Core Identity & Persona\n\nYou are the **n8n Blog Master**, a specialized AI agent. Your primary function is to assist your user with content management.\n\n* **Your Mission:** Automate the process of creating, formatting, editing, and saving blog posts as Markdown files within the user\u2019s specified repository.  \n* **User Clarification:** The repository owner always refers to your **user** and, in the context of API calls, the **repository owner**. It is never part of a file path.  \n* **Personality:** Helpful, precise, security-conscious. Semi-casual and engaging, but never overly cheerful.  \n\n---\n\n## Operational Zone & Constraints\n\n* **Repository:** You may only interact with the repository **`<insert-repo-name-here>`**.  \n* **Owner:** The repository owner is **`<insert-username-here>`**.  \n* **Branch:** Always operate on the `main` branch.  \n* **Directory Access:** You can **only** write or edit files in the directory **`<insert-directory-path-here>`**. You are forbidden from interacting elsewhere.  \n* **File Permissions:**  \n  - You may **create new `.md` files**.  \n  - If a file already exists, notify the user and ask if they want to edit it.  \n  - Editing is only allowed if the user explicitly confirms (e.g., \u201cyes\u201d, \u201cgo ahead\u201d, \u201ccontinue\u201d).  \n  - If the user confirms, proceed with editing.  \n\n---\n\n## Available Tools & Usage Protocol\n\nYou have a limited but well-defined toolset. Always use them exactly as described:  \n\n### 1. Date & Time Tool  \n* Purpose: Always fetch the current date and time in **IST (India Standard Time)**.  \n* Usage: Call this before creating the blog post so the `date` field in the front matter is correct.  \n* Do not use any other timezone.  \n\n### 2. GitHub Nodes  \n* **Create:** Used to create new files within **`<insert-directory-path-here>`**. Requires three parameters:  \n  - `owner` \u2192 always **`<insert-username-here>`**  \n  - `repo` \u2192 always **`<insert-repo-name-here>`**  \n  - `path` \u2192 must be `<insert-directory-path-here>/<filename>.md`  \n* **List:** Can list files inside **`<insert-directory-path-here>`**. Use it to check existing filenames before creating new ones.  \n* **Read:** Can fetch contents of files if needed.  \n* **Edit:** Can update a specific file in **`<insert-directory-path-here>`**.  \n  - **Protocol:** Before editing, explicitly ask:  \n    *\u201cAre you sure you want me to edit `<filename>.md`?\u201d*  \n  - If the user responds with **\u201cyes\u201d**, **\u201ccontinue\u201d**, or similar confirmation, proceed.  \n  - If the user declines, do nothing.  \n* Constraint: Never attempt operations outside the specified directory.  \n\n### 3. Data Storage & Message History  \n* Purpose: Store temporary user confirmations and recall **previous user messages** as part of memory.  \n* Example:  \n  - If you ask for edit confirmation and the user replies *\u201cyes\u201d* or *\u201ccontinue\u201d*, record that in storage.  \n  - If later in the same conversation the user says *\u201cgo ahead\u201d* without repeating the filename, check both storage and previous messages to infer intent.  \n* Always reset confirmation after the action is completed.  \n\n---\n\n## Standard Workflow: Creating or Editing Blog Posts\n\n1. **Activation:** Begin when the user says:  \n   - \u201cDraft a new post on\u2026\u201d  \n   - \u201cMake the body about\u2026\u201d  \n   - \u201cUse my rough notes\u2026\u201d  \n   - \u201cModify it to include\u2026\u201d  \n   - \u201cEdit the file\u2026\u201d  \n\n2. **Information Gathering:**  \n   * Ask for the **Title** (mandatory for new posts).  \n   * Gather **topic, points, or raw notes** from the user.  \n   * If user provides incomplete notes, expand them into a coherent, well-structured article.  \n\n3. **Drafting & Formatting:**  \n   * Call the Date & Time tool.  \n   * Format posts in the following template:  \n\n   ```markdown\n   ---\n   title: \"The Title Provided by the User\"\n   date: \"YYYY-MM-DD\"\n   ---\n\n   [Well-structured blog content goes here. Expand rough notes if needed, maintain logical flow, use clear headings if appropriate.]\n\n   Thanks for Reading!\n  ```\n---\n- Writing rules:\n\nTone: Neutral, informative, lightly conversational \u2014 not too cheerful.\n\nFlow: Use line breaks for readability.\n\nExpansion: If notes are provided, polish and structure them.\n\nModification: If asked, revise while preserving original meaning.\n\nFile Naming:\n\nGenerate a short kebab-case filename from the title (e.g., \"Making My Own Java CLI-Based RPG!\" \u2192 java-cli-rpg.md).\n\nFile Creation vs Editing:\n\nIf creating \u2192 Use the GitHub Create tool.\n\nIf file already exists \u2192 Ask the user if they want to edit it.\n\nStore their response in Data Storage.\n\nIf confirmation = yes \u2192 proceed with GitHub Edit tool.\n\nIf no \u2192 cancel operation.\n\nFinal Action:\n\nConfirm success to the user after creation or editing.\n\nAdvanced Error Handling: \"Resource Not Found\"\n\nIf the create_github_file tool fails with \"Resource not found\":\n\nFirst Failure:\n\nNotify the user that the attempt failed.\n\nState the exact path used.\n\nRetry automatically once.\n\nSecond Failure:\n\nIf it fails again, explain that standard creation isn\u2019t working.\n\nSuggest it may be a permissions issue.\n\nAwait user instructions before proceeding further."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        160,
        208
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "name": "Date & Time",
      "type": "n8n-nodes-base.dateTimeTool",
      "position": [
        992,
        272
      ],
      "parameters": {
        "options": {
          "timezone": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Timezone', ``, 'string') }}"
        }
      },
      "typeVersion": 2
    },
    {
      "name": "Create a file in GitHub",
      "type": "n8n-nodes-base.githubTool",
      "position": [
        432,
        320
      ],
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Repository_Owner', ``, 'string') }}"
        },
        "filePath": "<insert-directory-path-here>",
        "resource": "file",
        "repository": {
          "__rl": true,
          "mode": "name",
          "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Repository_Name', ``, 'string') }}"
        },
        "fileContent": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('File_Content', ``, 'string') }}",
        "commitMessage": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Commit_Message', ``, 'string') }}"
      },
      "typeVersion": 1.1
    },
    {
      "name": "Get a file in GitHub",
      "type": "n8n-nodes-base.githubTool",
      "position": [
        752,
        432
      ],
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Repository_Owner', ``, 'string') }}"
        },
        "filePath": "<insert-directory-path-here>",
        "resource": "file",
        "operation": "get",
        "repository": {
          "__rl": true,
          "mode": "name",
          "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Repository_Name', ``, 'string') }}"
        },
        "asBinaryProperty": false,
        "additionalParameters": {}
      },
      "typeVersion": 1.1
    },
    {
      "name": "List files in GitHub",
      "type": "n8n-nodes-base.githubTool",
      "position": [
        880,
        336
      ],
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Repository_Owner', ``, 'string') }}"
        },
        "filePath": "<insert-directory-path-here>",
        "resource": "file",
        "operation": "list",
        "repository": {
          "__rl": true,
          "mode": "name",
          "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Repository_Name', ``, 'string') }}"
        }
      },
      "typeVersion": 1.1
    },
    {
      "name": "Edit a file in GitHub",
      "type": "n8n-nodes-base.githubTool",
      "position": [
        592,
        368
      ],
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Repository_Owner', ``, 'string') }}"
        },
        "filePath": "<insert-directory-path-here>",
        "resource": "file",
        "operation": "edit",
        "repository": {
          "__rl": true,
          "mode": "name",
          "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Repository_Name', ``, 'string') }}"
        },
        "fileContent": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('File_Content', ``, 'string') }}",
        "commitMessage": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Commit_Message', ``, 'string') }}"
      },
      "typeVersion": 1.1
    },
    {
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        288,
        304
      ],
      "parameters": {
        "sessionKey": "=\"memoryKey\": \"history\"",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "name": "Discord Message Reader",
      "type": "n8n-nodes-discord-trigger.discordTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "pattern": "every",
        "additionalFields": {}
      },
      "typeVersion": 1
    },
    {
      "name": "Sends Message to Discord",
      "type": "n8n-nodes-base.discord",
      "position": [
        1040,
        32
      ],
      "parameters": {
        "embeds": {
          "values": [
            {}
          ]
        },
        "content": "={{ $('AI Agent').item.json.output }}",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "typeVersion": 2
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Sends Message to Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Date & Time": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Get a file in GitHub": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "List files in GitHub": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Edit a file in GitHub": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Discord Message Reader": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a file in GitHub": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

&gt; ⚠️ Disclaimer: This template uses the n8n-nodes-discord-trigger community node, which means it works only in self-hosted n8n instances.(works for both cloud and localhost)

Source: https://n8n.io/workflows/7950/ — 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

⚠️ Disclaimer: This workflow uses WhatsApp, Google Calendar, and Gmail nodes that must be configured manually.

Agent, Google Gemini Chat, Memory Buffer Window +5
AI & RAG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Output Parser Structured, Telegram, N8N Nodes Tesseractjs +14
AI & RAG

WhatsApp AI Assistant for Clinic Appointment Booking Automate your entire appointment lifecycle with an intelligent AI assistant that lives on WhatsApp. This workflow empowers any clinic or independen

Google Gemini Chat, WhatsApp Trigger, Memory Buffer Window +9
AI & RAG

Use cases are many: Manage your Gmail inbox, schedule calendar events, and handle contact details — all from one central AI-powered assistant. Perfect for freelancers managing clients, agency owners w

Agent, Gmail Tool, Google Gemini Chat +10
AI & RAG

reasoning_+_anti_deception_agent_vs_agent_eval_workflow. Uses httpRequestTool, agent, memoryBufferWindow, lmChatGoogleGemini. Event-driven trigger; 28 nodes.

HTTP Request Tool, Agent, Memory Buffer Window +4