Escritor y editor de blogs
Este es unContent Creation, Multimodal AIflujo de automatización del dominio deautomatización que contiene 18 nodos.Utiliza principalmente nodos como If, Code, Filter, Summarize, GoogleSheets. Editor de escritura y edición de blogs con memoria basada en Google Sheets (GPT-4)
- •Credenciales de API de Google Sheets
- •Clave de API de OpenAI
Nodos utilizados (18)
Categoría
{
"meta": {
"instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "817d6ddb-2cf6-4505-9ddb-22c55de574f2",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-368,
1488
],
"parameters": {
"jsonSchemaExample": "{\n\t\"items\": 5, \n \"session\": \"sessionid\",\n \"blog\": \"blog\"\n}"
},
"typeVersion": 1.3
},
{
"id": "f0ab2c2d-16b6-4f83-8648-dc7e162bf60b",
"name": "Modelo de chat OpenAI2",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-912,
1520
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-5",
"cachedResultName": "gpt-5"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "4l6TDfLZVFS24g3X",
"name": "OpenAi account 4"
}
},
"typeVersion": 1.2
},
{
"id": "1577bd89-b6b4-4c5c-a8cd-39e7ca7bc2cc",
"name": "Simple Memoria",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
-544,
1408
],
"parameters": {
"contextWindowLength": 10
},
"typeVersion": 1.3
},
{
"id": "8053e2f5-5042-4d54-826b-dc80fb11cbb9",
"name": "When Executed by Another Workflow",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
176,
1440
],
"parameters": {
"inputSource": "passthrough"
},
"typeVersion": 1.1
},
{
"id": "4537aa85-c0f3-4a24-9d76-5e524bbba647",
"name": "google",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"position": [
0,
1456
],
"parameters": {
"source": "parameter",
"description": "call this tool to count the number of rows for the session id. pass only the session id to the tool",
"workflowJson": "{\n \"nodes\": [\n {\n \"parameters\": {\n \"inputSource\": \"passthrough\"\n },\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"typeVersion\": 1.1,\n \"position\": [\n 1040,\n 1152\n ],\n \"id\": \"8053e2f5-5042-4d54-826b-dc80fb11cbb9\",\n \"name\": \"When Executed by Another Workflow\"\n },\n {\n \"parameters\": {\n \"documentId\": {\n \"__rl\": true,\n \"value\": \"1NwnABaQIReMmG2sRGrC-lv-5kpmsKJkUlRm-KmvPsCE\",\n \"mode\": \"list\",\n \"cachedResultName\": \"n8n Memory\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1NwnABaQIReMmG2sRGrC-lv-5kpmsKJkUlRm-KmvPsCE/edit?usp=drivesdk\"\n },\n \"sheetName\": {\n \"__rl\": true,\n \"value\": \"gid=0\",\n \"mode\": \"list\",\n \"cachedResultName\": \"Sheet1\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1NwnABaQIReMmG2sRGrC-lv-5kpmsKJkUlRm-KmvPsCE/edit#gid=0\"\n },\n \"options\": {}\n },\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"typeVersion\": 4.7,\n \"position\": [\n 1232,\n 1152\n ],\n \"id\": \"9df87454-5e48-494f-af01-82197750341f\",\n \"name\": \"Get row(s) in sheet\",\n \"alwaysOutputData\": true,\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"HlBW2puZbuCCq8jJ\",\n \"name\": \"Google Sheets account 3\"\n }\n }\n },\n {\n \"parameters\": {\n \"fieldsToSummarize\": {\n \"values\": [\n {\n \"field\": \"row_number\"\n }\n ]\n },\n \"options\": {}\n },\n \"type\": \"n8n-nodes-base.summarize\",\n \"typeVersion\": 1.1,\n \"position\": [\n 1648,\n 1152\n ],\n \"id\": \"0ab8f131-b8ec-44f1-851f-0c08d202cf4e\",\n \"name\": \"Summarize1\",\n \"alwaysOutputData\": true\n },\n {\n \"parameters\": {\n \"conditions\": {\n \"options\": {\n \"caseSensitive\": true,\n \"leftValue\": \"\",\n \"typeValidation\": \"strict\",\n \"version\": 2\n },\n \"conditions\": [\n {\n \"id\": \"2278feea-3c0a-407b-84dc-5d6c0591fde9\",\n \"leftValue\": \"={{ $json.session }}\",\n \"rightValue\": \"={{ $('When Executed by Another Workflow').item.json.query }}\",\n \"operator\": {\n \"type\": \"string\",\n \"operation\": \"equals\",\n \"name\": \"filter.operator.equals\"\n }\n }\n ],\n \"combinator\": \"and\"\n },\n \"options\": {}\n },\n \"type\": \"n8n-nodes-base.filter\",\n \"typeVersion\": 2.2,\n \"position\": [\n 1440,\n 1152\n ],\n \"id\": \"ff5158fd-60bb-4a43-b8f9-c07971c03fe5\",\n \"name\": \"Filter\",\n \"alwaysOutputData\": true\n }\n ],\n \"connections\": {\n \"When Executed by Another Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"Get row(s) in sheet\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Get row(s) in sheet\": {\n \"main\": [\n [\n {\n \"node\": \"Filter\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Filter\": {\n \"main\": [\n [\n {\n \"node\": \"Summarize1\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n },\n \"pinData\": {\n \"When Executed by Another Workflow\": [\n {\n \"query\": \"ccde0f38fdeb4b64a49f541041ec64f1\"\n }\n ]\n },\n \"meta\": {\n \"templateCredsSetupCompleted\": true,\n \"instanceId\": \"ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9\"\n }\n}"
},
"typeVersion": 2.2
},
{
"id": "0ab8f131-b8ec-44f1-851f-0c08d202cf4e",
"name": "Resumir1",
"type": "n8n-nodes-base.summarize",
"position": [
688,
1440
],
"parameters": {
"options": {},
"fieldsToSummarize": {
"values": [
{
"field": "row_number"
}
]
}
},
"typeVersion": 1.1,
"alwaysOutputData": true
},
{
"id": "ff5158fd-60bb-4a43-b8f9-c07971c03fe5",
"name": "Filtrar",
"type": "n8n-nodes-base.filter",
"position": [
528,
1440
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2278feea-3c0a-407b-84dc-5d6c0591fde9",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.session }}",
"rightValue": "={{ $('When Executed by Another Workflow').item.json.query }}"
}
]
}
},
"typeVersion": 2.2,
"alwaysOutputData": true
},
{
"id": "20311124-4a86-4116-8c0b-168e2ef607e0",
"name": "Nota adhesiva6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1552,
624
],
"parameters": {
"width": 400,
"height": 1072,
"content": "\n## ⚙️ Setup Instructions\n\n### 1️⃣ Set Up OpenAI Connection\n1. Go to [OpenAI Platform](https://platform.openai.com/api-keys) \n2. Navigate to [OpenAI Billing](https://platform.openai.com/settings/organization/billing/overview) \n3. Add funds to your billing account \n4. Copy your API key into the **OpenAI credentials** in n8n\n\n### 2️⃣ Prepare Your Google Sheet\n#### Connect your Data in Google Sheets\n- Use this format: **[Sample Sheet](https://docs.google.com/spreadsheets/d/1NwnABaQIReMmG2sRGrC-lv-5kpmsKJkUlRm-KmvPsCE/edit?gid=0#gid=0)**\n- Row 1 = **column names** (e.g., `session`, `Rows`, `output`)\n- Data in rows **2–100** (or more if you prefer)\n- In n8n, use **Google Sheets OAuth2** → pick your **Spreadsheet** and **Worksheet**\n- (Optional) You can adapt this to **Airtable**, **Notion**, or a **Database**\n## 🧠 How It Works\n- **Chat Trigger**: Provide a topic (write) or paste existing text (reword). \n- **Code Node (“Choose to Write or Edit Blog”)**: \n - Builds a `system_prompt` + `user_prompt` \n - Instructs the agent to call the **Google tool** (sub-workflow) **with only the `sessionid`** to count existing rows. \n- **Tool Workflow (“google”)**: \n - Fetches rows from the sheet → **filters by `session`** → **summarizes row count**. \n- **Agent (“Blog Writer & Editor”)**: \n - Returns **structured JSON** (items/rows, session, blog body). \n- **Store (Google Sheets)**: \n - Appends `{ session, Rows, output }` to the sheet. \n- **If Node**: \n - Example rule: `Rows > 3` → branch/limit/notify as needed.\n\n## 📬 Contact\nNeed help tailoring this to Airtable/Notion/DB, or adding auto-publishing?\n\n- 📧 **robert@ynteractive.com** \n- 🔗 **[Robert Breen](https://www.linkedin.com/in/robert-breen-29429625/)** \n- 🌐 **[ynteractive.com](https://ynteractive.com)**"
},
"typeVersion": 1
},
{
"id": "355d3a9e-3bcd-4734-ad71-2f3c1254ed2f",
"name": "Nota adhesiva55",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1120,
624
],
"parameters": {
"color": 7,
"width": 2032,
"height": 1072,
"content": "# ✍️ AI Blog Writer & Editor with Google Sheets Memory (n8n + OpenAI)\n\nChat to **write** or **reword** a blog post. The workflow stores each result in Google Sheets and uses a sub-workflow “Google tool” to **count rows per session** (your running context). If a session exceeds a row threshold, the flow can branch (e.g., stop or notify).\n"
},
"typeVersion": 1
},
{
"id": "111dcbb9-73a9-49e6-9c53-b861cf37df5b",
"name": "Nota adhesiva2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
1328
],
"parameters": {
"color": 3,
"width": 912,
"height": 304,
"content": "## Google Sub-workflow-tool\n Count number of times the blog was written and edited **Dont forget to update this google sheet as well**\n"
},
"typeVersion": 1
},
{
"id": "8d974459-83a5-4b2b-b57b-9df1bda22196",
"name": "Nota adhesiva7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1008,
1328
],
"parameters": {
"color": 3,
"width": 288,
"height": 304,
"content": "### 1️⃣ Set Up OpenAI Connection\n1. Go to [OpenAI Platform](https://platform.openai.com/api-keys) \n2. Navigate to [OpenAI Billing](https://platform.openai.com/settings/organization/billing/overview) \n3. Add funds to your billing account \n4. Copy your API key into the **OpenAI credentials** in n8n "
},
"typeVersion": 1
},
{
"id": "045e87e8-da89-495e-bfb6-cdb0bc8d45d5",
"name": "Blog Writer & Editor",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-656,
1040
],
"parameters": {
"text": "={{ $json.user_prompt }}",
"options": {
"systemMessage": "={{ $json.system_prompt }}"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2.2
},
{
"id": "a3218909-349f-4f26-8403-1c8fd8d38c44",
"name": "Choose to Write or Edit Blog",
"type": "n8n-nodes-base.code",
"position": [
-768,
832
],
"parameters": {
"jsCode": "// Code node: build prompts using fields from \"When chat message received\"\n// Behavior:\n// - If `output` exists => system: \"Reword the blog...\" ; user prompt uses `output` + `sessionId`\n// - Else => system: \"Write a blog...\" ; user prompt uses `chatInput` + `sessionId`\n// Both instruct to use the Google tool (sub-workflow) to count rows, passing ONLY the session id.\n//\n// Output fields:\n// - system_prompt\n// - user_prompt\n\n// Pull from the trigger node if needed\nconst triggerItems = $items('Ask about blog topic', 0, 0) || [];\nconst trigger = triggerItems[0]?.json || {};\n\nconst schemaExample = JSON.stringify(\n { items: 5, session: \"sessionid\", blog: \"blog\" },\n null,\n 0\n);\n\nreturn items.map(item => {\n const j = item.json || {};\n\n // Resolve chat and session from either the current item or the trigger node\n const chatInput = j.chatInput ?? j.chat ?? trigger.chatInput ?? \"\";\n const sessionId = j.sessionId ?? j.sessionid ?? trigger.sessionId ?? \"\";\n\n const hasOutput =\n j.output !== undefined &&\n j.output !== null &&\n String(j.output).trim() !== \"\";\n\n if (hasOutput) {\n // Reword existing blog\n item.json.system_prompt =\n \"Reword the blog. Use the Google tool (sub-workflow) to count how many rows exist for this session. Pass ONLY the session id to the Google tool. it will send back the number.Include the session id from the input. Return ONLY valid JSON with the required keys.\";\n item.json.user_prompt = [\n `sessionid: ${sessionId}`,\n `blog_to_reword: \"\"\"${String(j.output)}\"\"\"`,\n `Respond as JSON exactly like: ${schemaExample}`\n ].join(\"\\n\");\n } else {\n // Write a new blog from chat\n item.json.system_prompt =\n \"Write a blog. Use the Google tool (sub-workflow) to see how many rows exist for this session. Pass ONLY the session id to the Google tool. it will send back the number. Include the session id from the input. Return ONLY valid JSON with the required keys.\";\n item.json.user_prompt = [\n `sessionid: ${sessionId}`,\n `blog_topic_or_chat: \"\"\"${String(chatInput)}\"\"\"`,\n `Respond as JSON exactly like: ${schemaExample}`\n ].join(\"\\n\");\n }\n\n // Optional debug\n item.json._resolved = { sessionId, chatInput, fromTrigger: !!triggerItems.length };\n\n return item;\n});\n"
},
"typeVersion": 2
},
{
"id": "6eec6156-3360-4caa-b9bd-92dbdb289dce",
"name": "Nota adhesiva10",
"type": "n8n-nodes-base.stickyNote",
"position": [
-304,
768
],
"parameters": {
"color": 3,
"width": 352,
"height": 384,
"content": "### 2️⃣ Prepare Your Google Sheet\n#### Connect your Data in Google Sheets\n- Use this format: **[Sample Sheet](https://docs.google.com/spreadsheets/d/1NwnABaQIReMmG2sRGrC-lv-5kpmsKJkUlRm-KmvPsCE/edit?gid=0#gid=0)**\n- Row 1 = **column names** (e.g., `session`, `Rows`, `output`)\n- Data in rows **2–100** (or more if you prefer)\n- In n8n, use **Google Sheets OAuth2** → pick your **Spreadsheet** and **Worksheet**\n- (Optional) You can adapt this to **Airtable**, **Notion**, or a **Database**"
},
"typeVersion": 1
},
{
"id": "bbb5baca-6411-4d41-8530-3aff0a228513",
"name": "Ask about blog topic",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-1040,
816
],
"webhookId": "d38a0072-420b-4de8-86b6-03a8f9a6e254",
"parameters": {
"options": {}
},
"typeVersion": 1.3
},
{
"id": "7f76b93d-b4aa-461a-8789-be99f54660fa",
"name": "n8n History",
"type": "n8n-nodes-base.googleSheets",
"position": [
-176,
1024
],
"parameters": {
"columns": {
"value": {
"Rows": "={{ $json.output.items }}",
"output": "={{ $json.output.blog }}",
"session": "={{ $json.output.session }}"
},
"schema": [
{
"id": "session",
"type": "string",
"display": true,
"required": false,
"displayName": "session",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "output",
"type": "string",
"display": true,
"required": false,
"displayName": "output",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Rows",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Rows",
"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/1NwnABaQIReMmG2sRGrC-lv-5kpmsKJkUlRm-KmvPsCE/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1NwnABaQIReMmG2sRGrC-lv-5kpmsKJkUlRm-KmvPsCE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1NwnABaQIReMmG2sRGrC-lv-5kpmsKJkUlRm-KmvPsCE/edit?usp=drivesdk",
"cachedResultName": "n8n Memory"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "HlBW2puZbuCCq8jJ",
"name": "Google Sheets account 3"
}
},
"typeVersion": 4.7
},
{
"id": "5d61f20f-c559-431f-9fbf-ddbd764c77d6",
"name": "Check if Ran 4+ times",
"type": "n8n-nodes-base.if",
"position": [
240,
1088
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "6dd3ba6e-400a-45bf-80d7-830594683094",
"operator": {
"type": "number",
"operation": "gt"
},
"leftValue": "={{ $json.Rows }}",
"rightValue": 3
}
]
}
},
"typeVersion": 2.2
},
{
"id": "9df87454-5e48-494f-af01-82197750341f",
"name": "Get History",
"type": "n8n-nodes-base.googleSheets",
"position": [
352,
1440
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1NwnABaQIReMmG2sRGrC-lv-5kpmsKJkUlRm-KmvPsCE/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1NwnABaQIReMmG2sRGrC-lv-5kpmsKJkUlRm-KmvPsCE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1NwnABaQIReMmG2sRGrC-lv-5kpmsKJkUlRm-KmvPsCE/edit?usp=drivesdk",
"cachedResultName": "n8n Memory"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "HlBW2puZbuCCq8jJ",
"name": "Google Sheets account 3"
}
},
"typeVersion": 4.7,
"alwaysOutputData": true
}
],
"pinData": {
"When Executed by Another Workflow": [
{
"query": "ccde0f38fdeb4b64a49f541041ec64f1"
}
]
},
"connections": {
"Filter": {
"main": [
[
{
"node": "Summarize1",
"type": "main",
"index": 0
}
]
]
},
"4537aa85-c0f3-4a24-9d76-5e524bbba647": {
"ai_tool": [
[
{
"node": "045e87e8-da89-495e-bfb6-cdb0bc8d45d5",
"type": "ai_tool",
"index": 0
}
]
]
},
"9df87454-5e48-494f-af01-82197750341f": {
"main": [
[
{
"node": "Filter",
"type": "main",
"index": 0
}
]
]
},
"7f76b93d-b4aa-461a-8789-be99f54660fa": {
"main": [
[
{
"node": "5d61f20f-c559-431f-9fbf-ddbd764c77d6",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "045e87e8-da89-495e-bfb6-cdb0bc8d45d5",
"type": "ai_memory",
"index": 0
}
]
]
},
"OpenAI Chat Model2": {
"ai_languageModel": [
[
{
"node": "045e87e8-da89-495e-bfb6-cdb0bc8d45d5",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"bbb5baca-6411-4d41-8530-3aff0a228513": {
"main": [
[
{
"node": "a3218909-349f-4f26-8403-1c8fd8d38c44",
"type": "main",
"index": 0
}
]
]
},
"045e87e8-da89-495e-bfb6-cdb0bc8d45d5": {
"main": [
[
{
"node": "7f76b93d-b4aa-461a-8789-be99f54660fa",
"type": "main",
"index": 0
}
]
]
},
"5d61f20f-c559-431f-9fbf-ddbd764c77d6": {
"main": [
[],
[
{
"node": "a3218909-349f-4f26-8403-1c8fd8d38c44",
"type": "main",
"index": 0
}
]
]
},
"817d6ddb-2cf6-4505-9ddb-22c55de574f2": {
"ai_outputParser": [
[
{
"node": "045e87e8-da89-495e-bfb6-cdb0bc8d45d5",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"a3218909-349f-4f26-8403-1c8fd8d38c44": {
"main": [
[
{
"node": "045e87e8-da89-495e-bfb6-cdb0bc8d45d5",
"type": "main",
"index": 0
}
]
]
},
"8053e2f5-5042-4d54-826b-dc80fb11cbb9": {
"main": [
[
{
"node": "9df87454-5e48-494f-af01-82197750341f",
"type": "main",
"index": 0
}
]
]
}
}
}¿Cómo usar este flujo de trabajo?
Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.
¿En qué escenarios es adecuado este flujo de trabajo?
Avanzado - Creación de contenido, IA Multimodal
¿Es de pago?
Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.
Flujos de trabajo relacionados recomendados
Robert Breen
@rbreenProfessional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.
Compartir este flujo de trabajo