This workflow corresponds to n8n.io template #4828 — we link there as the canonical source.
This workflow follows the Form → Form Trigger 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 →
{
"id": "695TIBUSAmJfHXun",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Writing Articles - New",
"tags": [],
"nodes": [
{
"id": "b25624fb-0f62-4843-a895-186dcde46e98",
"name": "On form submission",
"type": "n8n-nodes-base.formTrigger",
"position": [
-100,
-280
],
"parameters": {
"options": {},
"formTitle": "\u0643\u062a\u0627\u0628\u0629 \u0645\u0642\u0627\u0644",
"formFields": {
"values": [
{
"fieldLabel": "KW",
"requiredField": true
},
{
"fieldLabel": "Article's Title"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "ecb65485-28b8-46db-94ee-d5b55ff3f101",
"name": "Split Out",
"type": "n8n-nodes-base.splitOut",
"position": [
640,
-280
],
"parameters": {
"options": {},
"fieldToSplitOut": "message.content.queries"
},
"typeVersion": 1
},
{
"id": "b72ea761-08c3-4c07-a149-434affefd068",
"name": "Aggregate",
"type": "n8n-nodes-base.aggregate",
"position": [
1260,
-280
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "message.content"
}
]
}
},
"typeVersion": 1
},
{
"id": "bd027eb0-7179-4615-a7a0-ef93020b3bbb",
"name": "Prmopts For Search",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
280,
-280
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1",
"cachedResultName": "GPT-4.1"
},
"options": {},
"messages": {
"values": [
{
"role": "system",
"content": "You are an expert content researcher.\n\nBased on the provided **keyword**, your task is to generate **three detailed research prompts**, each covering a **different informational angle** of the topic.\n\nEach prompt must be a **comprehensive, natural-language query** designed to help an AI search engine (e.g., Perplexity AI) retrieve valuable, insightful, and high-quality information for article writing.\n\nThe three prompts should be written in **clear English**, and each one should focus on a **different research angle.**\n\nAll three prompts should be written in a **logical funnel structure,** progressing from general understanding to deeper insights.\n\nReturn only the following JSON structure:\n\n```json\n{\n \"keyword\": \"[insert keyword here]\",\n \"queries\": [\n \"Prompt 1\",\n \"Prompt 2\",\n \"Prompt 3\"\n ]\n}\n\n```"
},
{
"content": "=Keyword:\n\n{{ $('On form submission').item.json.KW }}\n\nArticle's Title:\n\n{{ $('On form submission').item.json['Article\\'s Title'] }}\n\nPlease Respond only in English."
}
]
},
"jsonOutput": true
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "3ae7b855-715b-4298-a2dc-a29d24f372ca",
"name": "Sonar - Search",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
880,
-280
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "id",
"value": "perplexity/sonar-pro"
},
"options": {},
"messages": {
"values": [
{
"content": "={{ $json['message.content.queries'] }}"
}
]
}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "8b9a40a8-bbe0-42be-b46a-14a8d5686cf9",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-180,
-380
],
"parameters": {
"width": 1640,
"height": 380,
"content": "## Research\n"
},
"typeVersion": 1
},
{
"id": "582ce887-713a-47e3-bbe0-d0b27eb84553",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
340,
480
],
"parameters": {
"color": 6,
"width": 860,
"height": 380,
"content": "## Outline\n"
},
"typeVersion": 1
},
{
"id": "86b33453-3f7a-42ce-ba8c-f5e7b1b3733c",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
360,
960
],
"parameters": {
"color": 3,
"width": 820,
"height": 320,
"content": "## Writing The Article\n"
},
"typeVersion": 1
},
{
"id": "3f3896ad-0734-4343-918a-a444e6565415",
"name": "Make An Outline",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
520,
600
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1",
"cachedResultName": "GPT-4.1"
},
"options": {},
"messages": {
"values": [
{
"role": "system",
"content": "You are an expert SEO content strategist.\n\nYour task is to generate a structured, SEO-optimized outline for an article that fully addresses the search intent behind the provided keyword.\n\nThe outline should help a writer produce high-quality content based on the structure and essential information you provide.\n\nMake the outline as detailed and comprehensive as possible. It should be suitable for writing a long-form, in-depth article, not a short or surface-level piece.\n\n---\n\n### **Methodology**\n\n### 1. Start with the Reader\u2019s Journey\n\n- Think of the article as a **funnel** \u2014 guide the reader step by step, from awareness to understanding, to depth, and finally to action or resolution.\n- Ensure each H2 section is **logically connected** to the one before it, forming a clear, natural narrative progression.\n- The **second H2 section** after the introduction must **directly answer the primary search intent** of the keyword.\n- Each H2 section must connect narratively to the previous one. The outline should flow as a continuous reader journey \u2014 like a funnel \u2014 starting with awareness, then understanding, followed by challenges/solutions, and ending in resolution.\n\n---\n\n### **H2 Structure Guidelines**\n\n- Break the outline into **main sections (H2s)** written in **question format** (3\u20135 words max).\n- The first H2 must always be \"\u0627\u0644\u0645\u0642\u062f\u0645\u0629\" and must clearly follow one of the following content strategies: PAS, AIDA, BAB, or RAD. The strategy used must be explicitly labeled inside the H2 heading (e.g., \"\u0627\u0644\u0645\u0642\u062f\u0645\u0629 (AIDA - 2 paragraphs)\").\n- Include at least one dedicated **FAQ section** and a final **Conclusion** section.\n- After each H2 heading, specify the **expected format** in parentheses (e.g., intro, 2\u20133 paragraphs, list + explanation, etc.).\n- Only assign a format to an H2 if it contains no H3s. If the H2 includes H3s, leave its format blank to avoid conflict.\n- Use the main keyword or its variations inside H2s for SEO performance.\n\n---\n\n### **H3 Structure Guidelines**\n\n- Add **supporting H3s** under each H2 \u2014 also in **short question format** (3\u20135 words max).\n- After each H3, specify the **expected format** (e.g., single paragraph, paragraph + bullet points).\n- Each H3 must focus on a unique sub-topic that directly supports the H2.\n- Ensure that each H3 is **a natural and functional sub-question** of its H2 \u2014 it must **directly break down, clarify, or expand the parent H2 topic** without shifting focus or introducing unrelated sub-themes.\n- Prioritize questions that reflect **real user queries**.\n- Avoid repeating ideas across sections.\n\n---\n\n### **Information Requirement**\n\n- Under each **H2**, include an `\"info\"` field that lists **all detailed information points** required for writing \u2014 avoid summaries or generalizations. Include **every factual detail** necessary to fully cover the section, as if you\u2019re feeding a writer everything they need without assuming prior knowledge.\n- Each point should be **detailed, complete, and directly usable** for content generation \u2014 no summaries or simplifications.\n- These points are meant to **guide the writer** \u2014 they must be accurate, specific, and actionable, without invented or vague content.\n\n---\n\n### **General Rules**\n\n- Ensure the structure is **SEO-friendly**, clear, and skimmable.\n- Keep headings short, natural, and phrased like real search queries.\n- The full outline must read like a **guided narrative** \u2014 funneling the reader through a structured journey from intro to resolution.\n- Match the outline to the **article type**: product-based, how-to, comparison, informational, or thought leadership.\n- Avoid generic or duplicate sections.\n- WRITE your outline in Arabic and the **format in English** (like the example below).\n\n---\n\n### Final Output Format\n\n- Do not include any explanation or headers \u2014 just return the JSON.\n- The final output must be in **JSON** format with this structure (just the structure, not its content ideas):\n\n```json\n{\n \"title\": \"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0645\u0642\u0627\u0644\",\n \"outline\": [\n {\n \"h2\": \"\u0627\u0644\u0645\u0642\u062f\u0645\u0629 (2 paragraphs)\",\n \"h3\": [],\n \"info\": [\n \"\u064a\u064f\u0639\u062f [\u0627\u0644\u0645\u0648\u0636\u0648\u0639] \u0645\u0646 \u0623\u0628\u0631\u0632 \u0627\u0644\u0623\u062f\u0648\u0627\u062a \u0627\u0644\u062d\u062f\u064a\u062b\u0629 \u0627\u0644\u062a\u064a \u062a\u0644\u0628\u064a \u0627\u062d\u062a\u064a\u0627\u062c\u0627\u062a \u0645\u062e\u062a\u0644\u0641\u0629 \u0641\u064a \u0645\u062c\u0627\u0644\u0627\u062a \u0627\u0644\u0623\u0639\u0645\u0627\u0644 \u0648\u0627\u0644\u062a\u0642\u0646\u064a\u0629.\",\n \"\u0623\u0635\u0628\u062d \u0647\u0630\u0627 \u0627\u0644\u0646\u0638\u0627\u0645 \u0634\u0627\u0626\u0639\u064b\u0627 \u0628\u0641\u0636\u0644 \u0645\u0631\u0648\u0646\u062a\u0647 \u0648\u0633\u0647\u0648\u0644\u0629 \u0627\u0633\u062a\u062e\u062f\u0627\u0645\u0647\u060c \u0648\u0642\u062f \u062a\u0645 \u0627\u0639\u062a\u0645\u0627\u062f\u0647 \u0641\u064a \u0634\u0631\u0643\u0627\u062a \u0639\u0627\u0644\u0645\u064a\u0629 \u0645\u062b\u0644 Google \u0648Amazon \u0644\u062a\u062d\u0642\u064a\u0642 \u0646\u062a\u0627\u0626\u062c \u062a\u0634\u063a\u064a\u0644\u064a\u0629 \u0645\u0644\u0645\u0648\u0633\u0629.\",\n \"\u0627\u0644\u0645\u0642\u0627\u0644 \u0645\u0648\u062c\u0647 \u0644\u0644\u0645\u062d\u062a\u0631\u0641\u064a\u0646\u060c \u0645\u062f\u064a\u0631\u064a \u0627\u0644\u0645\u0634\u0627\u0631\u064a\u0639\u060c \u0648\u0627\u0644\u0645\u0628\u062a\u062f\u0626\u064a\u0646 \u0627\u0644\u0630\u064a\u0646 \u064a\u0628\u062d\u062b\u0648\u0646 \u0639\u0646 \u0648\u0633\u064a\u0644\u0629 \u0641\u0639\u0627\u0644\u0629 \u0644\u062a\u062d\u0633\u064a\u0646 \u0623\u062f\u0627\u0626\u0647\u0645 \u0623\u0648 \u0623\u062a\u0645\u062a\u0629 \u0623\u0639\u0645\u0627\u0644\u0647\u0645.\",\n \"\u0633\u064a\u062a\u0639\u0631\u0641 \u0627\u0644\u0642\u0627\u0631\u0626 \u0639\u0644\u0649 \u0622\u0644\u064a\u0629 \u0639\u0645\u0644 [\u0627\u0644\u0645\u0648\u0636\u0648\u0639]\u060c \u0641\u0648\u0627\u0626\u062f\u0647\u060c \u062a\u062d\u062f\u064a\u0627\u062a\u0647\u060c \u0648\u0643\u064a\u0641\u064a\u0629 \u0645\u0642\u0627\u0631\u0646\u062a\u0647 \u0628\u0627\u0644\u0628\u062f\u0627\u0626\u0644 \u0627\u0644\u0645\u0637\u0631\u0648\u062d\u0629 \u0641\u064a \u0627\u0644\u0633\u0648\u0642.\"\n ]\n },\n {\n \"h2\": \"\u0645\u0627 \u0647\u0648 [\u0627\u0644\u0645\u0648\u0636\u0648\u0639]\u061f\",\n \"h3\": [\n \"\u0643\u064a\u0641 \u064a\u0639\u0645\u0644\u061f (2 paragraphs)\",\n \"\u0645\u0645 \u064a\u062a\u0643\u0648\u0646\u061f (bullet points + details)\"\n ],\n \"info\": [\n \"[\u0627\u0644\u0645\u0648\u0636\u0648\u0639] \u0647\u0648 \u0646\u0638\u0627\u0645 \u0623\u0648 \u0623\u062f\u0627\u0629 \u062a\u064f\u0633\u062a\u062e\u062f\u0645 \u0644\u0623\u062a\u0645\u062a\u0629 \u0623\u0648 \u062a\u0633\u0631\u064a\u0639 \u0639\u0645\u0644\u064a\u0627\u062a \u0645\u0639\u064a\u0646\u0629 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u062a\u0642\u0646\u064a\u0627\u062a \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064a \u0623\u0648 \u0627\u0644\u062e\u0648\u0627\u0631\u0632\u0645\u064a\u0627\u062a \u0627\u0644\u0630\u0643\u064a\u0629.\",\n \"\u064a\u0639\u062a\u0645\u062f \u0639\u0644\u0649 \u062c\u0645\u0639 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a\u060c \u062a\u062d\u0644\u064a\u0644\u0647\u0627\u060c \u062b\u0645 \u062a\u0646\u0641\u064a\u0630 \u0625\u062c\u0631\u0627\u0621\u0627\u062a \u062a\u0644\u0642\u0627\u0626\u064a\u0629 \u0645\u0628\u0646\u064a\u0629 \u0639\u0644\u0649 \u0646\u062a\u0627\u0626\u062c \u0627\u0644\u062a\u062d\u0644\u064a\u0644.\",\n \"\u064a\u062a\u0643\u0648\u0646 \u0645\u0646 \u0648\u0627\u062c\u0647\u0629 \u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0631\u0633\u0648\u0645\u064a\u0629\u060c \u0642\u0627\u0639\u062f\u0629 \u0628\u064a\u0627\u0646\u0627\u062a\u060c \u0648\u062d\u062f\u0629 \u062a\u062d\u0644\u064a\u0644\u060c \u0648\u0646\u0638\u0627\u0645 \u062a\u0643\u0627\u0645\u0644 API.\",\n \"\u064a\u062f\u0645\u062c [\u0627\u0644\u0645\u0648\u0636\u0648\u0639] \u0628\u064a\u0646 \u062a\u0642\u0646\u064a\u0627\u062a \u0645\u062b\u0644 \u062a\u0639\u0644\u0645 \u0627\u0644\u0622\u0644\u0629 \u0648\u0627\u0644\u062d\u0648\u0633\u0628\u0629 \u0627\u0644\u0633\u062d\u0627\u0628\u064a\u0629 \u0644\u062a\u062d\u0642\u064a\u0642 \u0623\u062f\u0627\u0621 \u0639\u0627\u0644\u064a \u0627\u0644\u0643\u0641\u0627\u0621\u0629.\"\n ]\n },\n {\n \"h2\": \"\u0645\u0627 \u0641\u0648\u0627\u0626\u062f \u0627\u0633\u062a\u062e\u062f\u0627\u0645 [\u0627\u0644\u0645\u0648\u0636\u0648\u0639]\u061f\",\n \"h3\": [\n \"\u062a\u062d\u0633\u064a\u0646 \u0627\u0644\u0625\u0646\u062a\u0627\u062c\u064a\u0629 (paragraph + data)\",\n \"\u062a\u0642\u0644\u064a\u0644 \u0627\u0644\u0623\u062e\u0637\u0627\u0621 \u0627\u0644\u0628\u0634\u0631\u064a\u0629 (1 paragraph)\",\n \"\u062f\u0639\u0645 \u0627\u062a\u062e\u0627\u0630 \u0627\u0644\u0642\u0631\u0627\u0631 (paragraph + example)\"\n ],\n \"info\": [\n \"\u062a\u0634\u064a\u0631 \u062f\u0631\u0627\u0633\u0629 \u0645\u0646 McKinsey \u0625\u0644\u0649 \u0623\u0646 \u0627\u0639\u062a\u0645\u0627\u062f \u0647\u0630\u0627 \u0627\u0644\u0646\u0648\u0639 \u0645\u0646 \u0627\u0644\u0623\u062f\u0648\u0627\u062a \u064a\u0624\u062f\u064a \u0625\u0644\u0649 \u062a\u062d\u0633\u064a\u0646 \u0627\u0644\u0625\u0646\u062a\u0627\u062c\u064a\u0629 \u0628\u0646\u0633\u0628\u0629 \u062a\u0635\u0644 \u0625\u0644\u0649 40% \u0641\u064a \u0641\u0631\u0642 \u0627\u0644\u0639\u0645\u0644 \u0627\u0644\u062a\u0642\u0646\u064a\u0629.\",\n \"\u064a\u064f\u0642\u0644\u0644 \u0645\u0646 \u062a\u062f\u062e\u0644 \u0627\u0644\u0625\u0646\u0633\u0627\u0646 \u0641\u064a \u0627\u0644\u0639\u0645\u0644\u064a\u0627\u062a \u0627\u0644\u062a\u0643\u0631\u0627\u0631\u064a\u0629\u060c \u0645\u0627 \u064a\u0642\u0644\u0644 \u0645\u0646 \u0645\u0639\u062f\u0644 \u0627\u0644\u0623\u062e\u0637\u0627\u0621 \u0628\u0646\u0633\u0628\u0629 \u062a\u0635\u0644 \u0625\u0644\u0649 60%.\",\n \"\u064a\u064f\u0645\u0643\u0646 \u062f\u0645\u062c\u0647 \u0645\u0639 \u0623\u062f\u0648\u0627\u062a \u062a\u062d\u0644\u064a\u0644 \u0628\u064a\u0627\u0646\u0627\u062a \u0644\u062a\u0642\u062f\u064a\u0645 \u062a\u0648\u0635\u064a\u0627\u062a \u0641\u0648\u0631\u064a\u0629 \u062a\u062f\u0639\u0645 \u0627\u0644\u0642\u0631\u0627\u0631\u0627\u062a \u0627\u0644\u0627\u0633\u062a\u0631\u0627\u062a\u064a\u062c\u064a\u0629\u060c \u0643\u0645\u0627 \u062a\u0645 \u062a\u0637\u0628\u064a\u0642\u0647 \u0628\u0646\u062c\u0627\u062d \u0641\u064a \u0634\u0631\u0643\u0629 X \u0644\u062a\u062d\u0633\u064a\u0646 \u0642\u0631\u0627\u0631\u0627\u062a \u0627\u0644\u0645\u0628\u064a\u0639\u0627\u062a.\",\n \"\u064a\u0648\u0641\u0631 \u0627\u0644\u0648\u0642\u062a \u0648\u064a\u0642\u0644\u0644 \u0627\u0644\u062a\u0643\u0644\u0641\u0629 \u0627\u0644\u062a\u0634\u063a\u064a\u0644\u064a\u0629 \u0628\u0645\u0639\u062f\u0644 \u062b\u0627\u0628\u062a \u0639\u0646\u062f \u062f\u0645\u062c\u0647 \u0641\u064a \u0627\u0644\u0639\u0645\u0644\u064a\u0627\u062a \u0627\u0644\u064a\u0648\u0645\u064a\u0629.\"\n ]\n },\n {\n \"h2\": \"\u0645\u0646 \u064a\u0633\u062a\u062e\u062f\u0645 [\u0627\u0644\u0645\u0648\u0636\u0648\u0639]\u061f\",\n \"h3\": [\n \"\u0627\u0644\u0634\u0631\u0643\u0627\u062a \u0627\u0644\u0646\u0627\u0634\u0626\u0629 (paragraph)\",\n \"\u0627\u0644\u0641\u0631\u0642 \u0627\u0644\u062a\u0642\u0646\u064a\u0629 (paragraph)\",\n \"\u0627\u0644\u0645\u0624\u0633\u0633\u0627\u062a \u0627\u0644\u062a\u0639\u0644\u064a\u0645\u064a\u0629 (1 paragraph)\"\n ],\n \"info\": [\n \"\u0627\u0644\u0634\u0631\u0643\u0627\u062a \u0627\u0644\u0646\u0627\u0634\u0626\u0629 \u062a\u0639\u062a\u0645\u062f \u0639\u0644\u064a\u0647 \u0644\u0623\u062a\u0645\u062a\u0629 \u0627\u0644\u0645\u0647\u0627\u0645 \u0627\u0644\u0645\u062a\u0643\u0631\u0631\u0629 \u0648\u062a\u0648\u0641\u064a\u0631 \u0627\u0644\u0645\u0648\u0627\u0631\u062f.\",\n \"\u0627\u0644\u0641\u0631\u0642 \u0627\u0644\u062a\u0642\u0646\u064a\u0629 \u062a\u0633\u062a\u062e\u062f\u0645\u0647 \u0644\u062a\u062d\u0633\u064a\u0646 \u0633\u064a\u0631 \u0627\u0644\u0639\u0645\u0644\u060c \u0648\u062a\u0642\u0644\u064a\u0644 \u0627\u0644\u0632\u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645 \u0644\u062a\u0633\u0644\u064a\u0645 \u0627\u0644\u0645\u0634\u0627\u0631\u064a\u0639.\",\n \"\u0627\u0644\u0645\u0624\u0633\u0633\u0627\u062a \u0627\u0644\u062a\u0639\u0644\u064a\u0645\u064a\u0629 \u0628\u062f\u0623\u062a \u0628\u062f\u0645\u062c [\u0627\u0644\u0645\u0648\u0636\u0648\u0639] \u0641\u064a \u0628\u0631\u0627\u0645\u062c\u0647\u0627 \u0627\u0644\u062a\u062f\u0631\u064a\u0628\u064a\u0629 \u0644\u062a\u0623\u0647\u064a\u0644 \u0627\u0644\u0637\u0644\u0627\u0628 \u0644\u0633\u0648\u0642 \u0627\u0644\u0639\u0645\u0644 \u0627\u0644\u062d\u062f\u064a\u062b.\"\n ]\n },\n {\n \"h2\": \"\u0645\u0642\u0627\u0631\u0646\u0629 \u0628\u064a\u0646 [\u0627\u0644\u0645\u0648\u0636\u0648\u0639] \u0648[\u0628\u062f\u064a\u0644\u0647]\u061f (bullet points + details)\",\n \"h3\": [],\n \"info\": [\n \"\u062a\u0634\u0645\u0644 \u0627\u0644\u0645\u0642\u0627\u0631\u0646\u0629: \u0627\u0644\u0645\u064a\u0632\u0627\u062a\u060c \u0627\u0644\u062a\u0643\u0644\u0641\u0629\u060c \u0627\u0644\u062f\u0639\u0645 \u0627\u0644\u0641\u0646\u064a\u060c \u0633\u0647\u0648\u0644\u0629 \u0627\u0644\u0627\u0633\u062a\u062e\u062f\u0627\u0645\u060c \u0627\u0644\u062a\u0648\u0627\u0641\u0642 \u0645\u0639 \u0627\u0644\u0623\u062f\u0648\u0627\u062a \u0627\u0644\u0623\u062e\u0631\u0649.\",\n \"[\u0627\u0644\u0645\u0648\u0636\u0648\u0639] \u064a\u062a\u0645\u064a\u0632 \u0628\u0633\u0647\u0648\u0644\u0629 \u0627\u0644\u062a\u062e\u0635\u064a\u0635 \u0648\u0648\u0627\u062c\u0647\u0629 \u0645\u0631\u0646\u0629\u060c \u0628\u064a\u0646\u0645\u0627 [\u0627\u0644\u0628\u062f\u064a\u0644] \u0623\u0642\u0648\u0649 \u0641\u064a \u0627\u0644\u062a\u062d\u0644\u064a\u0644\u0627\u062a \u0627\u0644\u0645\u062a\u0642\u062f\u0645\u0629.\",\n \"\u0645\u0646 \u062d\u064a\u062b \u0627\u0644\u062a\u0643\u0644\u0641\u0629\u060c \u064a\u0648\u0641\u0631 [\u0627\u0644\u0645\u0648\u0636\u0648\u0639] \u062e\u064a\u0627\u0631\u064b\u0627 \u0627\u0642\u062a\u0635\u0627\u062f\u064a\u064b\u0627 \u0623\u0643\u062b\u0631 \u0639\u0644\u0649 \u0627\u0644\u0645\u062f\u0649 \u0627\u0644\u0637\u0648\u064a\u0644\",\n \"\u0641\u064a \u0627\u0633\u062a\u0637\u0644\u0627\u0639 \u062d\u062f\u064a\u062b\u060c \u0627\u062e\u062a\u0627\u0631 68% \u0645\u0646 \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645\u064a\u0646 [\u0627\u0644\u0645\u0648\u0636\u0648\u0639] \u0628\u0633\u0628\u0628 \u062a\u062c\u0631\u0628\u0629 \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645 \u0627\u0644\u0623\u0641\u0636\u0644.\"\n ]\n },\n {\n \"h2\": \"\u0645\u0627 \u0627\u0644\u062a\u062d\u062f\u064a\u0627\u062a \u0627\u0644\u0645\u0631\u062a\u0628\u0637\u0629 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 [\u0627\u0644\u0645\u0648\u0636\u0648\u0639]\u061f\",\n \"h3\": [\n \"\u0635\u0639\u0648\u0628\u0627\u062a \u0627\u0644\u062a\u0647\u064a\u0626\u0629 \u0627\u0644\u0623\u0648\u0644\u064a\u0629 (paragraph)\",\n \"\u0627\u0644\u062d\u0627\u062c\u0629 \u0644\u0644\u062a\u062f\u0631\u064a\u0628 (1 paragraph)\",\n \"\u0645\u0634\u0643\u0644\u0627\u062a \u0627\u0644\u062a\u0648\u0627\u0641\u0642 \u0627\u0644\u062a\u0642\u0646\u064a (paragraph + example)\"\n ],\n \"info\": [\n \"\u064a\u062d\u062a\u0627\u062c \u0625\u0644\u0649 \u0625\u0639\u062f\u0627\u062f \u062a\u0642\u0646\u064a \u062f\u0642\u064a\u0642 \u0642\u0628\u0644 \u0627\u0644\u062a\u0634\u063a\u064a\u0644 \u0644\u0636\u0645\u0627\u0646 \u0639\u062f\u0645 \u062d\u062f\u0648\u062b \u062e\u0644\u0644 \u0648\u0638\u064a\u0641\u064a.\",\n \"\u064a\u062a\u0637\u0644\u0628 \u0645\u0646 \u0627\u0644\u0641\u0631\u0642 \u0627\u0644\u062a\u0642\u0646\u064a\u0629 \u0623\u0648 \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645\u064a\u0646 \u0627\u0644\u0646\u0647\u0627\u0626\u064a\u064a\u0646 \u0641\u0647\u0645\u064b\u0627 \u0643\u0627\u0641\u064a\u064b\u0627 \u0644\u0637\u0631\u064a\u0642\u0629 \u0639\u0645\u0644\u0647\u060c \u0645\u0627 \u0642\u062f \u064a\u0633\u062a\u062f\u0639\u064a \u062a\u062f\u0631\u064a\u0628 \u062f\u0627\u062e\u0644\u064a \u0623\u0648 \u062f\u0648\u0631\u0627\u062a \u062e\u0627\u0631\u062c\u064a\u0629.\",\n \"\u0641\u064a \u0628\u0639\u0636 \u0627\u0644\u062d\u0627\u0644\u0627\u062a\u060c \u0644\u0627 \u064a\u062a\u0643\u0627\u0645\u0644 \u0628\u0633\u0647\u0648\u0644\u0629 \u0645\u0639 \u0623\u0646\u0638\u0645\u0629 \u0625\u062f\u0627\u0631\u0629 \u0627\u0644\u0645\u0634\u0627\u0631\u064a\u0639 \u0627\u0644\u062a\u0642\u0644\u064a\u062f\u064a\u0629\u060c \u0643\u0645\u0627 \u0641\u064a \u0645\u062b\u0627\u0644 \u0634\u0631\u0643\u0629 Y \u0627\u0644\u062a\u064a \u0648\u0627\u062c\u0647\u062a \u062a\u0623\u062e\u064a\u0631\u064b\u0627 \u0641\u064a \u0627\u0644\u062f\u0645\u062c.\"\n ]\n },\n {\n \"h2\": \"\u0627\u0644\u0623\u0633\u0626\u0644\u0629 \u0627\u0644\u0634\u0627\u0626\u0639\u0629 \u062d\u0648\u0644 [\u0627\u0644\u0645\u0648\u0636\u0648\u0639] (FAQ)\",\n \"h3\": [\n \"\u0647\u0644 \u064a\u0646\u0627\u0633\u0628 \u0627\u0644\u0645\u0628\u062a\u062f\u0626\u064a\u0646\u061f (1 paragraph)\",\n \"\u0647\u0644 \u0647\u0648 \u0622\u0645\u0646 \u0644\u0644\u0627\u0633\u062a\u062e\u062f\u0627\u0645\u061f (paragraph + data)\",\n \"\u0647\u0644 \u064a\u062d\u062a\u0627\u062c \u0644\u062a\u062d\u062f\u064a\u062b \u0645\u0633\u062a\u0645\u0631\u061f (single paragraph)\"\n ],\n \"info\": [\n \"[\u0627\u0644\u0645\u0648\u0636\u0648\u0639] \u0635\u064f\u0645\u0645 \u0644\u064a\u0643\u0648\u0646 \u0633\u0647\u0644 \u0627\u0644\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u062d\u062a\u0649 \u0644\u0644\u0645\u0633\u062a\u062e\u062f\u0645\u064a\u0646 \u063a\u064a\u0631 \u0627\u0644\u062a\u0642\u0646\u064a\u064a\u0646\u060c \u0628\u0641\u0636\u0644 \u0648\u0627\u062c\u0647\u062a\u0647 \u0627\u0644\u0628\u062f\u064a\u0647\u064a\u0629 \u0648\u0627\u0644\u062f\u0639\u0645 \u0627\u0644\u0645\u062a\u0643\u0627\u0645\u0644.\",\n \"\u0646\u0633\u0628\u0629 \u0623\u0645\u0627\u0646 \u0639\u0627\u0644\u064a\u0629 \u062a\u0645 \u062a\u0648\u062b\u064a\u0642\u0647\u0627 \u0641\u064a \u0639\u062f\u0629 \u0627\u062e\u062a\u0628\u0627\u0631\u0627\u062a \u0623\u0645\u0627\u0646 \u0631\u0642\u0645\u064a\u0629 \u0623\u062c\u0631\u062a\u0647\u0627 \u062c\u0647\u0629 \u0645\u0633\u062a\u0642\u0644\u0629.\",\n \"\u064a\u0641\u0636\u0644 \u062a\u062d\u062f\u064a\u062b\u0647 \u062f\u0648\u0631\u064a\u064b\u0627 \u0644\u0636\u0645\u0627\u0646 \u0639\u0645\u0644\u0647 \u0628\u0643\u0641\u0627\u0621\u0629 \u0648\u062a\u0648\u0627\u0641\u0642\u0647 \u0645\u0639 \u0623\u064a \u062a\u063a\u064a\u064a\u0631\u0627\u062a \u0641\u064a \u0628\u064a\u0626\u0629 \u0627\u0644\u0639\u0645\u0644 \u0623\u0648 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a.\"\n ]\n },\n {\n \"h2\": \"\u0627\u0644\u062e\u0644\u0627\u0635\u0629 (2 short paragraphs)\",\n \"h3\": [],\n \"info\": [\n \"[\u0627\u0644\u0645\u0648\u0636\u0648\u0639] \u064a\u064f\u0639\u062f \u0623\u062f\u0627\u0629 \u0645\u062d\u0648\u0631\u064a\u0629 \u0641\u064a \u062a\u062d\u0633\u064a\u0646 \u0627\u0644\u0623\u062f\u0627\u0621 \u0627\u0644\u0645\u0624\u0633\u0633\u064a \u0648\u062a\u0633\u0647\u064a\u0644 \u0627\u0644\u0639\u0645\u0644\u064a\u0627\u062a\u060c \u0645\u0639 \u0646\u062a\u0627\u0626\u062c \u0645\u0644\u0645\u0648\u0633\u0629 \u0645\u0648\u062b\u0642\u0629 \u0641\u064a \u0627\u0644\u0639\u062f\u064a\u062f \u0645\u0646 \u0627\u0644\u0642\u0637\u0627\u0639\u0627\u062a.\",\n \"\u064a\u0646\u0635\u062d \u0628\u062f\u0645\u062c\u0647 \u0628\u0634\u0643\u0644 \u062a\u062f\u0631\u064a\u062c\u064a \u0641\u064a \u0627\u0644\u0645\u0646\u0638\u0648\u0645\u0629 \u0627\u0644\u062a\u0634\u063a\u064a\u0644\u064a\u0629 \u0645\u0639 \u062a\u0648\u0641\u064a\u0631 \u0627\u0644\u062a\u062f\u0631\u064a\u0628 \u0627\u0644\u0645\u0646\u0627\u0633\u0628 \u0644\u0636\u0645\u0627\u0646 \u0623\u0642\u0635\u0649 \u0627\u0633\u062a\u0641\u0627\u062f\u0629.\"\n ]\n }\n ]\n}\n\n```\n\nImportant:\n\n- The example JSON is meant to demonstrate the required structure and formatting only. The actual headings (h2, h3) and info content must be uniquely generated based on the keyword, not copied from the example.\n- All h2 and h3 items must be plain strings that include the format inside parentheses (e.g., \"\u0645\u0627 \u0647\u064a \u0627\u0644\u0641\u0648\u0627\u0626\u062f\u061f (2 paragraphs)\").\n- Do not use nested objects or additional keys like \"text\" or \"format\" \u2014 only use a single string for each heading.\n- The outline must follow this structure exactly:\"h2\": string (with format in parentheses)\n- All h3 items must be written as plain strings that include the format in parentheses, like\n- Do not return h3 as objects or use keys like \"format\" \u2014 it must be a single string only.\n- Do not return keys like \"format\", \"text\", or \"content\" \u2014 just follow the format shown above."
},
{
"content": "=Title\n{{ $('On form submission').item.json[\"Article's Title\"] }}\n\nKeyword Of The Topic:\n{{ $('On form submission').item.json.KW }}\n\nSome info To use:\n\n{{ $('Aggregate').item.json.content }}\n\nSome Q&A to use in FAQs (use the question title as written):\n{{ $json.FAQ }}"
}
]
},
"jsonOutput": true
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "f42f70d2-a3e9-4af1-8d95-8ac7650f1816",
"name": "Split Out1",
"type": "n8n-nodes-base.splitOut",
"position": [
940,
600
],
"parameters": {
"options": {},
"fieldToSplitOut": "message.content.outline"
},
"typeVersion": 1
},
{
"id": "8cdef061-bae0-4bb8-b191-8b28718a901d",
"name": "Writing The Article",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
640,
1020
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1",
"cachedResultName": "GPT-4.1"
},
"options": {},
"messages": {
"values": [
{
"role": "system",
"content": "You are a professional Arabic content writer.\n\nYour task is to write a complete article section based on:\n\n- The provided H2 heading\n- Its related H3 subpoints\n- The given information about the section\n\nFollow the instructions below carefully.\n\n### **Writing Methodology**\n\n1. **Structure & Flow**\n - Start by writing the H2 title (do not change or rephrase it) (Do not mention the format), then the content, and follow the H3 subpoints one by one..\n - Do not invent or introduce any ideas beyond what is provided.\n - Do not create a separate introduction or conclusion for the H2 \u2014 just continue the article smoothly, your role now just to write the section needed.\n2. **Skimmability**\n - The paragraphs should be short (2\u20134 lines max).\n - The bullet points, when needed, should be used without a heading. Each bullet should be a complete sentence, not just a fragment.\n3. **SEO Optimization**\n - Use the main keyword and related terms naturally in the text.\n - Use semantic variations and rich vocabulary.\n - Structure content so that it can rank for featured snippets.\n\n---\n\n### Tone & Style Guidelines\n\n- Use the plural form of \"you\" to maintain a gender-neutral and inclusive tone.\n- Keep the tone natural, human.\n- You are allowed to express the information using rich, natural language, but only using the facts and details provided. Do not create new ideas or reframe the intent.\n- Avoid overly technical, dry, or formal language.\n- Use diverse vocabulary and expressive sentence structure.\n- DO NOT use clich\u00e9s or generic phrases such as:\n - \"\u0645\u0646 \u0627\u0644\u062c\u062f\u064a\u0631 \u0628\u0627\u0644\u0630\u0643\u0631\", \"\u0644\u0627 \u0634\u0643 \u0623\u0646\", \"\u0639\u0644\u0627\u0648\u0629 \u0639\u0644\u0649 \u0630\u0644\u0643\", \"\u0627\u0644\u062e\u064a\u0627\u0631 \u0627\u0644\u0623\u0645\u062b\u0644\",\n \"\u0641\u064a \u0647\u0630\u0627 \u0627\u0644\u0635\u062f\u062f\", \"\u0641\u064a \u0627\u0644\u062e\u062a\u0627\u0645\", \"\u0646\u0631\u062c\u0648 \u0623\u0646 \u0646\u0643\u0648\u0646 \u0642\u062f \u0648\u064f\u0641\u0642\u0646\u0627\", \"\u0645\u0645\u0627 \u0644\u0627 \u0634\u0643 \u0641\u064a\u0647\",\n \"\u0627\u0644\u0623\u0641\u0636\u0644 \u0639\u0644\u0649 \u0627\u0644\u0625\u0637\u0644\u0627\u0642\", \"\u062b\u0648\u0631\u064a\", \"\u0631\u0627\u0626\u0639 \u0644\u0644\u063a\u0627\u064a\u0629\"\n - Or any phrase that sounds like generic AI content.\n- Avoid wordiness or unnecessary repetition \u2014 every sentence must deliver clear, meaningful content.\n- Do not use filler language or vague expressions that add no real value.\n- Do not oversimplify in a way that reduces the accuracy or depth of the information \u2014 maintain a balance between clarity and substance.\n- Write In Arabic.\n\n---\n\n### **Hard Restrictions**\n\n- Do **not** add any information that isn't included in the provided data.\n- Do **not** create fake references, data, or quotes.\n- Do **not** mention sources or references in the output.\n- Do **not** change the flow of the article \u2014 respect the sequence in the outline.\n\n---\n\nFormat the output using a clean Markdown structure. Use clean Markdown:\n\n`#` for H1, `##` for H2,..etc, `-` for bullets, `1.` for numbered lists, `**bold**` for emphasis, and line breaks between items."
},
{
"content": "=Main Keyword of The Topic:\n\n{{ $('On form submission').item.json.KW }}\n\nHere is The Section You will write and its info (just write this section):\n\nH2:\n\n{{ $json.h2 }}\nH3s:\n{{ $json.h3 }}\n\nInfo:\n{{ $json.info }}"
}
]
}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "787cea83-903f-430d-ab50-d678ba2da189",
"name": "notion",
"type": "n8n-nodes-base.httpRequest",
"position": [
860,
1640
],
"parameters": {
"url": "=https://api.notion.com/v1/blocks/{{ $('Make Notion Page').item.json.id }}/children",
"method": "PATCH",
"options": {},
"jsonBody": "={{ $json}}",
"sendBody": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "notionApi"
},
"credentials": {
"notionApi": {
"name": "<your credential>"
}
},
"retryOnFail": false,
"typeVersion": 4.2
},
{
"id": "f74fd145-7d53-4770-ac82-3466840a5eac",
"name": "Make Notion Page",
"type": "n8n-nodes-base.notion",
"position": [
120,
-280
],
"parameters": {
"title": "={{ $('On form submission').item.json.KW }}",
"options": {},
"resource": "databasePage",
"databaseId": {
"__rl": true,
"mode": "list",
"value": "1dbea3c3-9af3-80ac-aba0-fdf3c18a7119",
"cachedResultUrl": "https://www.notion.so/1dbea3c39af380acaba0fdf3c18a7119",
"cachedResultName": "Articles_Tst"
},
"propertiesUi": {
"propertyValues": [
{
"key": "Time|rich_text",
"textContent": "={{new Date().toLocaleString('en-EG', { timeZone: 'Africa/Cairo' })}}"
}
]
}
},
"credentials": {
"notionApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "073990ce-477c-4fc4-bbe8-aad4737678a4",
"name": "Edit Fields1",
"type": "n8n-nodes-base.set",
"position": [
220,
1620
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "f993ab57-326e-4a4c-a8ef-a6324bab994d",
"name": "content",
"type": "string",
"value": "={{ $json.message.content }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "9db38150-7bee-4066-9bdb-017775815c23",
"name": "Code",
"type": "n8n-nodes-base.code",
"position": [
680,
1620
],
"parameters": {
"jsCode": "// Get raw text from chatInput\nconst rawText = $input.first().json.content;\nconst lines = rawText.split(\"\\n\");\n\n// Function to parse bold and links\nconst createRichText = (text) => {\n const linkRegex = /\\[([^\\]]+)\\]\\(([^)]+)\\)/g;\n const boldRegex = /\\*\\*(.*?)\\*\\*/g;\n let result = [];\n let lastIndex = 0;\n let match;\n\n // \u0623\u0648\u0644\u0627: \u0631\u0648\u0627\u0628\u0637\n while ((match = linkRegex.exec(text)) !== null) {\n // \u0623\u064a \u0646\u0635 \u0642\u0628\u0644 \u0627\u0644\u0631\u0627\u0628\u0637\n if (match.index > lastIndex) {\n result.push(...parseBold(text.substring(lastIndex, match.index)));\n }\n // \u0625\u0636\u0627\u0641\u0629 \u0627\u0644\u0631\u0627\u0628\u0637 \u0643\u0640 Anchor\n result.push({\n type: \"text\",\n text: { content: match[1], link: { url: match[2] } },\n annotations: { bold: false, italic: false, strikethrough: false, underline: false, code: false, color: \"default\" },\n plain_text: match[1],\n href: match[2]\n });\n lastIndex = match.index + match[0].length;\n }\n // \u0627\u0644\u0628\u0627\u0642\u064a \u0628\u0639\u062f \u0622\u062e\u0631 \u0631\u0627\u0628\u0637\n if (lastIndex < text.length) {\n result.push(...parseBold(text.substring(lastIndex)));\n }\n return result.length ? result : [{ type: \"text\", text: { content: text }, annotations: { bold: false, italic: false, strikethrough: false, underline: false, code: false, color: \"default\" }, plain_text: text, href: null }];\n};\n\n// \u062f\u0627\u0644\u0629 bold \u0641\u0642\u0637 (\u062a\u064f\u0633\u062a\u062e\u062f\u0645 \u062f\u0627\u062e\u0644 \u0627\u0644\u062f\u0627\u0644\u0629 \u0623\u0639\u0644\u0627\u0647)\nfunction parseBold(text) {\n const boldRegex = /\\*\\*(.*?)\\*\\*/g;\n let parts = [];\n let lastIndex = 0;\n let match;\n while ((match = boldRegex.exec(text)) !== null) {\n if (match.index > lastIndex) {\n parts.push({\n type: \"text\",\n text: { content: text.substring(lastIndex, match.index) },\n annotations: { bold: false, italic: false, strikethrough: false, underline: false, code: false, color: \"default\" },\n plain_text: text.substring(lastIndex, match.index),\n href: null\n });\n }\n parts.push({\n type: \"text\",\n text: { content: match[1] },\n annotations: { bold: true, italic: false, strikethrough: false, underline: false, code: false, color: \"default\" },\n plain_text: match[1],\n href: null\n });\n lastIndex = match.index + match[0].length;\n }\n if (lastIndex < text.length) {\n parts.push({\n type: \"text\",\n text: { content: text.substring(lastIndex) },\n annotations: { bold: false, italic: false, strikethrough: false, underline: false, code: false, color: \"default\" },\n plain_text: text.substring(lastIndex),\n href: null\n });\n }\n return parts.length ? parts : [{ type: \"text\", text: { content: text }, annotations: { bold: false, italic: false, strikethrough: false, underline: false, code: false, color: \"default\" }, plain_text: text, href: null }];\n}\n\n// Block constructors\nconst createHeading = (text, level = 1) => ({\n object: \"block\",\n type: `heading_${level}`,\n [`heading_${level}`]: { rich_text: createRichText(text) }\n});\n\nconst createParagraph = (text) => ({\n object: \"block\",\n type: \"paragraph\",\n paragraph: { rich_text: createRichText(text) }\n});\n\nconst createBulletListItem = (text) => ({\n object: \"block\",\n type: \"bulleted_list_item\",\n bulleted_list_item: { rich_text: createRichText(text) }\n});\n\nconst createNumberedListItem = (text) => {\n let cleanedText = text.replace(/^\\d+\\.\\s*/, \"\").trim();\n return {\n object: \"block\",\n type: \"numbered_list_item\",\n numbered_list_item: { rich_text: createRichText(cleanedText) }\n };\n};\n\n// Main parsing\nlet blocks = [];\nlet paragraphContent = [];\n\nfor (let line of lines) {\n line = line.trim();\n\n if (line.startsWith(\"# \")) {\n if (paragraphContent.length > 0) {\n blocks.push(createParagraph(paragraphContent.join(\"\\n\\n\")));\n paragraphContent = [];\n }\n blocks.push(createHeading(line.replace(\"# \", \"\"), 1));\n }\n else if (line.startsWith(\"## \")) {\n if (paragraphContent.length > 0) {\n blocks.push(createParagraph(paragraphContent.join(\"\\n\\n\")));\n paragraphContent = [];\n }\n blocks.push(createHeading(line.replace(\"## \", \"\"), 2));\n }\n else if (line.startsWith(\"### \")) {\n if (paragraphContent.length > 0) {\n blocks.push(createParagraph(paragraphContent.join(\"\\n\\n\")));\n paragraphContent = [];\n }\n blocks.push(createHeading(line.replace(\"### \", \"\"), 3));\n }\n else if (line.match(/^\\d+\\./)) {\n if (paragraphContent.length > 0) {\n blocks.push(createParagraph(paragraphContent.join(\"\\n\\n\")));\n paragraphContent = [];\n }\n blocks.push(createNumberedListItem(line));\n }\n else if (line.startsWith(\"- \")) {\n if (paragraphContent.length > 0) {\n blocks.push(createParagraph(paragraphContent.join(\"\\n\\n\")));\n paragraphContent = [];\n }\n blocks.push(createBulletListItem(line.replace(\"- \", \"\").trim()));\n }\n else if (line.length > 0) {\n paragraphContent.push(line);\n }\n else if (line.length === 0 && paragraphContent.length > 0) {\n blocks.push(createParagraph(paragraphContent.join(\"\\n\\n\")));\n paragraphContent = [];\n }\n}\n\n// \u0641\u064a \u0646\u0647\u0627\u064a\u0629 \u0627\u0644\u0645\u0644\u0641: \u0625\u0630\u0627 \u0641\u064a\u0647 \u0645\u062d\u062a\u0648\u0649 \u0645\u062a\u0631\u0627\u0643\u0645 \u0644\u0645 \u064a\u064f\u062f\u0641\u0639 \u0628\u0639\u062f\nif (paragraphContent.length > 0) {\n blocks.push(createParagraph(paragraphContent.join(\"\\n\\n\")));\n}\n\n// **\u0627\u0644\u0646\u0642\u0637\u0629 \u0627\u0644\u0645\u0647\u0645\u0629:**\n// \u0641\u064a n8n \u064a\u062c\u0628 \u0623\u0646 \u064a\u0643\u0648\u0646 \u0627\u0644\u062e\u0631\u062c \u0645\u0635\u0641\u0648\u0641\u0629 \u0645\u0646 \u0627\u0644\u0643\u0627\u0626\u0646\u0627\u062a\u060c \u0643\u0644 \u0643\u0627\u0626\u0646 \u064a\u064f\u0645\u062b\u0644 \u0628\u0646\u062f (block)\n// \u0645\u062b\u0627\u0644: [{json: {...}}, {json: {...}}, ...]\nreturn [{ json: { children: blocks } }];"
},
"typeVersion": 2
},
{
"id": "c48f41d3-e3f6-4c17-9056-89669032fdb5",
"name": "Form",
"type": "n8n-nodes-base.form",
"position": [
1000,
1440
],
"parameters": {
"operation": "completion",
"resumeUnit": "minutes",
"redirectUrl": "={{ $('Make Notion Page').item.json.url }}",
"respondWith": "redirect",
"resumeAmount": 2,
"limitWaitTime": true
},
"typeVersion": 1
},
{
"id": "bb916a02-687f-4e8f-bad8-92e342f5c40d",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-20,
1400
],
"parameters": {
"color": 4,
"width": 1400,
"height": 460,
"content": "## Saving The Article\n\n"
},
"typeVersion": 1
},
{
"id": "f2179207-c5d1-457d-bbf5-54d636fe3715",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
440,
1560
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "f37f4950-eda7-42cf-a788-eb2903ad303a",
"name": "People_Also_Ask",
"type": "n8n-nodes-base.httpRequest",
"position": [
440,
200
],
"parameters": {
"url": "https://api.dataforseo.YOUR_AWS_SECRET_KEY_HERE",
"method": "POST",
"options": {},
"jsonBody": "=[\n {\n \"language_code\": \"ar\",\n \"location_code\": 2682,\n \"keyword\": \"{{ $('On form submission').item.json.KW }}\"\n }\n] ",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth"
},
"credentials": {
"httpBasicAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "543eeb8a-d160-4865-a057-6495db437cf3",
"name": "Filter_Q&A",
"type": "n8n-nodes-base.code",
"position": [
660,
200
],
"parameters": {
"jsCode": "const items = $json.tasks[0].result[0].items;\nconst paa = items.find(item => item.type === 'people_also_ask');\n\n// \u062a\u0623\u0643\u062f \u0645\u0646 \u0648\u062c\u0648\u062f \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a\nif (!paa || !paa.items) {\n return [];\n}\n\n// \u0636\u064f\u0645 \u0627\u0644\u0633\u0624\u0627\u0644 \u0648\u0627\u0644\u0625\u062c\u0627\u0628\u0629 \u0641\u064a String \u0648\u0627\u062d\u062f\nreturn paa.items.map(el => {\n const question = el.title || \"\";\n const answer = (el.expanded_element && el.expanded_element[0]) ? el.expanded_element[0].description : \"\";\n return { \n FAQ: `\u0633\u0624\u0627\u0644: ${question} | \u0625\u062c\u0627\u0628\u0629: ${answer}` \n };\n});\n"
},
"typeVersion": 2
},
{
"id": "18d9ce34-71e8-469a-b2df-40953477b38a",
"name": "Gather_Q&A",
"type": "n8n-nodes-base.aggregate",
"position": [
880,
200
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "FAQ"
}
]
}
},
"typeVersion": 1
},
{
"id": "27064bd4-e37b-48e2-b005-c9b1221882cb",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
300,
100
],
"parameters": {
"width": 880,
"height": 280,
"content": "## FAQs From People_Also_Ask"
},
"typeVersion": 1
},
{
"id": "397bedb5-665b-4ef6-b997-6e95c045cb1f",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1160,
-360
],
"parameters": {
"color": 5,
"width": 820,
"height": 2240,
"content": "### \ud83d\udd38 On form submission (Form Trigger)\n\n- **Purpose:** Starts the workflow when a user submits the article-writing form.\n\n\u2022 **Details:**\n\n- Collects \"KW\" (keyword) and optionally \"Article's Title\".\n- Triggered by a webhook; initiates the rest of the automation.\n \n \u2022 **Tip:** Edit form fields here if you want to collect additional info from users.\n \n\n---\n\n### \ud83d\udd38 Make Notion Page (Notion)\n\n- **Purpose:** Creates a new page in your Notion database to store the article.\n\n\u2022 **Details:**\n\n- Uses the keyword as the page title.\n- Adds the current date/time as a property.\n- Requires Notion API credentials and a database ID.\n \n \u2022 **Tip:** Ensure Notion database properties match what's used in this node.\n \n\n---\n\n### \ud83d\udd38 Prmopts For Search (OpenAI GPT4.1)\n\n- **Purpose:** Generates three deep research prompts about the keyword to guide AI-powered research.\n\n\u2022 **Details:**\n\n- Uses a structured system message to get prompts from GPT, each from a different angle.\n- Prompts are written in English for Perplexity/Sonar AI research.\n \n \u2022 **Tip:** The quality of these prompts directly impacts the article depth; edit the system message to customize research angles.\n \n\n---\n\n### \ud83d\udd38 Split Out (Split Out Node)\n\n- **Purpose:** Splits out each individual research prompt from the list for processing.\n\n\u2022 **Details:**\n\n- Ensures each prompt can be handled by subsequent nodes one at a time.\n\n---\n\n### \ud83d\udd38 Sonar - Search (Perplexity/Sonar)\n\n- **Purpose:** Conducts AI-powered research for each generated prompt.\n\n\u2022 **Details:**\n\n- Sends the prompt to Perplexity/Sonar (via OpenRouter) and gets back detailed answers.\n- Requires OpenRouter API key.\n \n \u2022 **Tip:** Change model or provider here for different research results.\n \n\n---\n\n### \ud83d\udd38 Aggregate (Aggregate Node)\n\n- **Purpose:** Collects all research responses into a single structured object for use in outlining.\n\n\u2022 **Details:**\n\n- Aggregates content from all Sonar research responses.\n\n---\n\n### \ud83d\udd38 People_Also_Ask (HTTP Request - DataForSEO)\n\n- **Purpose:** Gathers related questions (People Also Ask) from Google for the keyword.\n\n\u2022 **Details:**\n\n- Sends keyword to DataForSEO API (Arabic, Saudi location) and retrieves related FAQ.\n- Requires DataForSEO account and API credentials.\n \n \u2022 **Tip:** You can modify location/language codes to target different audiences.\n \n\n---\n\n### \ud83d\udd38 Filter_Q&A (Code Node)\n\n- **Purpose:** Extracts questions and answers from the People Also Ask API response.\n\n\u2022 **Details:**\n\n- Parses API JSON and creates a neat array of Q&A pairs for the article\u2019s FAQ section.\n\n---\n\n### \ud83d\udd38 Gather_Q&A (Aggregate Node)\n\n- **Purpose:** Combines all Q&A pairs into one structure for easier use in the outline and article.\n\n\u2022 **Details:**\n\n- Makes sure all extracted FAQs are grouped for easy reference.\n\n---\n\n### \ud83d\udd38 Make An Outline (OpenAI GPT4.1)\n\n- **Purpose:** Uses all research and FAQ data to generate a complete SEO-optimized article outline in Arabic.\n\n\u2022 **Details:**\n\n- Provides a JSON outline: H2/H3 structure, detailed info for each section, and FAQ integration.\n- Strongly guided by system prompt for consistent structure.\n \n \u2022 **Tip:** Editing the prompt here lets you control article structure or depth.\n \n\n---\n\n### \ud83d\udd38 Split Out1 (Split Out Node)\n\n- **Purpose:** Splits the JSON outline so each section (H2/H3/info) can be handled individually.\n\n\u2022 **Details:**\n\n- Enables article writing to proceed section-by-section.\n\n---\n\n### \ud83d\udd38 Writing The Article (OpenAI GPT4.1)\n\n- **Purpose:** Writes each article section in Arabic using the H2/H3/info for that section only.\n\n\u2022 **Details:**\n\n- Enforces structure and SEO, strictly using only provided facts (no invented info).\n- Tone and style rules included in the system prompt.\n \n \u2022 **Tip:** Modify the system prompt to adjust tone, voice, or writing guidelines.\n \n\n---\n\n### \ud83d\udd38 Edit Fields1 (Set Node)\n\n- **Purpose:** Prepares the AI-written content for formatting and saving.\n\n\u2022 **Details:**\n\n- Maps the content into a new field (\"content\") for further processing.\n\n---\n\n### \ud83d\udd38 Loop Over Items (Split In Batches)\n\n- **Purpose:** Loops through each article section for batch processing and saving.\n\n\u2022 **Details:**\n\n- Ensures every section is sent in order and can be processed reliably.\n\n---\n\n### \ud83d\udd38 Code (Rich Text \u2192 Notion Blocks)\n\n- **Purpose:** Converts AI-generated Markdown into Notion\u2019s structured block format (headings, bullets, paragraphs).\n\n\u2022 **Details:**\n\n- Parses Markdown and creates rich Notion block objects, supporting bold text and links.\n- Handles special formatting for lists and headings.\n\n---\n\n### \ud83d\udd38 notion (HTTP Request - Notion API PATCH)\n\n- **Purpose:** Appends the formatted article blocks to the existing Notion page.\n\n\u2022 **Details:**\n\n- Sends all blocks as children to the page created earlier.\n- Requires Notion API credentials.\n\n---\n\n### \ud83d\udd38 Form (End/Redirect)\n\n- **Purpose:** Ends the workflow and redirects the user back to their Notion page to view the final article.\n\n\u2022 **Details:**\n\n- Waits for saving to complete, then sends the user to the Notion page URL.\n \n \u2022 **Tip:** You can change this to redirect elsewhere or display a success message if needed.\n \n\n---\n\n### **General Assumptions and Warnings:**\n\n- **Credentials:** All external API nodes (OpenAI, Notion, DataForSEO, OpenRouter) require valid credentials set up in n8n.\n- **Language:** The core workflow is for Arabic content but is customizable for other languages with prompt and setting tweaks."
},
"typeVersion": 1
}
],
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "ca8fd388-8194-4185-9a84-8a1842c2fbec",
"connections": {
"Code": {
"main": [
[
{
"node": "notion",
"type": "main",
"index": 0
}
]
]
},
"notion": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "People_Also_Ask",
"type": "main",
"index": 0
}
]
]
},
"Split Out": {
"main": [
[
{
"node": "Sonar - Search",
"type": "main",
"index": 0
}
]
]
},
"Filter_Q&A": {
"main": [
[
{
"node": "Gather_Q&A",
"type": "main",
"index": 0
}
]
]
},
"Gather_Q&A": {
"main": [
[
{
"node": "Make An Outline",
"type": "main",
"index": 0
}
]
]
},
"Split Out1": {
"main": [
[
{
"node": "Writing The Article",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields1": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Sonar - Search": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[
{
"node": "Form",
"type": "main",
"index": 0
}
],
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Make An Outline": {
"main": [
[
{
"node": "Split Out1",
"type": "main",
"index": 0
}
]
]
},
"People_Also_Ask": {
"main": [
[
{
"node": "Filter_Q&A",
"type": "main",
"index": 0
}
]
]
},
"Make Notion Page": {
"main": [
[
{
"node": "Prmopts For Search",
"type": "main",
"index": 0
}
]
]
},
"On form submission": {
"main": [
[
{
"node": "Make Notion Page",
"type": "main",
"index": 0
}
]
]
},
"Prmopts For Search": {
"main": [
[
{
"node": "Split Out",
"type": "main",
"index": 0
}
]
]
},
"Writing The Article": {
"main": [
[
{
"node": "Edit Fields1",
"type": "main",
"index": 0
}
]
]
}
}
}
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.
httpBasicAuthnotionApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow automatically creates in-depth, SEO-friendly Arabic articles based on any keyword you provide. It researches the topic, generates a full article outline, writes every section in Arabic, and saves the final article directly to your Notion workspace—all in a few…
Source: https://n8n.io/workflows/4828/ — 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.
What it is An automated LinkedIn content system that takes a simple form (idea + optional file), generates LinkedIn posts with OpenAI, stores them in Notion, builds Google Slides carousels, and auto-p
This workflow is an AI-powered lighting and look development pipeline designed for VFX production. It transforms a single lighting brief into multiple high-quality cinematic lighting references using
This workflow allows you to define multiple tickets/issues in a Notion page, then easily import them into Linear.
This n8n workflow automatically generates professional e-commerce product mockups from product images. The workflow is perfect for e-commerce store owners, product marketers, and content creators who
Note: Now includes an Apify alternative for Rapid API (Some users can't create new accounts on Rapid API, so I have added an alternative for you. But immediately you are able to get access to Rapid AP