{
  "id": "-aEKKx1umxKu-rhKWdKTF",
  "name": "AI Content Master - Moderator",
  "tags": [],
  "nodes": [
    {
      "id": "def634c9-5c76-425d-b85f-c39ad2bf4077",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1200,
        -112
      ],
      "parameters": {
        "width": 480,
        "height": 896,
        "content": "## AI Content Master - Moderator\n\n### How it works\n\n1. Triggers when a Telegram message is received.\n2. Evaluates the message with a conditional statement.\n3. Directs the flow based on language or action choice.\n4. Fetches data from Google Sheets once confirmed.\n5. Posts the confirmed content to Facebook and LinkedIn.\n\n### Setup steps\n\n- [ ] Configure Telegram credentials in the Telegram Trigger and other Telegram nodes.\n- [ ] Set up Google Sheets API access for the 'Get row(s) in sheet' node.\n- [ ] Set up Facebook Graph API access.\n- [ ] Configure LinkedIn API access for the 'Create a post' node.\n\n### Customization\n\nAdjust the language-specific nodes to handle any additional languages needed."
      },
      "typeVersion": 1
    },
    {
      "id": "9b0ff5a4-905d-49f1-af95-32057253832f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        96
      ],
      "parameters": {
        "color": 7,
        "width": 240,
        "height": 320,
        "content": "## Telegram input trigger\n\nTriggers the workflow when a message is received in Telegram."
      },
      "typeVersion": 1
    },
    {
      "id": "a2da96af-a4bf-4044-bfa5-ce7aa1b8c77f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        96
      ],
      "parameters": {
        "color": 7,
        "width": 240,
        "height": 320,
        "content": "## Conditional branching\n\nEvaluates the received message and branches flow based on conditions."
      },
      "typeVersion": 1
    },
    {
      "id": "9637972b-6730-48dd-810b-3c37e90aa753",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 608,
        "height": 928,
        "content": "## Language confirmation\n\nRoutes message to confirmation nodes based on language evaluation."
      },
      "typeVersion": 1
    },
    {
      "id": "1f8f338c-0cbf-44f8-ab66-126e28566021",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        448
      ],
      "parameters": {
        "color": 7,
        "width": 240,
        "height": 304,
        "content": "## Send a text response\n\nSends a text response if conditions are not met."
      },
      "typeVersion": 1
    },
    {
      "id": "6d167d9d-5208-4aba-b244-a21bd86ee37f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 240,
        "height": 320,
        "content": "## Data retrieval\n\nFetches data from Google Sheets based on confirmation."
      },
      "typeVersion": 1
    },
    {
      "id": "98bf0e5d-ab61-479d-ada3-1ea744027097",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        816,
        -96
      ],
      "parameters": {
        "color": 7,
        "width": 240,
        "height": 528,
        "content": "## Social media posting\n\nPosts confirmed content to Facebook and LinkedIn."
      },
      "typeVersion": 1
    },
    {
      "id": "d7240399-a59a-4592-b64f-850f1390b8c9",
      "name": "Telegram Message Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -592,
        256
      ],
      "parameters": {
        "updates": [
          "callback_query"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b83308bf-e42e-4bf3-8dfc-93c34b04eabb",
      "name": "Route by Language",
      "type": "n8n-nodes-base.switch",
      "position": [
        -48,
        176
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d2a92b5f-033e-4002-9a21-e18d15cab2c6",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json.callback_query.data }}",
                    "rightValue": "approve_eng"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "6d432c4b-a1c1-40c9-95e2-a5b1fa7a79de",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json.callback_query.data }}",
                    "rightValue": "approve_pol"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "7acb4d21-5b54-48cb-84f7-2289a8966aba",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json.callback_query.data }}",
                    "rightValue": "approve_esp"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "9a24641b-0928-452b-9759-65408fff4fef",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json.callback_query.data }}",
                    "rightValue": "decline_eng"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "685fe0c1-9eb7-41ad-97e7-009ec373b09a",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json.callback_query.data }}",
                    "rightValue": "decline_pol"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "b50bdd24-25cd-469d-852a-c7ecbe3bc4b2",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json.callback_query.data }}",
                    "rightValue": "decline_esp"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.4
    },
    {
      "id": "708a32ef-2fea-46a2-8b4c-3f3cd5001b15",
      "name": "Post to Facebook Graph API",
      "type": "n8n-nodes-base.facebookGraphApi",
      "disabled": true,
      "position": [
        864,
        32
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "99e11fb0-1017-4aac-9967-6542cb9e4c31",
      "name": "Post to LinkedIn",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        864,
        256
      ],
      "parameters": {
        "text": "={{ $('Read Data from Sheets').first().json['text_' + $('Telegram Message Trigger').first().json.callback_query.data.replace('approve_eng','en').replace('approve_pol','pl').replace('approve_esp','es')] }}",
        "person": "83GPPaTeqr",
        "additionalFields": {
          "visibility": "PUBLIC"
        }
      },
      "credentials": {
        "linkedInOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "02050fc0-4c7d-47b3-943a-ee8228976df0",
      "name": "Send English Confirmation",
      "type": "n8n-nodes-base.telegram",
      "position": [
        112,
        0
      ],
      "parameters": {
        "text": "Great choice, Zhenya! Your post is scheduled to be published on Facebook and LinkedIn. You\u2019re the true conductor of this AI symphony!",
        "chatId": "={{ $json.callback_query.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c2d1a957-06b0-4441-86bd-59fc216c080f",
      "name": "Send Polish Confirmation",
      "type": "n8n-nodes-base.telegram",
      "position": [
        240,
        160
      ],
      "parameters": {
        "text": "\u015awietny wyb\u00f3r! Tw\u00f3j post jest w kolejce do publikacji na Facebook i LinkedIn. Jeste\u015b prawdziwym dyrygentem tej symfonii AI!",
        "chatId": "={{ $json.callback_query.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "caba3f33-c001-4c5f-8c9d-6b8dacfe26b5",
      "name": "Send Spanish Confirmation",
      "type": "n8n-nodes-base.telegram",
      "position": [
        304,
        304
      ],
      "parameters": {
        "text": "\u00a1Brillante elecci\u00f3n! Tu post est\u00e1 en cola para publicaci\u00f3n en Facebook y LinkedIn. \u00a1Eres el verdadero director de esta sinfon\u00eda de IA!",
        "chatId": "={{ $json.callback_query.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a3a3f349-8da3-4452-a114-e9f481ccd39f",
      "name": "Send English Decline",
      "type": "n8n-nodes-base.telegram",
      "position": [
        368,
        480
      ],
      "parameters": {
        "text": "Got it! Draft deleted. Archaeological precision above all \u2014 keep searching!",
        "chatId": "={{ $('Telegram Message Trigger').item.json.callback_query.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cd090ae8-3d16-40d6-9e3e-df2f43411eed",
      "name": "Send Polish Decline",
      "type": "n8n-nodes-base.telegram",
      "position": [
        224,
        592
      ],
      "parameters": {
        "text": "Rozumiem! Szkic usuni\u0119ty. Precyzja archeologiczna przede wszystkim \u2014 szukamy dalej!",
        "chatId": "={{ $json.callback_query.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3fe3f3eb-7a34-4899-a0ba-8fb1ccb9f287",
      "name": "Send Spanish Decline",
      "type": "n8n-nodes-base.telegram",
      "position": [
        0,
        656
      ],
      "parameters": {
        "text": "\u00a1Entendido! Borrador eliminado. \u00a1La precisi\u00f3n arqueol\u00f3gica ante todo \u2014 seguimos buscando!",
        "chatId": "={{ $json.callback_query.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8b3c7ba7-338b-4a8c-adce-4c5437db8d68",
      "name": "Check Callback Query",
      "type": "n8n-nodes-base.if",
      "position": [
        -320,
        256
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "4471dc16-b82e-42d8-b153-de44dc6c5395",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.callback_query.from.id.toString() }}",
              "rightValue": "+1234567890"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "abc91151-744e-4a94-b789-cbb2797b3b29",
      "name": "Send Telegram Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -320,
        576
      ],
      "parameters": {
        "text": " Sorry, this bot only works for its owner.",
        "chatId": "={{ $json.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0056e30b-a8ae-4ff0-8946-b7f27f787988",
      "name": "Read Data from Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        592,
        80
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": true
        },
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $('Telegram Message Trigger').first().json.callback_query.from.id }}",
              "lookupColumn": "chat_id"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1y3oEjUD6p5Xy8gr5r58RgDIkUj3P5xeH97tkKuIS1qY/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "1y3oEjUD6p5Xy8gr5r58RgDIkUj3P5xeH97tkKuIS1qY"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    }
  ],
  "active": true,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "23011f32-e995-40d1-bf92-7e58958ec9b6",
  "connections": {
    "Route by Language": {
      "main": [
        [
          {
            "node": "Send English Confirmation",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Polish Confirmation",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Spanish Confirmation",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send English Decline",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Polish Decline",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Spanish Decline",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Callback Query": {
      "main": [
        [
          {
            "node": "Route by Language",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Telegram Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Data from Sheets": {
      "main": [
        [
          {
            "node": "Post to LinkedIn",
            "type": "main",
            "index": 0
          },
          {
            "node": "Post to Facebook Graph API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Polish Confirmation": {
      "main": [
        [
          {
            "node": "Read Data from Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Message Trigger": {
      "main": [
        [
          {
            "node": "Check Callback Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send English Confirmation": {
      "main": [
        [
          {
            "node": "Read Data from Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Spanish Confirmation": {
      "main": [
        [
          {
            "node": "Read Data from Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}