X上的印度教节日帖子
高级
这是一个Social Media, Multimodal AI领域的自动化工作流,包含 30 个节点。主要使用 Code, Twitter, HttpRequest, GoogleSheets, ManualTrigger 等节点。 使用Google Gemini和GPT-4o Mini自动发布每日印度教节日帖子到X
前置要求
- •Twitter API 凭证
- •可能需要目标 API 的认证凭证
- •Google Sheets API 凭证
- •OpenAI API Key
- •Google Gemini API Key
使用的节点 (30)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "APuS8Jz54ZljwIJ7",
"meta": {
"instanceId": "d06afcec45b6881aa3c2bd3e34579ea44e46952db235308e9371e2bb743e4b43",
"templateCredsSetupCompleted": true
},
"name": "X上的印度教节日帖子",
"tags": [],
"nodes": [
{
"id": "72ba643f-c65e-419f-9617-ce3123727b81",
"name": "获取今日日期",
"type": "n8n-nodes-base.code",
"position": [
-760,
600
],
"parameters": {
"jsCode": "const today = new Date();\nconst day = String(today.getDate()).padStart(2, '0');\nconst month = String(today.getMonth() + 1).padStart(2, '0');\nconst year = today.getFullYear();\n\nconst formattedDate = `${day}/${month}/${year}`;\n\nreturn {\n date: formattedDate,\n};"
},
"typeVersion": 2
},
{
"id": "5e5aa3f7-1485-4e75-9875-6589be7263b5",
"name": "获取匹配日期的数据",
"type": "n8n-nodes-base.googleSheets",
"position": [
-460,
600
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $json.date }}",
"lookupColumn": "Date"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zVvFDvCRSDbeKVTV4vLj3txSrCptaVFlVkulve7gi5s/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1zVvFDvCRSDbeKVTV4vLj3txSrCptaVFlVkulve7gi5s",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zVvFDvCRSDbeKVTV4vLj3txSrCptaVFlVkulve7gi5s/edit?usp=drivesdk",
"cachedResultName": "n8n-test"
},
"combineFilters": "OR"
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "ApSI2tCmuXKjcze5",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "c80da083-075a-4829-8d97-c8ef94f0414e",
"name": "点击\"执行工作流\"时",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-820,
-180
],
"parameters": {},
"typeVersion": 1
},
{
"id": "c1dede48-8d86-42ff-966b-40cd0dcb345d",
"name": "生成结构化数据",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
-220,
-180
],
"parameters": {
"text": "=You are an expert Hindu festival researcher and data extractor. Your primary goal is to gather detailed information for each Hindu festival in 2025 based on the provided initial data.\nInput Data:\nBelow is the content of the 'data' field, which contains a list of Hindu festivals for 2025 in a Markdown table format.\n---\n{{ $json.data }}\n---\nYour Task:\n1. Initial Extraction: First, meticulously parse the Markdown table titled \"List of Religious Holidays of Hindu in 2025\" from the Input Data. For each row, extract the English Name of the Festival (from the 'HOLIDAY' column, including all names if separated by '/') and the Date of the Festival (from the 'DATE' column, e.g., 'Jan 15, 2025').\n2. Date Formatting: Convert the extracted date to DD/MM/YYYY format. For example, 'Jan 15, 2025' should become '15/01/2025'.\n3. Information Enrichment : For each festival identified in Step 1,find the following additional details:\n Hindi Name of the Festival: Search specifically for the Hindi name (e.g., \"Makar Sankranti Hindi name\"). Prioritize widely accepted Hindi transliterations.\n **Short Description of the Festival: Find a concise, well-summarized English description (2-4 sentences is ideal) of the festival's significance, rituals, and celebration.\n *Hindi Description of the Festival/or translation of english to hindi:** Find a concise, well-summarized Hindi description (2-4 sentences is ideal) of the festival's significance, rituals, and celebration or just translate English description to Hindi.",
"batching": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "32801a33-0b01-4efd-a7bc-32e75036c8ae",
"name": "结构化帖子",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
60,
840
],
"parameters": {
"jsonSchemaExample": "[\n {\n \"text\": \"...\",\n \"hashtags\": \"#.. #.. #..\",\n \"call_to_action\": \"...\"\n },\n {\n \"text\": \"...\",\n \"hashtags\": \"#.. #.. #..\",\n \"call_to_action\": \"...\"\n }\n]"
},
"typeVersion": 1.3
},
{
"id": "a3882aaa-6df4-44ba-a151-922af524ebd7",
"name": "生成帖子",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
-160,
600
],
"parameters": {
"text": "=You are a social media content creator specializing in cultural and festival updates for X (formerly Twitter). Your goal is to create engaging posts that resonate with a diverse audience by blending English with key Hindi terms.\n\n**Input Festival Data:**\n- **Festival Name:** `{{ $json[\"Name of the Festival\"] }}`\n- **Date:** `{{ $json[\"Date\"] }}`\n- **English Description:** `{{ $json[\"English Description \"] }}`\n- **Hindi Description:** `{{ $json[\"Hindi Description\"] }}`\n\n**Your Task:**\n\nGenerate exactly 3 distinct social media post options for X (Twitter) for the `{{ $json[\"Name of the Festival\"] }}` festival happening on `{{ $json[\"Date\"] }}`.\n\n**Guidelines for X (Twitter) Posts:**\n1. **Conciseness:** Keep posts brief and impactful, suitable for X's character limits.\n2. **Language Blend:** The primary language of the post should be English, but **strategically incorporate 1-3 relevant Hindi words or short phrases** (e.g., festival names, key ritual terms, or greetings from the Hindi Description) to enhance cultural connection and reach.\n3. **Engagement:** Encourage likes, retweets, or community interaction.\n4. **Hashtags:** Include 2-4 relevant and trending hashtags (mix of broad and specific, including some in Hindi where appropriate).\n5. **Emojis:** Incorporate 1-3 relevant emojis to enhance visual appeal.\n6. **Call to Action (Optional):** Suggest a simple call to action (e.g., \"Retweet if...\", \"Learn more...\").\n7. **Key Info:** Ensure the festival name and date are clearly visible.\n8. **LIMIT:** The Character limit is 280 characters so text+hashtags+call_to_action should be less than 280\n",
"batching": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "8d7215ac-e355-447d-9cfe-a649f8226f46",
"name": "选择最佳帖子",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
280,
600
],
"parameters": {
"text": "=You are a highly discerning social media manager tasked with selecting the most effective X (formerly Twitter) post from a list of generated options. Your objective is to choose **only one** post that is best suited for publication.\n\n**Input Data:**\nBelow is a JSON array containing multiple social media post options for X.\n\n---\n1st Post:\n{{ $json.output[0].text }}\n\n{{ $json.output[0].call_to_action }}\n\n{{ $json.output[0].hashtags }}\n\n2nd Post:\n{{ $json.output[1].text }}\n\n{{ $json.output[1].call_to_action }}\n\n{{ $json.output[1].hashtags }}\n\n3rd Post:\n{{ $json.output[2].text }}\n\n{{ $json.output[2].call_to_action }}\n\n{{ $json.output[2].hashtags }}\n---\n\n**Your Task:**\n\nCarefully review each post option and select the single best one based on the following criteria:\n\n1. **Overall Impact & Engagement:** Which post is most likely to capture immediate attention and drive interactions (likes, retweets, replies)?\n2. **Conciseness:** While containing Hindi words, the post should still be Twitter-friendly and concise within typical character limits.\n3. **Clarity & Readability:** Is the message clear and easy to understand for a broad audience?\n4. **Effective Blend of English and Hindi:** Does it integrate Hindi words naturally and effectively to enhance cultural appeal without hindering understanding?\n5. **Hashtag & Emoji Relevance:** Are the hashtags and emojis well-chosen and supportive of the message?\n6. **Call to Action (if present):** Is the call to action clear and compelling?\n",
"batching": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "458e7c34-b3fb-47b4-95b3-2a02504a1196",
"name": "生成器模型",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
-200,
840
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.5-flash"
},
"credentials": {
"googlePalmApi": {
"id": "ngL4RI02lM8v6drj",
"name": "Google Gemini API"
}
},
"typeVersion": 1
},
{
"id": "1aa2a4b6-c5f8-4554-bc7c-8e21a357afe2",
"name": "选择器模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
240,
840
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "zvdFJ24ngPO14GJC",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "e0fbf542-5a15-4be9-94aa-2d5e43cbc642",
"name": "结构化输出解析器1",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
520,
840
],
"parameters": {
"jsonSchemaExample": " {\n \"text\": \"...\",\n \"hashtags\": \"#.. #.. #..\",\n \"call_to_action\": \"...\"\n }"
},
"typeVersion": 1.3
},
{
"id": "c0df5bf5-8db2-4b36-b459-aa1e7924eafa",
"name": "每日触发器",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-1040,
600
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 8
}
]
}
},
"typeVersion": 1.2
},
{
"id": "6aa2c2d5-8c2c-44d1-b7b1-f05011014262",
"name": "生成数据",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
-280,
60
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.5-flash"
},
"credentials": {
"googlePalmApi": {
"id": "ngL4RI02lM8v6drj",
"name": "Google Gemini API"
}
},
"typeVersion": 1
},
{
"id": "e392fca2-13ab-4f1a-96a8-8719f9bdbfd9",
"name": "数据模式",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
0,
60
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"Name of the Festival\": {\n \"type\": \"string\",\n \"description\": \"The common English name(s) of the Hindu festival.\"\n },\n \"Date\": {\n \"type\": \"string\",\n \"pattern\": \"^(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[0-2])/\\\\d{4}$\",\n \"description\": \"The date of the festival in DD/MM/YYYY format.\"\n },\n \"Short Description of the Festival\": {\n \"type\": \"string\",\n \"description\": \"A concise English description of the festival's significance and celebration.\"\n },\n \"Hindi Translation of the Description\": {\n \"type\": \"string\",\n \"description\": \"A concise Hindi translation of the festival's description.\"\n }\n },\n \"required\": [\n \"Name of the Festival\",\n \"Date\",\n \"Short Description of the Festival\",\n \"Hindi Translation of the Description\"\n ]\n },\n \"description\": \"A list of Hindu festivals with their names, dates, and short descriptions in both English and Hindi.\"\n}"
},
"typeVersion": 1.3
},
{
"id": "0743bd85-ad04-4c44-a6a0-69aad433fdd7",
"name": "转换以一次性添加所有数据",
"type": "n8n-nodes-base.code",
"position": [
200,
-180
],
"parameters": {
"jsCode": "return $json.output.map(festival => ({ json: festival }));"
},
"typeVersion": 2
},
{
"id": "d79d0959-22b2-4f02-b8ec-b38bc637aa94",
"name": "一次性添加所有行",
"type": "n8n-nodes-base.googleSheets",
"position": [
540,
-180
],
"parameters": {
"columns": {
"value": {
"Date": "={{ $json.Date }}",
"Hindi Description": "={{ $json['Hindi Translation of the Description'] }}",
"English Description ": "={{ $json['Short Description of the Festival'] }}",
"Name of the Festival": "={{ $json['Name of the Festival'] }}"
},
"schema": [
{
"id": "Name of the Festival",
"type": "string",
"display": true,
"required": false,
"displayName": "Name of the Festival",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Date",
"type": "string",
"display": true,
"required": false,
"displayName": "Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "English Description ",
"type": "string",
"display": true,
"required": false,
"displayName": "English Description ",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Hindi Description",
"type": "string",
"display": true,
"required": false,
"displayName": "Hindi Description",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zVvFDvCRSDbeKVTV4vLj3txSrCptaVFlVkulve7gi5s/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1zVvFDvCRSDbeKVTV4vLj3txSrCptaVFlVkulve7gi5s",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1zVvFDvCRSDbeKVTV4vLj3txSrCptaVFlVkulve7gi5s/edit?usp=drivesdk",
"cachedResultName": "n8n-test"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "ApSI2tCmuXKjcze5",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "cedfbf0a-9c3c-4323-b99e-50971f8795f8",
"name": "发布到 X",
"type": "n8n-nodes-base.twitter",
"position": [
760,
600
],
"parameters": {
"text": "={{ $json.output.text }}\n\n{{ $json.output.call_to_action }}\n\n{{ $json.output.hashtags }}",
"additionalFields": {}
},
"credentials": {
"twitterOAuth2Api": {
"id": "Ge2fd7WPI64XrxPE",
"name": "X account"
}
},
"typeVersion": 2
},
{
"id": "21d2fcc5-75ab-4333-a14d-151dd8d8f20e",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1060,
-280
],
"parameters": {
"width": 400,
"height": 260,
"content": "## 🟥 执行工作流"
},
"typeVersion": 1
},
{
"id": "6690b393-e9a5-4090-a0a9-a9dbd724fc92",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-580,
-340
],
"parameters": {
"width": 260,
"height": 320,
"content": "## 🟪 获取节日数据"
},
"typeVersion": 1
},
{
"id": "f247e949-96d2-4d9f-b8e7-0b2d5e97500d",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-240,
-380
],
"parameters": {
"width": 300,
"height": 360,
"content": "## 🔗 生成结构化数据"
},
"typeVersion": 1
},
{
"id": "7082b953-fdda-4d7b-b857-e52ef4c45e6d",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
120,
-340
],
"parameters": {
"height": 320,
"content": "## 🟧 转换数据"
},
"typeVersion": 1
},
{
"id": "d883cd80-fc5d-4ae8-be4a-3b82e0efe296",
"name": "获取节日数据",
"type": "n8n-nodes-base.httpRequest",
"position": [
-500,
-180
],
"parameters": {
"url": "https://r.jina.ai/https://www.calendarlabs.com/2025-hindu-calendar",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpBearerAuth"
},
"credentials": {
"httpBearerAuth": {
"id": "fJJ8zjLHZgbyfU7Y",
"name": "JinaAI Bearer"
}
},
"typeVersion": 4.2
},
{
"id": "b0b3cd42-d5f3-42fb-bcdd-551098a699a3",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
460,
-340
],
"parameters": {
"width": 260,
"height": 320,
"content": "## 🟩 填充Google Sheet"
},
"typeVersion": 1
},
{
"id": "95ccbbe9-84a2-47f1-b6f7-167c65786447",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1160,
-460
],
"parameters": {
"color": 5,
"width": 2020,
"height": 680,
"content": ""
},
"typeVersion": 1
},
{
"id": "020314f2-419f-4101-bc03-57a21feaa640",
"name": "便签6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1260,
480
],
"parameters": {
"width": 360,
"height": 260,
"content": "## 🔁 每日触发器"
},
"typeVersion": 1
},
{
"id": "54f1ff32-4048-4110-9115-731fa5d78ce0",
"name": "便签7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-840,
480
],
"parameters": {
"width": 260,
"height": 260,
"content": "## 📆 获取今日日期"
},
"typeVersion": 1
},
{
"id": "ab656067-7aed-49dd-8d88-588d682fb894",
"name": "便签8",
"type": "n8n-nodes-base.stickyNote",
"position": [
-540,
460
],
"parameters": {
"width": 260,
"height": 280,
"content": "## 🟩 匹配日期"
},
"typeVersion": 1
},
{
"id": "c6552300-bb7e-46ee-b310-56ff0ac21ccb",
"name": "便签9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-220,
460
],
"parameters": {
"width": 380,
"height": 280,
"content": "## 🧠 生成帖子"
},
"typeVersion": 1
},
{
"id": "a974a47e-c95a-46da-a869-dd81f68effbf",
"name": "便签10",
"type": "n8n-nodes-base.stickyNote",
"position": [
200,
460
],
"parameters": {
"width": 420,
"height": 280,
"content": "## 🧠 选择最佳帖子"
},
"typeVersion": 1
},
{
"id": "c115adcd-6424-4498-9fe3-8ad199caf376",
"name": "便利贴11",
"type": "n8n-nodes-base.stickyNote",
"position": [
660,
460
],
"parameters": {
"width": 300,
"height": 280,
"content": "## 🐦 发布到X (Twitter)"
},
"typeVersion": 1
},
{
"id": "2de18aee-64f8-4a63-a5df-af6579b7e4c0",
"name": "便签12",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1400,
380
],
"parameters": {
"color": 6,
"width": 2640,
"height": 640,
"content": ""
},
"typeVersion": 1
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "09b762fa-8df9-474e-8b41-75e27ba4805f",
"connections": {
"Generate Data": {
"ai_languageModel": [
[
{
"node": "Generate Structured Data",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Generate Posts": {
"main": [
[
{
"node": "Select Best Post",
"type": "main",
"index": 0
}
]
]
},
"Selector Model": {
"ai_languageModel": [
[
{
"node": "Select Best Post",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Generator Model": {
"ai_languageModel": [
[
{
"node": "Generate Posts",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Schema for Data": {
"ai_outputParser": [
[
{
"node": "Generate Structured Data",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Everyday Trigger": {
"main": [
[
{
"node": "Get Today's Date",
"type": "main",
"index": 0
}
]
]
},
"Get Today's Date": {
"main": [
[
{
"node": "Fetch Data of Matched Date",
"type": "main",
"index": 0
}
]
]
},
"Select Best Post": {
"main": [
[
{
"node": "Post to X",
"type": "main",
"index": 0
}
]
]
},
"Structured Posts": {
"ai_outputParser": [
[
{
"node": "Generate Posts",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Get Festival Data": {
"main": [
[
{
"node": "Generate Structured Data",
"type": "main",
"index": 0
}
]
]
},
"Generate Structured Data": {
"main": [
[
{
"node": "Transform to add all Data at once",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser1": {
"ai_outputParser": [
[
{
"node": "Select Best Post",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Fetch Data of Matched Date": {
"main": [
[
{
"node": "Generate Posts",
"type": "main",
"index": 0
}
]
]
},
"Transform to add all Data at once": {
"main": [
[
{
"node": "Add all Rows at once",
"type": "main",
"index": 0
}
]
]
},
"When clicking ‘Execute workflow’": {
"main": [
[
{
"node": "Get Festival Data",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 社交媒体, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
AI 电影短片生成器
使用 Gemini、GPT 和 ElevenLabs 将名言转换为社交媒体热门视频
If
Jwt
Set
+17
48 节点LukaszB
内容创作
AI生成LinkedIn帖子含人工审批
使用GPT-4、GoToHuman和Blotato的AI生成LinkedIn帖子含人工审批
Code
Merge
Filter
+10
19 节点Robert Breen
社交媒体
在可视化参考库中探索n8n节点
在可视化参考库中探索n8n节点
If
Ftp
Set
+93
113 节点I versus AI
其他
内容生成器 v3
AI驱动博客自动化:使用GPT-4生成并发布SEO文章至WordPress和Twitter
If
Set
Code
+25
144 节点Jay Emp0
内容创作
Apollo 数据抓取与触达流程 1 ✅
使用 Apollo、AI 解析和定时邮件跟进自动生成潜在客户
If
Code
Wait
+13
39 节点Deniz
内容创作
内容聚合
使用Gemini AI从网站文章自动化社交媒体帖子发布到LinkedIn和X/Twitter
If
Set
Xml
+16
34 节点Vadim
内容创作