{
  "name": "social media content publishing",
  "tags": [],
  "nodes": [
    {
      "id": "b286e753-d483-4288-b777-55b4aaaa3a98",
      "name": "\ud83d\udcca Content Database (Media)",
      "type": "n8n-nodes-base.airtable",
      "notes": "\ud83d\udccb Fetches media and content from Airtable\n\u2022 Table: Youtube tool (tblRnaXqxrvcQhqBw)\n\u2022 Record: recuoYjg4icStHsMK\n\u2022 Contains: Video/image file IDs, social content\n\u2022 Fields: Short form Video, Image for socials\n\ud83d\udd17 Feeds into media download and upload pipeline",
      "position": [
        1440,
        300
      ],
      "parameters": {
        "id": "={{ $json.query.RecordId }}",
        "base": {
          "mode": "list",
          "value": "appTFomwpoQ8GVsSo"
        },
        "table": {
          "mode": "list",
          "value": "tblRnaXqxrvcQhqBw"
        },
        "options": {}
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "70607089-3c8d-42ec-8626-d51740cb9c75",
      "name": "\ud83d\udcf9 Video Upload to Postiz",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "\ud83d\udd04 Uploads video files to Postiz storage\n\u2022 Endpoint: POST /upload\n\u2022 Content-Type: multipart-form-data\n\u2022 Input: Binary video data from Google Drive\n\u2022 Output: Postiz file ID and path\n\u2022 Required: Videos must be uploaded before posting\n\u26a0\ufe0f Cannot use external URLs in Postiz posts",
      "position": [
        1880,
        100
      ],
      "parameters": {
        "url": "=https://postiz.yourdomain.com/api/public/v1/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "044473a4-12ba-48f1-ba2a-f6cea1d7d157",
      "name": "\ud83d\udcbe Save Video Path",
      "type": "n8n-nodes-base.airtable",
      "notes": "\ud83d\udd04 Updates Airtable with Postiz video path\n\u2022 Operation: Update record\n\u2022 Field: 'postiz video' = upload response path\n\u2022 Maintains data consistency across systems\n\u2022 Enables future reference to uploaded videos\n\ud83d\udcdd Links Google Drive \u2192 Postiz \u2192 Airtable chain",
      "position": [
        2100,
        100
      ],
      "parameters": {
        "base": {
          "mode": "list",
          "value": "appTFomwpoQ8GVsSo"
        },
        "table": {
          "mode": "list",
          "value": "tblRnaXqxrvcQhqBw"
        },
        "columns": {
          "value": {
            "id": "={{ $('\ud83d\udcca Content Database (Media)').item.json.id }}",
            "postiz video": "={{ $json.path }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "recordid",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "recordid",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "google drive",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "google drive",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "transcript",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "transcript",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "initial script",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "initial script",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "start",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "start",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "upload media",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "upload media",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Post to socials",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Post to socials",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Post shorts",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Post shorts",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "youtube_title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "youtube_title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "youtube_description",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "youtube_description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "youtube_thumbnail_text",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "youtube_thumbnail_text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "twitter single",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "twitter single",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "twitter_thread",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "twitter_thread",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_post",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "linkedin_post",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "facebook_post",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "facebook_post",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "facebook_story_caption",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "facebook_story_caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "instagram_post",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "instagram_post",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "instagram_reel",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "instagram_reel",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "tiktok_caption",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "tiktok_caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "youtube_shorts_caption",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "youtube_shorts_caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Short form Video",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Short form Video",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image for socials",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Image for socials",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "postiz image",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "postiz image",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "postiz video",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "postiz video",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Record ID",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "Record ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "typeVersion": 2.1
    },
    {
      "id": "052ba337-dba8-4451-8ca2-39862314fa4b",
      "name": "\ud83d\uddbc\ufe0f Image Upload to Postiz",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "\ud83d\udd04 Uploads image files to Postiz storage\n\u2022 Endpoint: POST /upload\n\u2022 Content-Type: multipart-form-data\n\u2022 Input: Binary image data from Google Drive\n\u2022 Output: Postiz file ID and path for posts\n\u2022 Supports: JPG, PNG, GIF formats\n\ud83d\udcf1 Used across Instagram, Twitter, LinkedIn, Facebook",
      "position": [
        1880,
        300
      ],
      "parameters": {
        "url": "=https://postiz.yourdomain.com/api/public/v1/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "98f5db1d-92da-4120-9ad6-d615d4112f94",
      "name": "\ud83d\udcbe Save Image Path",
      "type": "n8n-nodes-base.airtable",
      "notes": "\ud83d\udd04 Updates Airtable with Postiz image path\n\u2022 Operation: Update record\n\u2022 Field: 'postiz image' = upload response path\n\u2022 Used by all image-based social posts\n\u2022 Maintains referential integrity\n\ud83d\udcca Enables tracking of media usage across platforms",
      "position": [
        2100,
        300
      ],
      "parameters": {
        "base": {
          "mode": "list",
          "value": "appTFomwpoQ8GVsSo"
        },
        "table": {
          "mode": "list",
          "value": "tblRnaXqxrvcQhqBw"
        },
        "columns": {
          "value": {
            "id": "={{ $('\ud83d\udcca Content Database (Media)').item.json.id }}",
            "postiz image": "={{ $json.path }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "recordid",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "recordid",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "google drive",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "google drive",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "transcript",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "transcript",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "initial script",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "initial script",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "start",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "start",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "upload media",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "upload media",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Post to socials",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Post to socials",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Post shorts",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Post shorts",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "youtube_title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "youtube_title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "youtube_description",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "youtube_description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "youtube_thumbnail_text",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "youtube_thumbnail_text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "twitter single",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "twitter single",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "twitter_thread",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "twitter_thread",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_post",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "linkedin_post",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "facebook_post",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "facebook_post",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "facebook_story_caption",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "facebook_story_caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "instagram_post",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "instagram_post",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "instagram_reel",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "instagram_reel",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "tiktok_caption",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "tiktok_caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "youtube_shorts_caption",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "youtube_shorts_caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Short form Video",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Short form Video",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image for socials",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Image for socials",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "postiz image",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "postiz image",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "postiz video",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "postiz video",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Record ID",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "Record ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "typeVersion": 2.1
    },
    {
      "id": "e93e3769-7209-4134-ba6c-586e440b2c86",
      "name": "\ud83d\udce5 Download Video from Drive",
      "type": "n8n-nodes-base.googleDrive",
      "notes": "\u2601\ufe0f Downloads video from Google Drive\n\u2022 Input: Google Drive file ID from Airtable\n\u2022 Field: 'Short form Video'\n\u2022 Output: Binary video data\n\u2022 Formats: MP4, MOV, AVI supported\n\ud83d\udd17 Feeds directly into Postiz upload pipeline",
      "position": [
        1660,
        100
      ],
      "parameters": {
        "fileId": "{{FILEID_ID}}",
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "ec6aa9d3-584a-4fb7-a526-765b48e5b2cf",
      "name": "\ud83d\udce5 Download Image from Drive",
      "type": "n8n-nodes-base.googleDrive",
      "notes": "\u2601\ufe0f Downloads image from Google Drive\n\u2022 Input: Google Drive file ID from Airtable\n\u2022 Field: 'Image for socials'\n\u2022 Output: Binary image data\n\u2022 Used across all visual social platforms\n\ud83d\udcf1 Optimized for social media dimensions",
      "position": [
        1660,
        300
      ],
      "parameters": {
        "fileId": "{{FILEID_ID}}",
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "eed5e518-e6ba-4a07-89a5-eb254edcd4ec",
      "name": "\ud83d\udcdd Workflow Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 2390,
        "height": 900,
        "content": " ## \ud83d\udcdd POSTIZ MEDIA UPLOAD WORKFLOW\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\n\ud83c\udfaf PURPOSE:\nAutomated media upload pipeline that downloads videos and images from Google Drive and uploads them to Postiz storage for social media posting.\n\n\ud83d\udd04 WORKFLOW PROCESS:\n1. Webhook triggers the workflow\n2. Fetch media metadata from Airtable\n3. Download video + image from Google Drive\n4. Upload both files to Postiz storage\n5. Save Postiz file paths back to Airtable\n\n\ud83d\udd27 TECHNICAL DETAILS:\n\u2022 API: Postiz /upload endpoint (multipart-form-data)\n\u2022 Storage: Converts Google Drive files \u2192 Postiz URLs\n\u2022 Integration: Updates Airtable with Postiz paths\n\u2022 Required: All media must be uploaded before posting\n\n\n\n\n\n\n\n\n\u26a0\ufe0f CRITICAL NOTES:\n\u2022 Cannot use external URLs in Postiz posts\n\u2022 Files must be uploaded to google drive first - id referenced in airtable\n\u2022 Enables reference tracking for all platforms\n\n\ud83d\udcca DATA FLOW:\nGoogle Drive \u2192 Download \u2192 Postiz Upload \u2192 Airtable Update\n\n\ud83d\udd17 CONNECTS TO:\nMain social media posting workflows that reference these uploaded file paths for Instagram, Twitter, LinkedIn, Facebook, and YouTube posting.\n\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"
      },
      "typeVersion": 1
    },
    {
      "id": "005cadcd-777a-4718-a4fd-8c601c7030c1",
      "name": "\ud83d\udd17 integrations",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "\ud83d\udccb Fetches all connected social media integrations from Postiz\n\u2022 Gets integration IDs for Instagram, Twitter, LinkedIn, etc.\n\u2022 Required for platform-specific posting\n\u2022 Returns: id, name, identifier, disabled status",
      "position": [
        1080,
        1380
      ],
      "parameters": {
        "url": "https://postiz.yourdomain.com/api/public/v1/integrations",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2d6f74c0-e556-4700-97bc-1b1e2237e03e",
      "name": "\ud83d\udd00 Platform Router",
      "type": "n8n-nodes-base.switch",
      "notes": "\ud83c\udfaf Routes integrations to appropriate posting workflows\n\u2022 Instagram: cmcotolny0001pnal2i86mkrh\n\u2022 Twitter Alt: cmcg6ifpn001hmx9gakul0358\n\u2022 Twitter Main: cmcf026ts0001mx9g6o8t5xc4\n\u2022 LinkedIn: linkedin-page identifier\n\u2022 Facebook: facebook identifier\n\u2022 YouTube: youtube identifier\n\u26a0\ufe0f Integration IDs are unique per Postiz installation",
      "position": [
        1320,
        1320
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "instagram",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "3fc7d2c2-cd01-46ec-b4d1-6e4966722314",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.id }}",
                    "rightValue": "=cmcotolny0001pnal2i86mkrh"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "x alt",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "6236f9fa-bd4c-46c3-bfbb-4d50c7461fcb",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.id }}",
                    "rightValue": "cmcg6ifpn001hmx9gakul0358"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "x main",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "c0c50e74-7492-4009-9abc-9240cb69d135",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.id }}",
                    "rightValue": "cmcf026ts0001mx9g6o8t5xc4"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "linkedin-page",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "88d69331-8d87-48ef-85de-75404b9569d3",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.identifier }}",
                    "rightValue": "linkedin-page"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "facebook",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d5f1681e-2384-46f4-adcb-65ccc08e7606",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.identifier }}",
                    "rightValue": "facebook"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "youtube",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "047aae0a-c0f8-44b2-bc41-203287526cb5",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.identifier }}",
                    "rightValue": "youtube"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "7f44b9a2-fa18-4f85-8e8b-0df193e817e3",
      "name": "\ud83d\udc26 X/Twitter Posts",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "\ud83d\udcf1 Posts to Twitter/X using Postiz API\n\u2022 Uses cleaned 'twitter single' content from Airtable\n\u2022 Includes image from 'postiz image' field\n\u2022 Posts immediately (type: 'now')\n\u2022 Settings: type='post' for regular tweets\n\ud83d\udca1 Content must be cleaned to prevent JSON errors",
      "position": [
        1820,
        1180
      ],
      "parameters": {
        "url": "https://postiz.yourdomain.com/api/public/v1/posts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n   \"type\": \"now\",\n  \"date\": \"{{ $now.plus(1, 'minute').toISO() }}\",\n  \"order\": \"\",\n  \"shortLink\": true,\n  \"inter\": 0,\n  \n  \"tags\": [\n    {\n      \"value\": \"\",\n      \"label\": \"\"\n    }\n  ],\n \"posts\": [\n    {\n      \"integration\": {\n        \"id\": \"{{ $json.id }}\"\n      },\n      \"value\": [\n        {\n          \"content\": \"{{ $('\ud83d\udcca Content Database (Posts)').item.json['twitter single'] }}\",\n          \"image\": [\n            {\n              \"id\": \"1\",\n              \"path\": \"{{ $('\ud83d\udcca Content Database (Posts)').item.json.postiz_twitter }}\"\n            }\n          ]\n        }\n      ],\n       \"settings\": {\n          \"type\": \"post\"\n        }\n      }\n      ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "25817540-d225-432b-9e09-b766d2817947",
      "name": "\ud83d\udcbc LinkedIn Publisher",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "\ud83d\udcca Posts professional content to LinkedIn\n\u2022 Uses cleaned 'linkedin_post' content (processed by Code2)\n\u2022 Targets LinkedIn Pages (business accounts)\n\u2022 Professional formatting and tone\n\u2022 Image support for visual content\n\u2705 Content cleaning prevents JSON formatting errors",
      "position": [
        1840,
        1540
      ],
      "parameters": {
        "url": "https://postiz.yourdomain.com/api/public/v1/posts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n   \"type\": \"now\",\n  \"date\": \"{{ $now.plus(1, 'minute').toISO() }}\",\n  \"order\": \"\",\n  \"shortLink\": true,\n  \"inter\": 0,\n  \n  \"tags\": [\n    {\n      \"value\": \"\",\n      \"label\": \"\"\n    }\n  ],\n \"posts\": [\n    {\n      \"integration\": {\n        \"id\": \"{{ $json.id }}\"\n      },\n      \"value\": [\n        {\n          \"content\": \"{{ $json.linkedin_post }}\",\n          \"image\": [\n            {\n              \"id\": \"1\",\n              \"path\": \"{{ $('\ud83d\udcca Content Database (Posts)').item.json['postiz image'] }}\"\n            }\n          ]\n        }\n      ],\n       \"settings\": {\n          \"type\": \"post\"\n        }\n      }\n      ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4b40a5d7-d62e-4ad8-be51-cad72578c102",
      "name": "\ud83d\udc26 X/Twitter Alt Account",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "\ud83d\udcf1 Alternative Twitter/X account posting\n\u2022 Duplicate of main Twitter posting for secondary account\n\u2022 Uses same 'twitter single' content\n\u2022 Different integration ID for alt account\n\u2022 Maintains consistency across multiple X accounts\n\ud83d\udd04 Part of multi-account social strategy",
      "position": [
        1840,
        1360
      ],
      "parameters": {
        "url": "https://postiz.yourdomain.com/api/public/v1/posts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n   \"type\": \"now\",\n  \"date\": \"{{ $now.plus(1, 'minute').toISO() }}\",\n  \"order\": \"\",\n  \"shortLink\": true,\n  \"inter\": 0,\n  \n  \"tags\": [\n    {\n      \"value\": \"\",\n      \"label\": \"\"\n    }\n  ],\n \"posts\": [\n    {\n      \"integration\": {\n        \"id\": \"{{ $json.id }}\"\n      },\n      \"value\": [\n        {\n          \"content\": \"{{ $('\ud83d\udcca Content Database (Posts)').item.json['twitter single'] }}\",\n          \"image\": [\n            {\n              \"id\": \"1\",\n                  \"path\": \"{{ $('\ud83d\udcca Content Database (Posts)').item.json.postiz_twitter }}\"\n\n            }\n          ]\n        }\n      ]\n       }\n      ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d1ae77ee-cd24-4556-a2b8-cbc6e03a0890",
      "name": "\ud83e\uddf9 Instagram Content Cleaner",
      "type": "n8n-nodes-base.code",
      "notes": "\u26a0\ufe0f CRITICAL: Fixes JSON formatting issues\n\u2022 Removes line breaks (\\n), carriage returns (\\r), tabs (\\t)\n\u2022 Replaces multiple spaces with single spaces\n\u2022 Prevents 'JSON parameter needs to be valid JSON' errors\n\u2022 Essential for Instagram caption processing\n\ud83d\udeab Without this: API calls fail with malformed JSON",
      "position": [
        1540,
        1080
      ],
      "parameters": {
        "jsCode": "// \ud83e\uddf9 INSTAGRAM CONTENT CLEANER\n// Critical: Prevents 'JSON parameter needs to be valid JSON' errors\nlet content = $('\ud83d\udcca Content Database (Posts)').item.json.instagram_post;\n\ncontent = content\n  .replace(/[\\n\\r\\t]+/g, ' ')    // Replace all line breaks and tabs with spaces\n  .replace(/\\s{2,}/g, ' ')       // Replace multiple spaces with single space\n  .trim();                       // Remove leading/trailing whitespace\n\nreturn [{\n  json: {\n    ...items[0].json,\n    instagram_post: content\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "4df5a42d-013a-4842-a917-2e079da7a486",
      "name": "\ud83d\udcf8 Instagram Publisher",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "\ud83d\udcf1 Posts visual content to Instagram\n\u2022 Uses cleaned 'instagram_caption' (processed by Code1)\n\u2022 Requires image for all Instagram posts\n\u2022 Tags: 'instagram' for tracking\n\u2022 Settings: type='post' for feed posts\n\u2705 Working configuration with proper content cleaning",
      "position": [
        1820,
        1000
      ],
      "parameters": {
        "url": "https://postiz.yourdomain.com/api/public/v1/posts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"type\": \"now\",\n  \"date\": \"{{ $now.plus(1, 'minute').toISO() }}\",\n  \"shortLink\": true,\n  \"tags\": [\n    { \"value\": \"instagram\", \"label\": \"Instagram\" }\n  ],\n  \"posts\": [\n    {\n      \"integration\": {\n        \"id\": \"{{ $json.id }}\"\n      },\n      \"value\": [\n        {\n          \"content\": \"{{ $json.instagram_post }}\",\n          \"image\": [\n            {\n              \"id\": \"1\",\n              \"path\": \"{{ $('\ud83d\udcca Content Database (Posts)').item.json['postiz image'] }}\"\n            }\n          ]\n        }\n      ],\n       \"settings\": {\n          \"type\": \"post\"\n        }\n      }\n      ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c5ae7985-3f36-4225-bb64-4c2b674a2fe0",
      "name": "\ud83d\udcca Content Database (Posts)",
      "type": "n8n-nodes-base.airtable",
      "notes": "\ud83d\udccb Fetches social media content from Airtable\n\u2022 Same table/record as media source\n\u2022 Contains: platform-specific post content\n\u2022 Fields: instagram_caption, linkedin_post, twitter single, faceboook\n\u2022 Feeds content into cleaning and posting workflows\n\ud83d\udd04 Central content repository for all platforms",
      "position": [
        740,
        1380
      ],
      "parameters": {
        "id": "={{ $json.query.RecordId }}",
        "base": {
          "mode": "list",
          "value": "appTFomwpoQ8GVsSo"
        },
        "table": {
          "mode": "list",
          "value": "tblRnaXqxrvcQhqBw"
        },
        "options": {}
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "a0f582b4-aa2c-4bc0-b9cb-2033d5e23d09",
      "name": "\ud83e\uddf9 LinkedIn Content Cleaner",
      "type": "n8n-nodes-base.code",
      "notes": "\u26a0\ufe0f CRITICAL: Fixes JSON formatting for LinkedIn\n\u2022 Same cleaning logic as Instagram cleaner\n\u2022 Removes problematic characters: \\n, \\r, \\t\n\u2022 Prevents API failures with malformed JSON\n\u2022 Essential for LinkedIn professional content\n\ud83d\udcbc Maintains professional formatting while ensuring JSON validity",
      "position": [
        1640,
        1540
      ],
      "parameters": {
        "jsCode": "// \ud83e\uddf9 LINKEDIN CONTENT CLEANER\n// Critical: Prevents 'JSON parameter needs to be valid JSON' errors\nlet content = $('\ud83d\udcca Content Database (Posts)').item.json.linkedin_post;\n\ncontent = content\n  .replace(/[\\n\\r\\t]+/g, ' ')    // Replace all line breaks and tabs with spaces\n  .replace(/\\s{2,}/g, ' ')       // Replace multiple spaces with single space\n  .trim();                       // Remove leading/trailing whitespace\n\nreturn [{\n  json: {\n    ...items[0].json,\n    linkedin_post: content\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "5efa8626-343b-4ac9-a489-596d3404fd07",
      "name": "\ud83d\udcd8 Facebook Publisher",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "\ud83d\udcf1 Posts content to Facebook\n\u2022 Uses cleaned 'faceboook' content (processed by Code3)\n\u2022 Supports both images and videos\n\u2022 Similar functionality to Instagram\n\u2022 Settings: type='post' for feed posts\n\ud83d\udd35 Part of Meta ecosystem alongside Instagram",
      "position": [
        1840,
        1740
      ],
      "parameters": {
        "url": "https://postiz.yourdomain.com/api/public/v1/posts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n   \"type\": \"now\",\n  \"date\": \"{{ $now.plus(1, 'minute').toISO() }}\",\n  \"order\": \"\",\n  \"shortLink\": true,\n  \"inter\": 0,\n  \n  \"tags\": [\n    {\n      \"value\": \"\",\n      \"label\": \"\"\n    }\n  ],\n \"posts\": [\n    {\n      \"integration\": {\n        \"id\": \"{{ $json.id }}\"\n      },\n      \"value\": [\n        {\n          \"content\": \"{{ $json.faceboook_post }}\",\n          \"image\": [\n            {\n              \"id\": \"1\",\n              \"path\": \"{{ $('\ud83d\udcca Content Database (Posts)').item.json['postiz image'] }}\"\n            }\n          ]\n        }\n      ],\n       \"settings\": {\n          \"type\": \"post\"\n        }\n      }\n      ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "805df154-3f9e-493c-b950-7c2b59fe62e7",
      "name": "\ud83e\uddf9 Facebook Content Cleaner",
      "type": "n8n-nodes-base.code",
      "notes": "\u26a0\ufe0f CRITICAL: Fixes JSON formatting for Facebook\n\u2022 Cleans 'faceboook' field from Airtable\n\u2022 Same regex patterns as other cleaners\n\u2022 Prevents JSON parsing errors in API calls\n\u2022 Essential for Facebook posting reliability\n\ud83d\udcd8 Part of Meta content processing pipeline",
      "position": [
        1640,
        1740
      ],
      "parameters": {
        "jsCode": "// \ud83e\uddf9 FACEBOOK CONTENT CLEANER\n// Critical: Prevents 'JSON parameter needs to be valid JSON' errors\nlet content = $('\ud83d\udcca Content Database (Posts)').item.json.facebook_post;\n\ncontent = content\n  .replace(/[\\n\\r\\t]+/g, ' ')    // Replace all line breaks and tabs with spaces\n  .replace(/\\s{2,}/g, ' ')       // Replace multiple spaces with single space\n  .trim();                       // Remove leading/trailing whitespace\n\nreturn [{\n  json: {\n    ...items[0].json,\n    faceboook_post: content\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "197238c4-a400-4d12-858d-e5a0379f7a77",
      "name": "\ud83d\udcdd Complete Workflow Guide",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        980
      ],
      "parameters": {
        "color": 3,
        "width": 2400,
        "height": 1200,
        "content": "## \ud83d\udcf1 SOCIAL MEDIA POSTING WORKFLOW\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\n\ud83c\udfaf PURPOSE:\nAutomated multi-platform social media posting using Postiz API. Distributes content across Instagram, Twitter/X (2 accounts), LinkedIn, and Facebook with platform-specific content cleaning and formatting.\n\n\ud83d\udd04 COMPLETE WORKFLOW PROCESS:\n1. \ud83d\udcca Fetch social media content from Airtable database\n2. \ud83d\udd17 Get integration IDs for all connected social platforms\n3. \ud83d\udd00 Route each platform to appropriate content processor\n4. \ud83e\uddf9 Clean content to prevent JSON formatting errors\n5. \ud83d\udcf1 Post to respective social media platforms simultaneously\n\n\ud83d\udccb PLATFORM COVERAGE:\n\u2022 \ud83d\udcf8 Instagram (Visual content + captions)\n\u2022 \ud83d\udc26 Twitter/X Main Account (Text + images)\n\u2022 \ud83d\udc26 Twitter/X Alt Account (Duplicate posting)\n\u2022 \ud83d\udcbc LinkedIn (Professional content)\n\u2022 \ud83d\udcd8 Facebook (Meta ecosystem posting)\n\n\u26a0\ufe0f CRITICAL CONTENT CLEANING:\n\u2022 Removes line breaks (\\n), carriage returns (\\r), tabs (\\t)\n\u2022 Replaces multiple spaces with single spaces\n\u2022 Prevents 'JSON parameter needs to be valid JSON' errors\n\u2022 ESSENTIAL: Without cleaning, all API calls fail!\n\n\ud83d\udd27 TECHNICAL SPECIFICATIONS:\n\u2022 API: Postiz /posts endpoint (POST)\n\u2022 Authentication: HTTP Header Auth\n\u2022 Content-Type: application/json\n\u2022 Posting Type: Immediate ('now') + 1 minute delay\n\u2022 Media: References pre-uploaded Postiz image paths\n\u2022 Rate Limit: 30 requests/hour (API beta limitation)\n\n\ud83d\udd17 DATA SOURCES:\n\u2022 Content: Airtable \n\u2022 Media: Pre-uploaded via separate media upload workflow\n\u2022 Fields: instagram_caption, linkedin_post, twitter single, faceboook\n\u2022 Images: References 'postiz image' field paths\n\n\u26a1 EXECUTION FLOW:\nAirtable \u2192 Integrations \u2192 Platform Router \u2192 Content Cleaners \u2192 Social Publishers\n\n\ud83d\udea8 TROUBLESHOOTING:\n\u2022 JSON Errors: Check content cleaning nodes\n\u2022 500 Errors: Verify integration IDs and account connections\n\u2022 Missing Media: Ensure media upload workflow ran first\n\u2022 Rate Limits: Space out executions (30/hour limit)\n\n\ud83d\udd04 DEPENDENCIES:\n\u2022 Requires: Media upload workflow (for image/video paths)\n\u2022 Connects to: Analytics and monitoring workflows\n\u2022 Updates: Airtable with posting status and URLs\n\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"
      },
      "typeVersion": 1
    },
    {
      "id": "4fcdcc17-949a-4b2f-ae70-a22e0f2da504",
      "name": "\ud83c\udfac YouTube Publisher",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "\ud83d\udcfa Posts content to YouTube (Note: Uses Facebook content)\n\u2022 Currently using 'faceboook' content field\n\u2022 Uses 'postiz image' instead of video\n\u2022 May need adjustment for proper YouTube video posting\n\u2022 YouTube typically requires video content, not images\n\u26a0\ufe0f Configuration may need refinement for YouTube specifics",
      "position": [
        1880,
        2940
      ],
      "parameters": {
        "url": "https://postiz.yourdomain.com/api/public/v1/posts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n \"type\": \"now\",\n \"date\": \"{{ $now.plus(1, 'minute').toISO() }}\",\n \"order\": \"\",\n \"shortLink\": true,\n \"inter\": 0,\n \"tags\": [\n   {\n     \"value\": \"\",\n     \"label\": \"\"\n   }\n ],\n \"posts\": [\n   {\n     \"integration\": {\n       \"id\": \"{{ $json.id }}\"\n     },\n     \"value\": [\n       {\n         \"content\": \"{{ $('\ud83d\udcca Content Database (Video)').item.json.youtube_shorts_caption }}\",\n         \"image\": [\n           {\n             \"id\": \"1\",\n             \"path\": \"{{ $('\ud83d\udcca Content Database (Video)').item.json['postiz video'] }}\"\n           }\n         ]\n       }\n     ],\n     \"settings\": {\n       \"__type\": \"youtube\",\n       \"title\": \"{{ $('\ud83d\udcca Content Database (Video)').item.json.youtube_title }}\",\n       \"type\": \"public\",\n       \"tags\": [\"tag1\", \"tag2\"],\n       \"categoryId\": \"22\",\n       \"madeForKids\": false\n     }\n   }\n ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "48f59939-c58a-4837-8377-a412cbb2439e",
      "name": "\ud83e\uddf9 Facebook Video Cleaner",
      "type": "n8n-nodes-base.code",
      "notes": "\u26a0\ufe0f CRITICAL: Content cleaner for Facebook videos\n\u2022 Processes Facebook content for video posts\n\u2022 References 'Airtable' node (video workflow)\n\u2022 Same cleaning regex as other cleaners\n\u2022 Prevents JSON formatting errors\n\ud83d\udcf9 Part of Facebook video content pipeline",
      "position": [
        1580,
        2680
      ],
      "parameters": {
        "jsCode": "// \ud83e\uddf9 FACEBOOK VIDEO CONTENT CLEANER\n// Critical: Prevents 'JSON parameter needs to be valid JSON' errors\nlet content = $('\ud83d\udcca Content Database (Video)').item.json.facebook_story_caption;\n\ncontent = content\n  .replace(/[\\n\\r\\t]+/g, ' ')    // Replace all line breaks and tabs with spaces\n  .replace(/\\s{2,}/g, ' ')       // Replace multiple spaces with single space\n  .trim();                       // Remove leading/trailing whitespace\n\nreturn [{\n  json: {\n    ...items[0].json,\n    facebook_story_caption: content\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "243b21a0-540c-4069-ac04-26b8ef107ebb",
      "name": "\ud83d\udcd8 Facebook Video Publisher",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "\ud83d\udcf1 Posts video content to Facebook\n\u2022 Uses Facebook content with '11111' test suffix\n\u2022 References 'postiz video' for video content\n\u2022 Part of Facebook video strategy\n\u2022 Same API structure as other platforms\n\ud83c\udfac Facebook video content distribution",
      "position": [
        1880,
        2680
      ],
      "parameters": {
        "url": "https://postiz.yourdomain.com/api/public/v1/posts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n   \"type\": \"now\",\n  \"date\": \"{{ $now.plus(1, 'minute').toISO() }}\",\n  \"order\": \"\",\n  \"shortLink\": true,\n  \"inter\": 0,\n  \n  \"tags\": [\n    {\n      \"value\": \"\",\n      \"label\": \"\"\n    }\n  ],\n \"posts\": [\n    {\n      \"integration\": {\n        \"id\": \"{{ $json.id }}\"\n      },\n      \"value\": [\n        {\n          \"content\": \"{{ $('\ud83d\udcca Content Database (Video)').item.json.facebook_story_caption }}\",\n          \"image\": [\n            {\n              \"id\": \"1\",\n              \"path\": \"{{ $('\ud83d\udcca Content Database (Video)').item.json['postiz video'] }}\"\n            }\n          ]\n        }\n      ],\n       \"settings\": {\n          \"type\": \"post\"\n        }\n      }\n      ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d5d60a64-f453-4ebb-b72d-7bf3a2e94f10",
      "name": "\ud83d\udcca Content Database (Video)",
      "type": "n8n-nodes-base.airtable",
      "notes": "\ud83d\udccb Content source for video workflow\n\u2022 Same table/record as other Airtable nodes\n\u2022 Provides content for video-based posts\n\u2022 Contains uploaded video paths ('postiz video')\n\u2022 Feeds into video content processing\n\ud83c\udfac Specialized for video content distribution",
      "position": [
        880,
        2740
      ],
      "parameters": {
        "id": "={{ $json.query.RecordId }}",
        "base": {
          "mode": "list",
          "value": "appTFomwpoQ8GVsSo"
        },
        "table": {
          "mode": "list",
          "value": "tblRnaXqxrvcQhqBw"
        },
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "4c773e3c-6c88-41ea-b9a4-12f22a32f812",
      "name": "\ud83d\udcf9 Instagram Video Publisher",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "\ud83d\udcf1 Posts video content to Instagram\n\u2022 Uses cleaned caption from video cleaner\n\u2022 References 'postiz video' field (uploaded video)\n\u2022 Can be used for Reels or regular video posts\n\u2022 Same structure as image posts but with video\n\ud83c\udfac Supports Instagram's video content strategy",
      "position": [
        1880,
        2460
      ],
      "parameters": {
        "url": "https://postiz.yourdomain.com/api/public/v1/posts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"type\": \"now\",\n  \"date\": \"{{ $now.plus(1, 'minute').toISO() }}\",\n  \"shortLink\": true,\n  \"tags\": [\n    { \"value\": \"instagram\", \"label\": \"Instagram\" }\n  ],\n  \"posts\": [\n    {\n      \"integration\": {\n        \"id\": \"{{ $json.id }}\"\n      },\n      \"value\": [\n        {\n          \"content\": \"{{ $json.instagram_reel }}\",\n          \"image\": [\n            {\n              \"id\": \"1\",\n              \"path\": \"{{ $('\ud83d\udcca Content Database (Video)').item.json['postiz video'] }}\"\n            }\n          ]\n        }\n      ],\n       \"settings\": {\n          \"type\": \"post\"\n        }\n      }\n      ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "72144a39-2990-46a3-a034-7f876351f8b0",
      "name": "\ud83e\uddf9 Instagram Video Cleaner",
      "type": "n8n-nodes-base.code",
      "notes": "\u26a0\ufe0f CRITICAL: Content cleaner for video workflow\n\u2022 Same cleaning logic as image workflow\n\u2022 Processes Instagram captions for video posts\n\u2022 References different Airtable node ('Airtable' vs 'Airtable2')\n\u2022 Prevents JSON errors in video posting\n\ud83d\udcf9 Part of video-specific content pipeline",
      "position": [
        1580,
        2460
      ],
      "parameters": {
        "jsCode": "// \ud83e\uddf9 INSTAGRAM VIDEO CONTENT CLEANER\n// Critical: Prevents 'JSON parameter needs to be valid JSON' errors\nlet content = $('\ud83d\udcca Content Database (Video)').item.json.instagram_reel;\n\ncontent = content\n  .replace(/[\\n\\r\\t]+/g, ' ')    // Replace all line breaks and tabs with spaces\n  .replace(/\\s{2,}/g, ' ')       // Replace multiple spaces with single space\n  .trim();                       // Remove leading/trailing whitespace\n\nreturn [{\n  json: {\n    ...items[0].json,\n    instagram_reel: content\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "a58ad06d-fcff-4a2b-b7dc-7ca7ca7e5327",
      "name": "\ud83d\udd00 Video Platform Router",
      "type": "n8n-nodes-base.switch",
      "notes": "\ud83c\udfaf Routes video-based content to platforms\n\u2022 Instagram: For video posts and reels\n\u2022 Facebook: For video content\n\u2022 YouTube: For long-form video uploads\n\u2022 Simplified routing for video workflow\n\ud83d\udcf9 Specialized for video content distribution",
      "position": [
        1320,
        2740
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "instagram",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "3fc7d2c2-cd01-46ec-b4d1-6e4966722314",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.id }}",
                    "rightValue": "=cmcotolny0001pnal2i86mkrh"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "facebook",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d5f1681e-2384-46f4-adcb-65ccc08e7606",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.identifier }}",
                    "rightValue": "facebook"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "youtube",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "047aae0a-c0f8-44b2-bc41-203287526cb5",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.identifier }}",
                    "rightValue": "youtube"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "16c129d8-4a74-43f7-8457-cb3c9122acf0",
      "name": "\ud83d\udd17 integrations (Branch 2)",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "\ud83d\udccb Secondary integrations fetch for video workflow\n\u2022 Duplicate of main integrations node\n\u2022 Supports video-based posting workflow\n\u2022 Gets platform IDs for Instagram/Facebook video posts\n\u2022 Enables parallel processing of different content types",
      "position": [
        1100,
        2740
      ],
      "parameters": {
        "url": "https://postiz.yourdomain.com/api/public/v1/integrations",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "25c76242-2527-4b09-8169-25f0d6e1821c",
      "name": "\ud83d\udcdd Video Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        2260
      ],
      "parameters": {
        "color": 4,
        "width": 2380,
        "height": 940,
        "content": "## \ud83c\udfac VIDEO POSTING WORKFLOW\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\n\ud83c\udfaf PURPOSE:\nAutomated video content distribution across Instagram, Facebook, and YouTube using Postiz API. Specialized workflow for video content with platform-specific processing and cleaning.\n\n\ud83d\udd04 WORKFLOW EXECUTION:\n1. \ud83d\udcca Fetch video content from Airtable database (recuoYjg4icStHsMK)\n2. \ud83d\udd17 Get integration IDs for video-enabled platforms\n3. \ud83d\udd00 Route platforms to appropriate video processors\n4. \ud83e\uddf9 Clean content for Instagram & Facebook (YouTube bypassed)\n5. \ud83d\udcf9 Publish to video platforms simultaneously\n\n\ud83d\udcf9 PLATFORM COVERAGE:\n\u2022 \ud83d\udcf1 Instagram: Video posts & Reels (\u2705 Working)\n\u2022 \ud83d\udcd8 Facebook: Video content (\u26a0\ufe0f Test mode)\n\u2022 \ud83c\udfac YouTube: Long-form videos (\ud83d\udea8 Broken)\n\n\u26a1 EXECUTION FLOW:\nAirtable \u2192 Integrations \u2192 Video Router \u2192 [3 Parallel Paths]\n\u251c\u2500\u2500 Instagram: Cleaner \u2192 Publisher\n\u251c\u2500\u2500 Facebook: Cleaner \u2192 Publisher  \n\u2514\u2500\u2500 YouTube: [Direct] \u2192 Publisher\n\n\ud83d\uddc4\ufe0f DATA SOURCE:\n\u2022 Base: Netkreatives.com \n\u2022 Table: Youtube tool \n\u2022 Video Field: 'postiz video'\n\u2022 Content Fields: instagram_caption, faceboook\n\n\n\ud83d\udd27 TECHNICAL SPECS:\n\u2022 Method: POST\n\u2022 Auth: HTTP Header (Postiz credentials)\n\u2022 Timing: Immediate posting (+1 minute delay)\n\u2022 Media: Pre-uploaded video paths\n\u2022 Content-Type: application/json"
      },
      "typeVersion": 1
    },
    {
      "id": "e12c5d52-cba9-4917-9a1c-17e44a550a13",
      "name": "\ud83d\udd0d Content Validator & Cleaner1",
      "type": "n8n-nodes-base.code",
      "notes": "\u2705 Comprehensive validation and cleaning\n\u2022 Validates content for all platforms\n\u2022 Character limit enforcement\n\u2022 JSON-safe content cleaning\n\u2022 Media availability checks\n\u2022 Error and warning collection",
      "position": [
        740,
        1660
      ],
      "parameters": {
        "jsCode": "// \ud83d\udcca COMPREHENSIVE CONTENT VALIDATION & PREPARATION\nconst item = $input.first();\nconst data = item.json;\n\n// Validation results\nconst validation = {\n  hasContent: false,\n  hasMedia: false,\n  platforms: [],\n  errors: [],\n  warnings: []\n};\n\n// Content fields mapping\nconst contentFields = {\n  instagram: 'instagram_caption',\n  twitter: 'twitter single',\n  linkedin: 'linkedin_post',\n  facebook: 'faceboook'\n};\n\n// Media fields\nconst mediaFields = ['postiz image', 'postiz video'];\n\n// Validate content for each platform\nfor (const [platform, field] of Object.entries(contentFields)) {\n  if (data[field] && data[field].trim().length > 0) {\n    validation.platforms.push(platform);\n    validation.hasContent = true;\n  } else {\n    validation.warnings.push(`Missing ${platform} content in field '${field}'`);\n  }\n}\n\n// Validate media availability\nfor (const field of mediaFields) {\n  if (data[field] && data[field].trim().length > 0) {\n    validation.hasMedia = true;\n    break;\n  }\n}\n\nif (!validation.hasMedia) {\n  validation.warnings.push('No media files available (image or video)');\n}\n\n// Critical validations\nif (!validation.hasContent) {\n  validation.errors.push('No content available for any platform');\n}\n\nif (validation.platforms.length === 0) {\n  validation.errors.push('No valid platforms found with content');\n}\n\n// Prepare cleaned content for each platform\nconst cleanedContent = {};\nfor (const [platform, field] of Object.entries(contentFields)) {\n  if (data[field]) {\n    // Enhanced content cleaning\n    let content = data[field]\n      .replace(/[\\n\\r\\t]+/g, ' ')           // Line breaks and tabs\n      .replace(/\\s{2,}/g, ' ')             // Multiple spaces\n      .replace(/[\"']/g, (match) => match === '\"' ? '\\\"' : \"'\")  // Escape quotes\n      .replace(/[\\\\]/g, '\\\\\\\\')             // Escape backslashes\n      .trim();                             // Trim whitespace\n    \n    // Platform-specific length validation\n    const limits = {\n      twitter: 280,\n      instagram: 2200,\n      linkedin: 3000,\n      facebook: 63206\n    };\n    \n    if (content.length > limits[platform]) {\n      validation.warnings.push(`${platform} content exceeds ${limits[platform]} characters (${content.length})`);\n      content = content.substring(0, limits[platform] - 3) + '...';\n    }\n    \n    cleanedContent[platform] = content;\n  }\n}\n\nreturn [{\n  json: {\n    originalData: data,\n    validation: validation,\n    cleanedContent: cleanedContent,\n    recordId: data.id,\n    processedAt: new Date().toISOString(),\n    mediaAvailable: {\n      image: !!data['postiz image'],\n      video: !!data['postiz video'],\n      imagePath: data['postiz image'] || null,\n      videoPath: data['postiz video'] || null\n    }\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "b973a280-202c-4cc0-b691-e03506e525a0",
      "name": "\ud83d\udccb Content Availability Check1",
      "type": "n8n-nodes-base.if",
      "notes": "\ud83d\udd0d Validates processed content\n\u2022 Ensures content exists for posting\n\u2022 Checks for critical validation errors\n\u2022 Routes to error handling if needed\n\u2022 Prevents unnecessary API calls",
      "position": [
        960,
        1660
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "has_content",
              "operator": {
                "type": "boolean",
                "operation": "equals"
              },
              "leftValue": "={{ $json.validation.hasContent }}",
              "rightValue": true
            },
            {
              "id": "no_errors",
              "operator": {
                "type": "number",
                "operation": "equals"
              },
              "leftValue": "={{ $json.validation.errors.length }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "bc714a0a-a511-466f-ac0c-754426bd12dc",
      "name": "\u274c Content Error1",
      "type": "n8n-nodes-base.stopAndError",
      "notes": "\ud83d\udeab Handles missing/invalid content\n\u2022 Detailed validation results\n\u2022 Platform-specific feedback\n\u2022 Record identification\n\u2022 Debugging information",
      "position": [
        1120,
        1840
      ],
      "parameters": {
        "errorMessage": "No valid content found for posting"
      },
      "typeVersion": 1
    },
    {
      "id": "b74388c2-6f88-4cf1-b098-88dad5287a37",
      "name": "\ud83c\udfaf Upload",
      "type": "n8n-nodes-base.webhook",
      "notes": "\ud83d\ude80 Entry point for social media automation\n\u2022 Webhook URL: /webhook/328d95ae-3de0-41bf-a8bf-52071bdb36d3\n\u2022 Triggers entire posting workflow\n\u2022 Can be called from external systems\n\u2022 Starts both media upload and content posting processes",
      "position": [
        780,
        300
      ],
      "parameters": {
        "path": "328d95ae-3de0-41bf-a8bf-52071bdb36d3",
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "92997282-93db-4a88-889f-ef56e9b13f39",
      "name": "Post",
      "type": "n8n-nodes-base.webhook",
      "position": [
        520,
        1380
      ],
      "parameters": {
        "path": "7263d416-6333-429d-9767-528fc6dced38",
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "8c1ccf7a-8251-47d2-a378-3762aa8591bd",
      "name": "Video",
      "type": "n8n-nodes-base.webhook",
      "position": [
        600,
        2740
      ],
      "parameters": {
        "path": "26fd48c7-7ef9-44ad-9816-feedd75426f4",
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "b1edc2de-fcea-4e8c-a924-bc9da4f36e3c",
      "name": "\ud83d\udcca Fixed Results Processor",
      "type": "n8n-nodes-base.code",
      "notes": "\ud83d\udcc8 FIXED: Now correctly maps integration IDs to platforms\n\u2022 Uses your exact integration IDs from Switch node\n\u2022 Detects success via postId field\n\u2022 Tracks all platforms correctly\n\u2022 No more 'undefined' platforms!",
      "position": [
        2100,
        1400
      ],
      "parameters": {
        "jsCode": "// \ud83d\udcca FIXED RESULTS PROCESSOR (MINIMAL CHANGES)\nconst items = $input.all();\n\n// Integration ID to platform mapping (from your working Switch node)\nconst integrationToPlatform = {\n  'cmcotolny0001pnal2i86mkrh': { platform: 'instagram', account: 'main' },\n  'cmcg6ifpn001hmx9gakul0358': { platform: 'x', account: 'alt' },\n  'cmcf026ts0001mx9g6o8t5xc4': { platform: 'x', account: 'main' },\n  'cmcf02lp60003mx9gv2yff255': { platform: 'linkedin', account: 'main' },\n  'cmcf054k4000bmx9gg9va2ce1': { platform: 'facebook', account: 'main' },\n  'cmcouv8y00001kub0bb6cchea': { platform: 'youtube', account: 'main' }\n};\n\nconst results = {\n  totalPosts: items.length,\n  successful: 0,\n  failed: 0,\n  platforms: {},\n  errors: [],\n  postIds: [],\n  executionSummary: {\n    recordId: null,\n    startTime: new Date().toISOString(),\n    platforms: [],\n    overallStatus: 'success'\n  }\n};\n\n// Process each posting result\nfor (const item of items) {\n  const response = item.json;\n  \n  // Get platform info from integration ID in the response\n  const platformInfo = integrationToPlatform[response.integration] || { platform: 'unknown', account: 'main' };\n  const platform = platformInfo.platform;\n  const account = platformInfo.account;\n  \n  if (!results.platforms[platform]) {\n    results.platforms[platform] = {\n      attempted: 0,\n      successful: 0,\n      failed: 0,\n      accounts: {}\n    };\n  }\n  \n  results.platforms[platform].attempted++;\n  \n  if (!results.platforms[platform].accounts[account]) {\n    results.platforms[platform].accounts[account] = {\n      status: 'unknown',\n      postId: null,\n      error: null,\n      integrationId: response.integration\n    };\n  }\n  \n  // Check if the post was successful - Postiz returns 'postId' on success\n  if (response.postId && response.postId.length > 0) {\n    results.successful++;\n    results.platforms[platform].successful++;\n    results.platforms[platform].accounts[account].status = 'success';\n    results.platforms[platform].accounts[account].postId = response.postId;\n    results.postIds.push({\n      platform: platform,\n      account: account,\n      postId: response.postId,\n      integrationId: response.integration,\n      url: response.url || null\n    });\n  } else {\n    results.failed++;\n    results.platforms[platform].failed++;\n    results.platforms[platform].accounts[account].status = 'failed';\n    \n    // Extract error message\n    let errorMessage = 'Unknown error';\n    if (response.error) {\n      errorMessage = typeof response.error === 'string' ? response.error : JSON.stringify(response.error);\n    } else if (response.message) {\n      errorMessage = response.message;\n    } else if (!response.postId) {\n      errorMessage = 'No post ID returned from Postiz';\n    }\n    \n    results.platforms[platform].accounts[account].error = errorMessage;\n    results.errors.push({\n      platform: platform,\n      account: account,\n      error: errorMessage,\n      integrationId: response.integration,\n      details: response\n    });\n  }\n}\n\n// Set overall status\nif (results.failed > 0) {\n  results.executionSummary.overallStatus = results.successful > 0 ? 'partial' : 'failed';\n}\n\n// Try to get record ID from Airtable node\ntry {\n  const airtableData = $('\ud83d\udcca Content Database (Posts)1').first();\n  if (airtableData && airtableData.json.id) {\n    results.executionSummary.recordId = airtableData.json.id;\n  }\n} catch (e) {\n  console.log('Could not get record ID from Airtable node');\n}\n\nresults.executionSummary.platforms = Object.keys(results.platforms);\n\n// Add debug info\nresults.debug = {\n  itemCount: items.length,\n  sampleResponse: items[0]?.json || null,\n  integrationMappings: Object.keys(integrationToPlatform).length,\n  platformsProcessed: Object.keys(results.platforms)\n};\n\nreturn [{ json: results }];"
      },
      "typeVersion": 2
    },
    {
      "id": "d1d3833e-2209-4c11-84de-a35ba7f1775d",
      "name": "\ud83d\uddbc\ufe0f Image Upload to Postiz2",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "\ud83d\udd04 Uploads image files to Postiz storage\n\u2022 Endpoint: POST /upload\n\u2022 Content-Type: multipart-form-data\n\u2022 Input: Binary image data from Google Drive\n\u2022 Output: Postiz file ID and path for posts\n\u2022 Supports: JPG, PNG, GIF formats\n\ud83d\udcf1 Used across Instagram, Twitter, LinkedIn, Facebook",
      "position": [
        1880,
        520
      ],
      "parameters": {
        "url": "=https://postiz.yourdomain.com/api/public/v1/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2786d270-9637-4773-9289-b4147bef6ba0",
      "name": "\ud83d\udcbe Save Image Path1",
      "type": "n8n-nodes-base.airtable",
      "notes": "\ud83d\udd04 Updates Airtable with Postiz image path\n\u2022 Operation: Update record\n\u2022 Field: 'postiz image' = upload response path\n\u2022 Used by all image-based social posts\n\u2022 Maintains referential integrity\n\ud83d\udcca Enables tracking of media usage across platforms",
      "position": [
        2100,
        520
      ],
      "parameters": {
        "base": {
          "mode": "list",
          "value": "appTFomwpoQ8GVsSo"
        },
        "table": {
          "mode": "list",
          "value": "tblRnaXqxrvcQhqBw"
        },
        "columns": {
          "value": {
            "id": "={{ $('\ud83d\udcca Content Database (Media)').item.json.id }}",
            "postiz_twitter": "={{ $json.path }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "recordid",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "recordid",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "google drive",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "google drive",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "transcript",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "transcript",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "initial script",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "initial script",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "start",
              "type": "boolean",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "start",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "upload media",
              "type": "boolean",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "upload media",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Post to socials",
              "type": "boolean",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Post to socials",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Post shorts",
              "type": "boolean",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Post shorts",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Short form Video",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Short form Video",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image for socials",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Image for socials",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "postiz image",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "postiz image",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "postiz video",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "postiz video",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "twitter image",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "twitter image",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "postiz_twitter",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "postiz_twitter",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Record ID",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "Record ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "youtube_title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "youtube_title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "youtube_description",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "youtube_description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "youtube_thumbnail_text",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "youtube_thumbnail_text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "twitter single",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "twitter single",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "twitter_thread",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "twitter_thread",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_post",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "linkedin_post",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "facebook_post",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "facebook_post",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "facebook_story_caption",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "facebook_story_caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "instagram_post",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "instagram_post",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "instagram_reel",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "instagram_reel",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "tiktok_caption",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "tiktok_caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "youtube_shorts_caption",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "youtube_shorts_caption",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "typeVersion": 2.1
    },
    {
      "id": "0a4e8a7d-efef-4771-abdd-1e998072b38a",
      "name": "\ud83d\udce5 Download x image from Drive",
      "type": "n8n-nodes-base.googleDrive",
      "notes": "\u2601\ufe0f Downloads image from Google Drive\n\u2022 Input: Google Drive file ID from Airtable\n\u2022 Field: 'Image for socials'\n\u2022 Output: Binary image data\n\u2022 Used across all visual social platforms\n\ud83d\udcf1 Optimized for social media dimensions",
      "position": [
        1660,
        520
      ],
      "parameters": {
        "fileId": "{{FILEID_ID}}",
        "options": {},
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "1d285bf8-dc2a-4a35-b364-990bcbd718de",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        880,
        440
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "3a573341-05dd-45de-8db8-c3050877631b",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1100,
        440
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "5150e645-480f-428a-b261-32d53ba9c0b3",
              "name": "query.RecordId",
              "type": "string",
              "value": "recuoYjg4icStHsMK"
            }
          ]
        }
      },
      "typeVersion": 3.4
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "Post": {
      "main": [
        [
          {
            "node": "\ud83d\udcca Content Database (Posts)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Video": {
      "main": [
        [
          {
            "node": "\ud83d\udcca Content Database (Video)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "\ud83d\udcca Content Database (Media)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83c\udfaf Upload": {
      "main": [
        [
          {
            "node": "\ud83d\udcca Content Database (Media)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udd17 integrations": {
      "main": [
        [
          {
            "node": "\ud83d\udd00 Platform Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udc26 X/Twitter Posts": {
      "main": [
        [
          {
            "node": "\ud83d\udcca Fixed Results Processor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udd00 Platform Router": {
      "main": [
        [
          {
            "node": "\ud83e\uddf9 Instagram Content Cleaner",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\ud83d\udc26 X/Twitter Posts",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\ud83d\udc26 X/Twitter Alt Account",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\ud83e\uddf9 LinkedIn Content Cleaner",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\ud83e\uddf9 Facebook Content Cleaner",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udcbc LinkedIn Publisher": {
      "main": [
        [
          {
            "node": "\ud83d\udcca Fixed Results Processor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udcd8 Facebook Publisher": {
      "main": [
        [
          {
            "node": "\ud83d\udcca Fixed Results Processor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udcf8 Instagram Publisher": {
      "main": [
        [
          {
            "node": "\ud83d\udcca Fixed Results Processor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udc26 X/Twitter Alt Account": {
      "main": [
        [
          {
            "node": "\ud83d\udcca Fixed Results Processor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udd00 Video Platform Router": {
      "main": [
        [
          {
            "node": "\ud83e\uddf9 Instagram Video Cleaner",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\ud83e\uddf9 Facebook Video Cleaner",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\ud83c\udfac YouTube Publisher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udcf9 Video Upload to Postiz": {
      "main": [
        [
          {
            "node": "\ud83d\udcbe Save Video Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83e\uddf9 Facebook Video Cleaner": {
      "main": [
        [
          {
            "node": "\ud83d\udcd8 Facebook Video Publisher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udd17 integrations (Branch 2)": {
      "main": [
        [
          {
            "node": "\ud83d\udd00 Video Platform Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83e\uddf9 Instagram Video Cleaner": {
      "main": [
        [
          {
            "node": "\ud83d\udcf9 Instagram Video Publisher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udcca Content Database (Media)": {
      "main": [
        [
          {
            "node": "\ud83d\udce5 Download Video from Drive",
            "type": "main",
            "index": 0
          },
          {
            "node": "\ud83d\udce5 Download Image from Drive",
            "type": "main",
            "index": 0
          },
          {
            "node": "\ud83d\udce5 Download x image from Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udcca Content Database (Posts)": {
      "main": [
        [
          {
            "node": "\ud83d\udd0d Content Validator & Cleaner1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udcca Content Database (Video)": {
      "main": [
        [
          {
            "node": "\ud83d\udd17 integrations (Branch 2)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83e\uddf9 Facebook Content Cleaner": {
      "main": [
        [
          {
            "node": "\ud83d\udcd8 Facebook Publisher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83e\uddf9 LinkedIn Content Cleaner": {
      "main": [
        [
          {
            "node": "\ud83d\udcbc LinkedIn Publisher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udce5 Download Image from Drive": {
      "main": [
        [
          {
            "node": "\ud83d\uddbc\ufe0f Image Upload to Postiz",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udce5 Download Video from Drive": {
      "main": [
        [
          {
            "node": "\ud83d\udcf9 Video Upload to Postiz",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\uddbc\ufe0f Image Upload to Postiz": {
      "main": [
        [
          {
            "node": "\ud83d\udcbe Save Image Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83e\uddf9 Instagram Content Cleaner": {
      "main": [
        [
          {
            "node": "\ud83d\udcf8 Instagram Publisher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\uddbc\ufe0f Image Upload to Postiz2": {
      "main": [
        [
          {
            "node": "\ud83d\udcbe Save Image Path1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udccb Content Availability Check1": {
      "main": [
        [
          {
            "node": "\ud83d\udd17 integrations",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\u274c Content Error1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udce5 Download x image from Drive": {
      "main": [
        [
          {
            "node": "\ud83d\uddbc\ufe0f Image Upload to Postiz2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udd0d Content Validator & Cleaner1": {
      "main": [
        [
          {
            "node": "\ud83d\udccb Content Availability Check1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}