8
n8n 한국어amn8n.com

AI 기반 WordPress 콘텐츠 워크플로

중급

이것은Content Creation, Multimodal AI분야의자동화 워크플로우로, 12개의 노드를 포함합니다.주로 If, Code, Postgres, Wordpress, Agent 등의 노드를 사용하며. OpenAI GPT를 사용한 PostgreSQL에서 WordPress로의 블로그 게시 자동화

사전 요구사항
  • PostgreSQL 데이터베이스 연결 정보
  • OpenAI API Key
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": "ai-wordpress-blog-automation",
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "name": "AI-Powered WordPress Content Workflow",
  "tags": [],
  "nodes": [
    {
      "id": "291e2ca0-6eb2-4e69-a147-2369e7f27257",
      "name": "🗄️ PostgreSQL 트리거",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -672,
        80
      ],
      "parameters": {
        "query": "SELECT *\nFROM \"your_table_name\"\nWHERE \"Processed\" = FALSE OR \"Processed\" IS NULL\nORDER BY \"Created_At\" DESC\nLIMIT 1;",
        "options": {},
        "operation": "executeQuery"
      },
      "credentials": {
        "postgres": {
          "id": "YOUR_POSTGRES_CREDENTIALS_ID",
          "name": "PostgreSQL Database Connection"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "7fbc5898-0f88-46e8-96ce-e4e215122974",
      "name": "⏰ 스케줄 트리거",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -896,
        80
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "057ddc57-2019-4cad-acdd-a3a69976512d",
      "name": "📝 블로그 데이터 포맷팅",
      "type": "n8n-nodes-base.code",
      "position": [
        128,
        80
      ],
      "parameters": {
        "jsCode": "// Parse the AI response safely\nconst input = $input.first().json;\n\n// Handle payload structure: sometimes response, sometimes output\nconst aiResponse = input.response || input.output || JSON.stringify(input);\n\n// Try to parse JSON from AI response\nlet blogData;\ntry {\n  const jsonMatch =\n    aiResponse.match(/```json\\s*([\\s\\S]*?)\\s*```/) ||\n    aiResponse.match(/{[\\s\\S]*}/);\n\n  if (jsonMatch) {\n    blogData = JSON.parse(jsonMatch[1] || jsonMatch[0]);\n  } else {\n    throw new Error(\"No JSON structure found\");\n  }\n} catch (error) {\n  const safeText = aiResponse || \"AI did not return text.\";\n  blogData = {\n    title: safeText.split(\"\\n\")[0] || \"Generated Blog Post\",\n    content: safeText,\n    excerpt: safeText.substring(0, 200) + \"...\",\n    meta_description: safeText.substring(0, 160),\n  };\n}\n\n// Ensure fallback values\nconst safeTitle = blogData.title || \"AI Generated Marketing Content\";\nconst safeContent = blogData.content || \"No content generated.\";\nconst safeExcerpt =\n  blogData.excerpt || safeContent.substring(0, 200) + \"...\";\nconst safeMeta =\n  blogData.meta_description || safeContent.substring(0, 160);\n\n// Get the original database record\nlet dbRecord = {};\ntry {\n  dbRecord = $('🗄️ PostgreSQL Trigger').item.json || {};\n} catch (e) {\n  dbRecord = { id: \"unknown\", source: \"no-db-record\" };\n}\n\n// Return structured data for WordPress\nreturn {\n  json: {\n    title: safeTitle,\n    content: safeContent,\n    excerpt: safeExcerpt,\n    status: \"publish\",\n    categories: [\"Marketing\"],\n    tags: [\"AI\", \"PostgreSQL\", \"WordPress\", \"Marketing\", \"Automation\"],\n    meta_description: safeMeta,\n    original_record_id: dbRecord.id || \"no-id\",\n    source_data: dbRecord,\n  },\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "a2eeca41-110d-4c61-856d-409e8ce0661f",
      "name": "✍️ WordPress 게시자",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        352,
        80
      ],
      "parameters": {
        "tags": {
          "tags": [
            "AI",
            "PostgreSQL",
            "WordPress",
            "Marketing",
            "Automation"
          ]
        },
        "title": "={{ $json.title }}",
        "status": "publish",
        "content": "={{ $json.content }}",
        "excerpt": "={{ $json.excerpt }}",
        "categories": {
          "categories": [
            "Marketing"
          ]
        },
        "additionalFields": {
          "meta": {
            "metaProperties": [
              {
                "key": "meta_description",
                "value": "={{ $json.meta_description }}"
              }
            ]
          }
        }
      },
      "credentials": {
        "wordpressApi": {
          "id": "YOUR_WORDPRESS_CREDENTIALS_ID",
          "name": "WordPress API Connection"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "946b27ee-37ea-4b82-867b-624f281727d3",
      "name": "💾 데이터베이스 업데이트",
      "type": "n8n-nodes-base.postgres",
      "position": [
        576,
        80
      ],
      "parameters": {
        "query": "UPDATE \"your_table_name\"\nSET \n    \"Processed\" = TRUE,\n    \"Wordpress_Post_Id\" = $1,\n    \"Wordpress_Post_Url\" = $2,\n    \"Blog_Title\" = $3,\n    \"Processed_At\" = NOW()\nWHERE \"id\" = $4;",
        "options": {},
        "operation": "executeQuery",
        "additionalFields": {
          "queryParameters": {
            "parameters": [
              {
                "value": "={{ $json.id }}"
              },
              {
                "value": "={{ $json.link }}"
              },
              {
                "value": "={{ $json.title.rendered }}"
              },
              {
                "value": "={{ $('📝 Format Blog Data').item.json.original_record_id }}"
              }
            ]
          }
        }
      },
      "credentials": {
        "postgres": {
          "id": "YOUR_POSTGRES_CREDENTIALS_ID",
          "name": "PostgreSQL Database Connection"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "3254f143-fe85-49c8-a454-bb9729fd77dc",
      "name": "OpenAI 채팅 모델",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -176,
        288
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "YOUR_OPENAI_CREDENTIALS_ID",
          "name": "OpenAI API Connection"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "dde2cc13-b8a2-4771-beb6-09e7fc31a352",
      "name": "🔍 레코드 존재 확인",
      "type": "n8n-nodes-base.if",
      "position": [
        -448,
        80
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "condition_1",
              "operator": {
                "type": "number",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.id }}",
              "rightValue": 0
            },
            {
              "id": "c9785b0c-f86c-4293-a5b3-8825e74ad0c4",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.Blog_Title }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "cdacc933-4448-40b8-a9c5-242bf766d62a",
      "name": "🤖 블로그 포스트 생성",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -224,
        80
      ],
      "parameters": {
        "text": "=You are an expert marketing content writer. Create engaging, SEO-optimized blog posts that convert readers into customers.\n\nUser Message:\nCreate a comprehensive marketing blog post based on this title: \n{{ $json.Blog_Title }}\n\nThe blog post should include:\n1. A catchy, SEO-friendly title\n2. An engaging introduction that hooks the reader\n3. Well-structured body content with subheadings\n4. A compelling conclusion with a call-to-action\n5. Optimize for marketing and conversion\n\nFormat the response as JSON with these fields:\n- title: The blog post title\n- content: The full HTML content of the blog post\n- excerpt: A brief excerpt (150-200 characters)\n- meta_description: SEO meta description (150-160 characters)",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "d2941310-5f0a-43fa-a232-f68f0b990f78",
      "name": "스티키 노트",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        -320
      ],
      "parameters": {
        "width": 432,
        "height": 720,
        "content": "## 1. Trigger & Data Fetch\n\n**Schedule Trigger (⏰ Schedule Trigger)**: Initiates the workflow at regular intervals.\n\n**PostgreSQL Query (🗄️ PostgreSQL Trigger)**: Fetches the latest unprocessed record from your database table.\n\n**Record Existence Check (🔍 Check Record Exists)**: Ensures only valid, non-empty records are processed."
      },
      "typeVersion": 1
    },
    {
      "id": "539c0737-da51-4e7f-8127-fefd690f75d5",
      "name": "스티키 노트1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        -320
      ],
      "parameters": {
        "color": 4,
        "width": 560,
        "height": 720,
        "content": "## 2. AI Content Generation\n\n**OpenAI Chat Model (OpenAI Chat Model)**: Receives record input and generates blog content based on the title.\n\n**Blog Post Agent (🤖 Generates Blog Post)**: Structures AI output into a JSON format with:\n- Title\n- Content (HTML)\n- Excerpt (150–200 characters)\n- Meta description (SEO, 150–160 characters)"
      },
      "typeVersion": 1
    },
    {
      "id": "252aa9dd-5b44-4ba2-8621-19895689f740",
      "name": "스티키 노트2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -320
      ],
      "parameters": {
        "color": 3,
        "width": 208,
        "height": 720,
        "content": "## 3. Data Formatting & Safety\n\n**Code Node (📝 Format Blog Data)**:\nPrepares a structured payload for WordPress, including:\n- Categories and tags\n- Original database record reference\n- Error handling for malformed AI responses"
      },
      "typeVersion": 1
    },
    {
      "id": "af0ac8f3-d7e9-4546-8b27-02c1d9629d23",
      "name": "스티키 노트3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        -320
      ],
      "parameters": {
        "color": 5,
        "width": 432,
        "height": 720,
        "content": "## 4. Publishing & Database Update\n\n**WordPress Publisher (✍️ WordPress Publisher)**: Publishes the formatted blog content to WordPress with proper categories, tags, and meta data.\n\n**Database Update (💾 Update Database)**: After successful publishing, updates the original record to:\n- Mark it as processed\n- Store WordPress post ID and URL\n- Record processing timestamp\n\n**Purpose**: Ensures content is live and database stays synchronized."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "00000000-0000-0000-0000-000000000000",
  "connections": {
    "3254f143-fe85-49c8-a454-bb9729fd77dc": {
      "ai_languageModel": [
        [
          {
            "node": "cdacc933-4448-40b8-a9c5-242bf766d62a",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "7fbc5898-0f88-46e8-96ce-e4e215122974": {
      "main": [
        [
          {
            "node": "291e2ca0-6eb2-4e69-a147-2369e7f27257",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "946b27ee-37ea-4b82-867b-624f281727d3": {
      "main": [
        []
      ]
    },
    "057ddc57-2019-4cad-acdd-a3a69976512d": {
      "main": [
        [
          {
            "node": "a2eeca41-110d-4c61-856d-409e8ce0661f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "dde2cc13-b8a2-4771-beb6-09e7fc31a352": {
      "main": [
        [
          {
            "node": "cdacc933-4448-40b8-a9c5-242bf766d62a",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "cdacc933-4448-40b8-a9c5-242bf766d62a": {
      "main": [
        [
          {
            "node": "057ddc57-2019-4cad-acdd-a3a69976512d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a2eeca41-110d-4c61-856d-409e8ce0661f": {
      "main": [
        [
          {
            "node": "946b27ee-37ea-4b82-867b-624f281727d3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "291e2ca0-6eb2-4e69-a147-2369e7f27257": {
      "main": [
        [
          {
            "node": "dde2cc13-b8a2-4771-beb6-09e7fc31a352",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

중급 - 콘텐츠 제작, 멀티모달 AI

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
중급
노드 수12
카테고리2
노드 유형8
난이도 설명

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

저자
Avkash Kakdiya

Avkash Kakdiya

@itechnotion

🚀 Founder of iTechNotion — we build custom AI-powered automation workflows for startups, agencies, and founders. 💡 Specializing in agentic AI systems, content automation, sales funnels, and digital workers. 🔧 14+ years in tech | Building scalable no-code/low-code solutions using n8n, OpenAI, and other API-first tools. 📬 Let’s automate what slows you down.

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34