{
  "name": "Postifys \u2014 Content Queue CSV import + run job",
  "nodes": [
    {
      "parameters": {},
      "id": "manual-1",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "mode": "manual",
        "duplicateItem": false,
        "assignments": {
          "assignments": [
            {
              "id": "0",
              "name": "tableId",
              "value": "CONTENT_QUEUE_TABLE_ID",
              "type": "string"
            },
            {
              "id": "1",
              "name": "jobId",
              "value": "CONTENT_QUEUE_JOB_ID",
              "type": "string"
            },
            {
              "id": "2",
              "name": "csv",
              "value": "title,description,hashtags,path,status,post_type\nSheet row,From n8n,#postifys,https://example.com/image.jpg,pending,IMAGE",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "set-1",
      "name": "Table + CSV",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        0
      ],
      "notes": "Create table + job in /compose first. API key needs publish scope. Match columns to GET /api/content-queue/import/template.csv"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://postifys.com/api/content-queue/tables/{{ $json.tableId }}/import",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ csv: $json.csv }) }}",
        "options": {}
      },
      "id": "http-import",
      "name": "Import CSV rows",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        0
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "REPLACE_WITH_POSTIFYS_HEADER_AUTH",
          "name": "Postifys API Key (Authorization: Bearer \u2026)"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://postifys.com/api/content-queue/jobs/{{ $('Table + CSV').item.json.jobId }}/run-now",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={}",
        "options": {}
      },
      "id": "http-run",
      "name": "Run queue job now",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        700,
        0
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "REPLACE_WITH_POSTIFYS_HEADER_AUTH",
          "name": "Postifys API Key (Authorization: Bearer \u2026)"
        }
      },
      "notes": "Publishing still depends on connected accounts and per-platform rules (TikTok Direct Post approval, LinkedIn member-only, etc.)."
    }
  ],
  "connections": {
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Table + CSV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Table + CSV": {
      "main": [
        [
          {
            "node": "Import CSV rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Import CSV rows": {
      "main": [
        [
          {
            "node": "Run queue job now",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "postifys-public-template"
  },
  "pinData": {},
  "versionId": "1",
  "tags": [
    {
      "name": "postifys"
    }
  ]
}
