{
  "nodes": [
    {
      "id": "92ffb384-849f-411b-981f-e324190eaae4",
      "name": "Post on Wordpress",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        1340,
        700
      ],
      "parameters": {
        "title": "={{ $json.Title }}",
        "additionalFields": {
          "status": "draft",
          "content": "={{ $json['Blog Body'] }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b3148c02-8088-4b81-afa8-1d57bef570e5",
      "name": "Upload Media",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1840,
        700
      ],
      "parameters": {
        "url": "=https://effibotics.com/wp-json/wp/v2/media",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "binaryData",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "content-disposition",
              "value": "=attachment; filename={{ $binary.data.fileName }}.{{ $binary.data.fileExtension }}"
            },
            {
              "name": "content-type",
              "value": "={{ $binary.data.mimeType }}"
            }
          ]
        },
        "inputDataFieldName": "data",
        "nodeCredentialType": "wordpressApi"
      },
      "typeVersion": 4.1
    },
    {
      "id": "d81ab003-fb36-4570-ab58-65b9a5db38be",
      "name": "Set Featured Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2000,
        700
      ],
      "parameters": {
        "url": "={{ $('Settings').item.json.wordpress_url }}wp-json/wp/v2/posts/{{ $('Post on Wordpress').item.json.id }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "featured_media",
              "value": "={{ $json.id }}"
            }
          ]
        },
        "nodeCredentialType": "wordpressApi"
      },
      "typeVersion": 4.1
    },
    {
      "id": "176ed2b0-2e27-4c04-a3fb-94842a82d3ab",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1040,
        700
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "66db867d-e056-4713-8877-14c60775738a",
              "name": "id",
              "type": "string",
              "value": "={{ $json.id }}"
            },
            {
              "id": "c2e3724a-1406-48a7-b15c-1cda06dd44e9",
              "name": "Title",
              "type": "string",
              "value": "={{ $json.Title }}"
            },
            {
              "id": "d47d0436-ae61-4c68-a57f-273e77354050",
              "name": "Keyword",
              "type": "string",
              "value": "={{ $json.Keyword }}"
            },
            {
              "id": "34d8bc1f-77f6-496e-a36f-faa06d5cd6dd",
              "name": "Blog Body",
              "type": "string",
              "value": "={{ $json[\"Blog Post\"].replace($json[\"Title\"],'') }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "ff8d11c0-a604-4959-8dbd-56a5265a0559",
      "name": "Get content to post",
      "type": "n8n-nodes-base.airtable",
      "position": [
        680,
        700
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appEanjsKFnMPZZz3",
          "cachedResultUrl": "https://airtable.com/appEanjsKFnMPZZz3",
          "cachedResultName": "SEO Doctor"
        },
        "limit": 3,
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblkWGFcUJ2WVyL9f",
          "cachedResultUrl": "https://airtable.com/appEanjsKFnMPZZz3/tblkWGFcUJ2WVyL9f",
          "cachedResultName": "AI Generated Blog Posts"
        },
        "options": {},
        "operation": "search",
        "returnAll": false,
        "filterByFormula": "SEARCH(\"To Post\", {Status})"
      },
      "typeVersion": 2
    },
    {
      "id": "43f99839-2690-4324-8d26-201fc55f7b02",
      "name": "Filter by existing Blogs",
      "type": "n8n-nodes-base.filter",
      "position": [
        860,
        700
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "d31b3381-dc99-41ae-b309-40e270ebf714",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json['Blog Post'] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "924eeb0a-ee5d-40f1-915c-19e34018c619",
      "name": "Markdown to HTML",
      "type": "n8n-nodes-base.markdown",
      "position": [
        1180,
        700
      ],
      "parameters": {
        "mode": "markdownToHtml",
        "options": {},
        "markdown": "={{ $json['Blog Body'] }} {{ $json['Blog Body'] }} {{ $json['Blog Body'] }}",
        "destinationKey": "Blog Body"
      },
      "typeVersion": 1
    },
    {
      "id": "3aed566c-04bc-4164-85d7-1f13a7862f5a",
      "name": "Get Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1500,
        700
      ],
      "parameters": {
        "url": "=https://api.pexels.com/v1/search?query= {{ $('Edit Fields').item.json.Keyword }}&per_page=1&width=1200&height=675&format=webp",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "lFlHMbYfTkSZ2HupBHDggMucIq38GQ5QICPstDPVdaHVxn9afY983qnS"
            },
            {
              "name": "content",
              "value": "= {{ $('Edit Fields').item.json.Keyword }}"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "2729c11b-0c94-4e05-9d98-80d70eac1c2d",
      "name": "Download the image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1660,
        700
      ],
      "parameters": {
        "url": "={{ $json.photos[0].src.landscape }}",
        "options": {},
        "responseFormat": "file"
      },
      "typeVersion": 2
    },
    {
      "id": "9b31f00c-dad3-403c-953e-21df2cd3af65",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        340
      ],
      "parameters": {
        "color": 7,
        "width": 662.5970350404314,
        "height": 321.75,
        "content": "## WordPress\uc5d0 \ucf58\ud150\uce20 \uac8c\uc2dc \uc790\ub3d9\ud654 \ubc0f \ub300\ud45c \uc774\ubbf8\uc9c0 \uc124\uc815\n\uc774 \uc6cc\ud06c\ud50c\ub85c\uc6b0\ub294 airtable\uc5d0\uc11c n8n\uc744 \uc0ac\uc6a9\ud558\uc5ec WordPress \uc0ac\uc774\ud2b8\uc5d0 \ucf58\ud150\uce20\ub97c \uacf5\uc720\ud558\ub294 \ud504\ub85c\uc138\uc2a4\ub97c \ub2e8\uc21c\ud654\ud558\ub294 \uac83\uc744 \ubaa9\ud45c\ub85c \ud569\ub2c8\ub2e4.\n\n### \uc0ac\uc6a9\ubc95\n1. AirTable\uc5d0\uc11c \ucf58\ud150\uce20\ub97c \uac00\uc838\uc635\ub2c8\ub2e4. \uc774 \ucf58\ud150\uce20\uac00 \ub9c8\ud06c\ub2e4\uc6b4 \ud615\uc2dd\uc73c\ub85c \ub418\uc5b4 \uc788\uc73c\ubbc0\ub85c, WordPress\uc5d0\uc11c \uac8c\uc2dc\ud558\uace0 \uad00\ub9ac\ud558\uae30 \uc27d\uac8c HTML \ud615\uc2dd\uc73c\ub85c \ubcc0\ud658\ud574\uc57c \ud569\ub2c8\ub2e4.\n2. \ucf58\ud150\uce20, \uc81c\ubaa9 \ubc0f \ucd5c\uc801\ud654\ub41c \ube14\ub85c\uadf8\uc5d0 \ud544\uc694\ud55c \ubaa8\ub4e0 \uad00\ub828 \uc815\ubcf4\ub97c \ud3ec\ud568\ud558\uc5ec \ube14\ub85c\uadf8 \uac8c\uc2dc\ubb3c\uc744 \uc5c5\ub85c\ub4dc\ud569\ub2c8\ub2e4.\n3. \uac8c\uc2dc\ubb3c\uc774 \uac8c\uc2dc\ub41c \ud6c4, \uc774\ubbf8\uc9c0\ub97c \uc5c5\ub85c\ub4dc\ud558\uace0 \ube14\ub85c\uadf8\uc758 \ub300\ud45c \uc774\ubbf8\uc9c0\ub85c \uc124\uc815\ud574\uc57c \ud569\ub2c8\ub2e4.\n\n### \ucd9c\ub825"
      },
      "typeVersion": 1
    },
    {
      "id": "ca838f99-39f7-4641-9293-502a7e0be912",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        520,
        700
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7eb92d69-3815-45d3-9da9-63a28b15f661",
      "name": "Update POST on Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2180,
        700
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appEanjsKFnMPZZz3",
          "cachedResultUrl": "https://airtable.com/appEanjsKFnMPZZz3",
          "cachedResultName": "SEO Doctor"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblkWGFcUJ2WVyL9f",
          "cachedResultUrl": "https://airtable.com/appEanjsKFnMPZZz3/tblkWGFcUJ2WVyL9f",
          "cachedResultName": "AI Generated Blog Posts"
        },
        "columns": {
          "value": {
            "id": "={{ $('Edit Fields').item.json.id }}",
            "Status": "Posted"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Blog Post",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Blog Post",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Star",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Star",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Intent",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Intent",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Draft",
                  "value": "Draft"
                },
                {
                  "name": "First Copy",
                  "value": "First Copy"
                },
                {
                  "name": "Second Copy",
                  "value": "Second Copy"
                },
                {
                  "name": "To Post",
                  "value": "To Post"
                },
                {
                  "name": "Posted",
                  "value": "Posted"
                },
                {
                  "name": "Review",
                  "value": "Review"
                },
                {
                  "name": "Tracking",
                  "value": "Tracking"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Keyword",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Keyword",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "count",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Word count",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Word count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Modified",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Last Modified",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Image",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Images",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Images",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "All keyword Data and Tracking",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "All keyword Data and Tracking",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Search Volume",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Search Volume",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Frequency",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Frequency",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ]
        },
        "options": {},
        "operation": "update"
      },
      "typeVersion": 2
    },
    {
      "id": "536659ab-ca94-420f-8110-e277676b939a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        340
      ],
      "parameters": {
        "height": 323,
        "content": "## \uc124\uc815\n1. WordPress \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc0dd\uc131\ud558\uace0 \ube44\ubc00\ubc88\ud638\ub97c \uc124\uc815\ud558\uc138\uc694\n\n2. Airtable\uc5d0 Keyword | Title | Blog content \uc5f4\uc744 \uac00\uc9c4 \ud14c\uc774\ube14\uc744 \ub9cc\ub4dc\uc138\uc694\n\n3. \uc774 \uacbd\uc6b0 \ube14\ub85c\uadf8 \ucf58\ud150\uce20\ub294 AI\uc5d0 \uc758\ud574 \uc0dd\uc131\ub41c \ub9c8\ud06c\ub2e4\uc6b4 \ud615\uc2dd\uc785\ub2c8\ub2e4"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Get Image": {
      "main": [
        [
          {
            "node": "Download the image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Markdown to HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Media": {
      "main": [
        [
          {
            "node": "Set Featured Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Markdown to HTML": {
      "main": [
        [
          {
            "node": "Post on Wordpress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get content to post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post on Wordpress": {
      "main": [
        [
          {
            "node": "Get Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download the image": {
      "main": [
        [
          {
            "node": "Upload Media",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Featured Image": {
      "main": [
        [
          {
            "node": "Update POST on Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get content to post": {
      "main": [
        [
          {
            "node": "Filter by existing Blogs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter by existing Blogs": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}