{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "c78daa96-bc96-4814-babb-d0fadbd7ed55",
      "name": "About this workflow",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        16
      ],
      "parameters": {
        "width": 800,
        "height": 672,
        "content": "## What this workflow does\n\nDesigned for agencies and social media managers, this flow creates a **secure Connect Accounts page** so your client can link their social profiles **without sharing passwords**, and includes a simple **publisher form** to post to multiple platforms via Upload-Post.\n\n### How it works\n1) **Create user** in **Upload-Post** (or reuse if it already exists).  \n2) **Generate a one-hour Connect link (JWT)** branded with your logo.  \n3) **Send the link via Telegram** to your client.  \n4) **Post Publisher form:** once the client connects their accounts, submit a title/description + media and (optionally) a Facebook Page ID.  \n5) **Publish to multiple platforms** (Facebook, Instagram, TikTok, YouTube) using Upload-Post.\n\n### After the client connects, you can publish from\n- **Upload-Post Dashboard:** https://app.upload-post.com/dashboard  \n- **Upload-Post API**  \n- **Your own n8n flows** (using the created `profileName`)\n\n### Requirements\n- **Upload-Post** credentials  \n- **Telegram Bot** (or swap this node for Email/Gmail if you prefer)\n\n### Tips\n- Brand the Connect page with `brandName` and `logoImage`.  \n- You can optionally restrict which networks appear with `allowedPlatforms`.  \n- The Connect link **expires in 1 hour** (TTL), regenerate as needed."
      },
      "typeVersion": 1
    },
    {
      "id": "3e3a5f9a-3835-4fe2-bf9e-45f815263fce",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        1008,
        144
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "beb26dd7-72b7-40b8-920b-49ce8b40c276",
      "name": "Create user",
      "type": "n8n-nodes-upload-post.uploadPost",
      "position": [
        1200,
        144
      ],
      "parameters": {
        "newUser": "add_user_name",
        "resource": "users",
        "operation": "createUser"
      },
      "credentials": {
        "uploadPostApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8bdb249d-623a-4aa4-a353-7314169ab439",
      "name": "Generate jwt for platform integration",
      "type": "n8n-nodes-upload-post.uploadPost",
      "position": [
        1408,
        144
      ],
      "parameters": {
        "user": "add_user_name",
        "resource": "users",
        "logoImage": "https://tattooservices.es/wp-content/uploads/2020/07/logo-community-manager.png",
        "operation": "generateJwt"
      },
      "credentials": {
        "uploadPostApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "930b70a3-3423-40f0-b8c5-8415201499f3",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1616,
        144
      ],
      "parameters": {
        "text": "=Url for connect accounts generated: {{ $json.access_url }}",
        "chatId": "123456789",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "59937fb8-1f2e-41a2-b8b4-a2ce267c6898",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        1200,
        432
      ],
      "parameters": {
        "options": {},
        "formTitle": "Post Publisher",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Upload-Post Account",
              "placeholder": "User Profile name set on Upload-post.com",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Description",
              "requiredField": true
            },
            {
              "fieldType": "file",
              "fieldLabel": "Upload",
              "multipleFiles": false,
              "requiredField": true,
              "acceptFileTypes": ".jpg,.mp4"
            },
            {
              "fieldLabel": "Facebook Id",
              "placeholder": "Facebook page Id (eg. +1234567890)"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d90d1844-d5c9-4e50-aebc-53e75ecd0c83",
      "name": "Upload a video",
      "type": "n8n-nodes-upload-post.uploadPost",
      "position": [
        1408,
        432
      ],
      "parameters": {
        "user": "=add_user_name",
        "title": "={{ $json.Description }}",
        "video": "Upload",
        "platform": [
          "facebook",
          "instagram",
          "tiktok",
          "youtube"
        ],
        "operation": "uploadVideo",
        "facebookPageId": "={{ $json[\"Facebook Id\"] }}"
      },
      "credentials": {
        "uploadPostApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Create user": {
      "main": [
        [
          {
            "node": "Generate jwt for platform integration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Upload a video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Create user",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate jwt for platform integration": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}