{ "name": "SendPBSChat_New", "nodes": [ { "parameters": { "inputSource": "passthrough" }, "type": "n8n-nodes-base.executeWorkflowTrigger", "typeVersion": 1.1, "position": [ -656, 192 ], "id": "97180c9d-35e0-4b13-a9c6-f6af36002192", "name": "Enter_Msg_Post" }, { "parameters": { "rules": { "values": [ { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 3 }, "conditions": [ { "leftValue": "={{ $('Enter_Msg_Post').item.json.space }}", "rightValue": "insta", "operator": { "type": "string", "operation": "equals" }, "id": "c86cc6d5-7623-4936-99fd-7fe40ef88e48" } ], "combinator": "and" }, "renameOutput": true, "outputKey": "insta-msg" }, { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 3 }, "conditions": [ { "id": "345bde6a-521e-4b79-94b6-d9bcf9a45a05", "leftValue": "={{ $('Enter_Msg_Post').item.json.space }}", "rightValue": "automation", "operator": { "type": "string", "operation": "equals", "name": "filter.operator.equals" } } ], "combinator": "and" }, "renameOutput": true, "outputKey": "Auto-msg" } ] }, "options": {} }, "type": "n8n-nodes-base.switch", "typeVersion": 3.4, "position": [ -272, 192 ], "id": "86ab99df-e8ec-46f3-8be8-0a2a898395a0", "name": "Switch" }, { "parameters": { "method": "POST", "url": "https://chat.googleapis.com/v1/spaces/AAQAdoDxA4c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=bZPNAI8knELwfTEAoYHLZJdnZntrEUXn16lIODjwuEc", "sendBody": true, "bodyParameters": { "parameters": [ { "name": "cardsV2", "value": "={{ $json.cardsV2 }}" } ] }, "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ 48, 48 ], "id": "40a1e284-f9d5-47f1-9a7d-309b18ece9aa", "name": "Insta to PBS Chat" }, { "parameters": { "method": "POST", "url": "https://chat.googleapis.com/v1/spaces/AAQAS9WI6CY/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=7V71Cn484L9ijJjmVTS14raIiSQd3j8TgAu1XTEdV9Q", "sendBody": true, "bodyParameters": { "parameters": [ { "name": "cardsV2", "value": "={{ $json.cardsV2 }}" } ] }, "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ 64, 256 ], "id": "a537eef5-98cb-4fa3-b114-e23ba65dd2cf", "name": "Auto to PBS Chat" }, { "parameters": { "jsCode": "const input = $('Enter_Msg_Post').first().json;\n\nconst widgets = [\n { textParagraph: { text: input.message } }\n];\n\nif (input.link_url) {\n widgets.push({\n buttonList: {\n buttons: [{\n text: \"Open in pbs-hub\",\n onClick: { openLink: { url: input.link_url } }\n }]\n }\n });\n}\n\nreturn [{\n json: {\n cardsV2: [{\n card: {\n header: { title: `🌻 PBS Alert: ${input.title}` },\n sections: [{ widgets }]\n }\n }]\n }\n}];" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ -448, 192 ], "id": "90a03870-1a0d-4af2-a961-905587545176", "name": "Code in JavaScript" } ], "pinData": { "Enter_Msg_Post": [ { "json": { "title": "Send Message Problem ⚠️", "message": "This message did not trigger an auto recipe reply!\n\nReel ID: 18008185346730575\nCommenter: @tinyplanteaters\nComment: Yum 😋", "space": "automation", "timestamp": "May 31, 19:35:03" }, "pairedItem": { "item": 0 } } ] }, "connections": { "Enter_Msg_Post": { "main": [ [ { "node": "Code in JavaScript", "type": "main", "index": 0 } ] ] }, "Switch": { "main": [ [ { "node": "Insta to PBS Chat", "type": "main", "index": 0 } ], [ { "node": "Auto to PBS Chat", "type": "main", "index": 0 } ] ] }, "Code in JavaScript": { "main": [ [ { "node": "Switch", "type": "main", "index": 0 } ] ] } }, "active": true, "settings": { "executionOrder": "v1", "availableInMCP": false }, "versionId": "575e25bc-2af9-4930-98f1-88d7e33d9950", "meta": { "instanceId": "eeb18e777509f7207ee9abd45845e7fbf014989719160f3ed6ae633d872bf6c4" }, "id": "P465jEMJyKNZGOHVppbv2", "tags": [] }