[
  {
    "name": "Content Engine — Publish Pipeline",
    "description": "One-click publish: receive article data → CMS → social queue → email → team notify. Triggered by webhook form.",
    "active": true,
    "settings": {
      "timezone": "UTC",
      "saveManualExecutions": true,
      "callerPolicy": "workflowsFromSameOwner",
      "executionOrder": "v1"
    },
    "tags": [
      "flowforge",
      "content",
      "marketing"
    ],
    "nodes": [
      {
        "id": "93144b64-6a52-420a-817c-1febfd74e660",
        "name": "Webhook Trigger",
        "type": "n8n-nodes-base.webhook",
        "typeVersion": 1,
        "position": [
          250,
          300
        ],
        "webhookId": "content-engine-publish",
        "parameters": {
          "path": "content-engine-publish",
          "options": {
            "responseHeaders": {
              "entries": [
                {
                  "name": "Content-Type",
                  "value": "application/json"
                }
              ]
            }
          },
          "responseMode": "onReceived",
          "responseData": "allEntries",
          "httpMethod": "POST"
        }
      },
      {
        "id": "3fab1109-a9ae-401e-9a64-778cc647e7a6",
        "name": "Format Article Data",
        "type": "n8n-nodes-base.code",
        "typeVersion": 2,
        "position": [
          500,
          300
        ],
        "parameters": {
          "jsCode": "const items = $input.all();\nconst data = items[0]?.json?.body || items[0]?.json || {};\n\nreturn [{\n  json: {\n    title: data.title || 'Untitled',\n    url: data.url || '',\n    excerpt: data.excerpt || '',\n    categories: data.categories || ['AI Workflows'],\n    tags: data.tags || [],\n    socialCopy: data.socialCopy || data.excerpt || '',\n    imageUrl: data.imageUrl || '',\n    author: data.author || 'FlowForge',\n    timestamp: new Date().toISOString()\n  }\n}];\n"
        }
      },
      {
        "id": "b10e5324-f423-4ea1-a941-dc84d2ee7302",
        "name": "Publish to WordPress",
        "type": "n8n-nodes-base.httpRequest",
        "typeVersion": 4.2,
        "position": [
          750,
          200
        ],
        "parameters": {
          "url": "={{ $env.WP_API_URL }}/wp-json/wp/v2/posts",
          "authentication": "genericCredentialType",
          "genericAuthType": "httpBasicAuth",
          "sendBody": true,
          "options": {
            "timeout": 30000,
            "allowUnauthorizedCerts": true
          },
          "headerParameters": {
            "parameters": [
              {
                "name": "Content-Type",
                "value": "application/json"
              }
            ]
          },
          "sendQuery": false,
          "sendHeaders": true,
          "method": "POST",
          "bodyParameters": {
            "parameters": [
              {
                "name": "title",
                "value": "={{ $json.title }}"
              },
              {
                "name": "content",
                "value": "={{ $json.content }}"
              },
              {
                "name": "excerpt",
                "value": "={{ $json.excerpt }}"
              },
              {
                "name": "status",
                "value": "publish"
              }
            ]
          }
        }
      },
      {
        "id": "3173c9f1-13b8-495d-a7c1-b88d379d287a",
        "name": "Queue Social Posts",
        "type": "n8n-nodes-base.httpRequest",
        "typeVersion": 4.2,
        "position": [
          750,
          450
        ],
        "parameters": {
          "url": "={{ $env.BUFFER_API_URL }}/v1/updates/create.json",
          "authentication": "genericCredentialType",
          "genericAuthType": "httpQueryAuth",
          "sendBody": true,
          "options": {
            "timeout": 15000
          },
          "sendQuery": true,
          "sendHeaders": true,
          "method": "POST",
          "queryParameters": {
            "parameters": [
              {
                "name": "text",
                "value": "={{ $json.socialCopy }}"
              },
              {
                "name": "profile_ids[]",
                "value": "={{ $env.BUFFER_PROFILES }}"
              },
              {
                "name": "now",
                "value": "={{ $json.timestamp }}"
              },
              {
                "name": "media[photo]",
                "value": "={{ $json.imageUrl }}"
              }
            ]
          }
        }
      },
      {
        "id": "57519896-e8c4-427c-91f3-e2cc17d31f49",
        "name": "Send Email Notification",
        "type": "n8n-nodes-base.emailSend",
        "typeVersion": 1,
        "position": [
          750,
          650
        ],
        "parameters": {
          "fromEmail": "content@flowforge.toolyft.com",
          "toEmail": "={{ $env.NOTIFY_EMAIL }}",
          "subject": "=New Article Published: {{ $json.title }}",
          "text": "={{ \"New article published:\\n\\nTitle: \" + $json.title + \"\\nURL: \" + $json.url + \"\\nExcerpt: \" + $json.excerpt }}",
          "options": {}
        },
        "credentials": {
          "smtp": {
            "id": "1",
            "name": "FlowForge SMTP"
          }
        }
      },
      {
        "id": "d0c6c9a3-fae9-4bd9-b6b1-e92b859a8de5",
        "name": "Slack Notification",
        "type": "n8n-nodes-base.slack",
        "typeVersion": 1,
        "position": [
          1050,
          300
        ],
        "parameters": {
          "channel": "={{ $env.SLACK_CHANNEL }}",
          "text": "={{ \"📝 New article published: \" + $json.title + \"\\n\" + $json.url }}",
          "jsonBody": {},
          "otherOptions": {}
        },
        "credentials": {
          "slackApi": {
            "id": "2",
            "name": "FlowForge Slack"
          }
        }
      },
      {
        "id": "ad5c9f79-caf3-4fc7-b97d-4714a86a8e3c",
        "name": "Ping Google Sitemap",
        "type": "n8n-nodes-base.httpRequest",
        "typeVersion": 4.2,
        "position": [
          1050,
          500
        ],
        "parameters": {
          "url": "=https://www.google.com/ping?sitemap={{ $json.url }}",
          "options": {
            "timeout": 10000
          },
          "sendBody": false,
          "sendHeaders": false,
          "method": "GET"
        }
      }
    ],
    "connections": {
      "Webhook Trigger": {
        "main": [
          [
            {
              "node": "Format Article Data",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Format Article Data": {
        "main": [
          [
            {
              "node": "Publish to WordPress",
              "type": "main",
              "index": 0
            },
            {
              "node": "Queue Social Posts",
              "type": "main",
              "index": 0
            },
            {
              "node": "Send Email Notification",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Publish to WordPress": {
        "main": [
          [
            {
              "node": "Slack Notification",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Queue Social Posts": {
        "main": [
          [
            {
              "node": "Ping Google Sitemap",
              "type": "main",
              "index": 0
            }
          ]
        ]
      }
    }
  }
]