{
  "id": "qRGxZtwsBlPAMKp7",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Wordpress-to-csv",
  "tags": [],
  "nodes": [
    {
      "id": "4458af61-9300-402c-81c8-36e21a1570df",
      "name": "On clicking 'execute'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -864,
        -384
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "70fb6f65-7ee6-4faf-babe-d70a23caff76",
      "name": "Wordpress",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        -544,
        -384
      ],
      "parameters": {
        "options": {},
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "wordpressApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "80610a28-68af-4cee-a922-744368e8b790",
      "name": "Spreadsheet File",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        -144,
        -384
      ],
      "parameters": {
        "options": {},
        "operation": "toFile",
        "fileFormat": "csv"
      },
      "typeVersion": 1
    },
    {
      "id": "94a0da78-0847-4e6e-b928-ed6154291a57",
      "name": "Write Binary File",
      "type": "n8n-nodes-base.writeBinaryFile",
      "position": [
        192,
        -384
      ],
      "parameters": {
        "options": {},
        "fileName": "data.csv"
      },
      "typeVersion": 1
    },
    {
      "id": "a4105c6d-2cae-405d-b08c-490b73a299fa",
      "name": "Sticky Note - Trigger",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        -608
      ],
      "parameters": {
        "color": 7,
        "width": 260,
        "height": 380,
        "content": "## Trigger\nThis workflow starts only when you click **Execute workflow** manually.\nUse this for testing export flow before adding any schedule or webhook."
      },
      "typeVersion": 1
    },
    {
      "id": "cdb6ef83-5604-427c-9724-857707f2fd38",
      "name": "Sticky Note - Wordpress",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -608
      ],
      "parameters": {
        "color": 7,
        "width": 300,
        "height": 396,
        "content": "## WordPress fetch\nThis node connects to your WordPress site and gets all records for the selected resource.\nRight now it needs valid **WordPress credentials** in n8n, usually site URL, username, and **Application Password**.\nIf credentials are missing or wrong, this workflow fails here."
      },
      "typeVersion": 1
    },
    {
      "id": "e659ab53-b1aa-4445-9b0c-b41f5e9451b5",
      "name": "Sticky Note - CSV",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -608
      ],
      "parameters": {
        "color": 7,
        "width": 280,
        "height": 404,
        "content": "## Convert to CSV\nThis node takes the JSON output from WordPress and converts it into a CSV file in binary format.\nIt does **not** save the file by itself. It only prepares the file for the next node."
      },
      "typeVersion": 1
    },
    {
      "id": "54168bba-7956-4018-8adb-3c6465a64529",
      "name": "Sticky Note - Save File",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -608
      ],
      "parameters": {
        "color": 7,
        "width": 300,
        "height": 412,
        "content": "## Save file\nThis node writes the CSV file to disk on the machine where n8n is running.\nThe file path is set to `/home/node/.n8n/data.csv`, which is a commonly used writable path in n8n environments.\nThis saves on the **server**, not automatically on your laptop."
      },
      "typeVersion": 1
    },
    {
      "id": "45ca44ab-629c-4afb-a549-a765cfc3375a",
      "name": "Sticky Note - Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1440,
        -720
      ],
      "parameters": {
        "color": "#513434",
        "width": 412,
        "height": 584,
        "content": "## Full workflow explanation\\n\\nThis workflow does 4 things:\n\n* Manual trigger starts the flow when you click execute.\n* WordPress node fetches all items from your connected WordPress website.\n* Spreadsheet File node converts that data into a CSV binary file.\n* Write Binary File saves that CSV onto your n8n server.\\n\\n## Important issues\nThis will not work until you add valid WordPress credentials.\nThe workflow does **not** check whether the website is actually WordPress.\nThe file is saved on the server, not downloaded to your browser.\nIf the server path is not writable, the final node fails.\n\n### Best next upgrade\nYou should add validation before the WordPress node using an HTTP Request to check `/wp-json/`, then an IF node:\n\n### if valid WordPress, continue export\n- if not, return error\n\nCredentials needed\\nIn WordPress, create an **Application Password** from the user profile page, then use that in the n8n WordPress credential instead of your normal login password."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "e47eeaf8-0eba-4641-98b1-412cd805e8a9",
  "nodeGroups": [],
  "connections": {
    "Wordpress": {
      "main": [
        [
          {
            "node": "Spreadsheet File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Spreadsheet File": {
      "main": [
        [
          {
            "node": "Write Binary File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        [
          {
            "node": "Wordpress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}