Task: Plex to discord and google sheet

n8n workflow:
{"nodes":[{"name":"On clicking 'execute'","type":"n8n-nodes-base.manualTrigger","position":[40,1040],"parameters":{},"typeVersion":1},{"name":"Webhook","type":"n8n-nodes-base.webhook","position":[40,820],"webhookId":"a00f54d8-6c1a-4bac-bd6d-8b1dd0c7459f","parameters":{"path":"plex","options":{},"httpMethod":"POST"},"typeVersion":1},{"name":"Play","type":"n8n-nodes-base.noOp","position":[1560,160],"parameters":{},"typeVersion":1},{"name":"Reprise","type":"n8n-nodes-base.noOp","position":[1560,320],"parameters":{},"typeVersion":1},{"name":"Stop","type":"n8n-nodes-base.noOp","position":[1560,480],"parameters":{},"typeVersion":1},{"name":"Pause","type":"n8n-nodes-base.noOp","position":[1560,640],"parameters":{},"typeVersion":1},{"name":"Décode Payload","type":"n8n-nodes-base.functionItem","position":[240,820],"parameters":{"functionCode":"return JSON.parse(item.body.payload);"},"typeVersion":1},{"name":"Films","type":"n8n-nodes-base.noOp","position":[900,380],"parameters":{},"typeVersion":1},{"name":"Switch - Events - Films","type":"n8n-nodes-base.switch","position":[1300,380],"parameters":{"rules":{"rules":[{"value2":"media.play"},{"output":1,"value2":"media.resume"},{"output":2,"value2":"media.stop"},{"output":3,"value2":"media.pause"}]},"value1":"={{$node[\"Décode Payload\"].json[\"event\"]}}","dataType":"string"},"typeVersion":1},{"name":"Discord - Plex - Films - Play","type":"n8n-nodes-base.discord","position":[1820,160],"parameters":{"text":"={{$node[\"Décode Payload\"].json[\"Account\"][\"title\"]}} regarde le film {{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}} sur le serveur {{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}} à partir de la bibliothèque {{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}} avec le périphérique {{$node[\"Décode Payload\"].json[\"Player\"][\"title\"]}}","webhookUri":"<Discord APIt>"},"typeVersion":1},{"name":"Discord - Plex - Films - Reprise","type":"n8n-nodes-base.discord","position":[1820,320],"parameters":{"text":"={{$node[\"Décode Payload\"].json[\"Account\"][\"title\"]}} reprend la lecture du film {{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}} sur le serveur {{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}} à partir de la bibliothèque {{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}} avec le périphérique {{$node[\"Décode Payload\"].json[\"Player\"][\"title\"]}}","webhookUri":"<Discord APIt>"},"typeVersion":1},{"name":"Discord - Plex - Films - Stop","type":"n8n-nodes-base.discord","position":[1820,480],"parameters":{"text":"={{$node[\"Décode Payload\"].json[\"Account\"][\"title\"]}} stop la lecture du film {{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}} sur le serveur {{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}} à partir de la bibliothèque {{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}} avec le périphérique {{$node[\"Décode Payload\"].json[\"Player\"][\"title\"]}}","webhookUri":"<Discord APIt>"},"typeVersion":1},{"name":"Discord - Plex - Films - Pause","type":"n8n-nodes-base.discord","position":[1820,640],"parameters":{"text":"={{$node[\"Décode Payload\"].json[\"Account\"][\"title\"]}} met en pause le film {{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}} sur le serveur {{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}} à partir de la bibliothèque {{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}} avec le périphérique {{$node[\"Décode Payload\"].json[\"Player\"][\"title\"]}}","webhookUri":"<Discord APIt>"},"typeVersion":1},{"name":"Séries","type":"n8n-nodes-base.noOp","position":[880,1020],"parameters":{},"typeVersion":1},{"name":"Play1","type":"n8n-nodes-base.noOp","position":[1560,980],"parameters":{},"typeVersion":1},{"name":"Reprise1","type":"n8n-nodes-base.noOp","position":[1560,1140],"parameters":{},"typeVersion":1},{"name":"Stop1","type":"n8n-nodes-base.noOp","position":[1560,1300],"parameters":{},"typeVersion":1},{"name":"Pause1","type":"n8n-nodes-base.noOp","position":[1560,1460],"parameters":{},"typeVersion":1},{"name":"Switch - Events - Séries","type":"n8n-nodes-base.switch","position":[1300,1200],"parameters":{"rules":{"rules":[{"value2":"media.play"},{"output":1,"value2":"media.resume"},{"output":2,"value2":"media.stop"},{"output":3,"value2":"media.pause"}]},"value1":"={{$node[\"Décode Payload\"].json[\"event\"]}}","dataType":"string"},"typeVersion":1},{"name":"Discord - Plex - Séries - Play","type":"n8n-nodes-base.discord","position":[1820,980],"parameters":{"text":"={{$node[\"Décode Payload\"].json[\"Account\"][\"title\"]}} regarde la série {{$node[\"Décode Payload\"].json[\"Metadata\"][\"grandparentTitle\"]}} épisode {{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}} de la saison {{$node[\"Décode Payload\"].json[\"Metadata\"][\"parentTitle\"]}} sur le serveur {{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}} à partir de la bibliothèque {{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}} avec le périphérique {{$node[\"Décode Payload\"].json[\"Player\"][\"title\"]}}","webhookUri":"<Discord APIt>"},"typeVersion":1},{"name":"Discord - Plex - Séries - Reprise","type":"n8n-nodes-base.discord","position":[1820,1140],"parameters":{"text":"={{$node[\"Décode Payload\"].json[\"Account\"][\"title\"]}} reprend la lecture de la série {{$node[\"Décode Payload\"].json[\"Metadata\"][\"grandparentTitle\"]}} épisode {{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}} de la saison {{$node[\"Décode Payload\"].json[\"Metadata\"][\"parentTitle\"]}} sur le serveur {{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}} à partir de la bibliothèque {{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}} avec le périphérique {{$node[\"Décode Payload\"].json[\"Player\"][\"title\"]}}","webhookUri":"<Discord APIt>"},"typeVersion":1},{"name":"Discord - Plex - Séries - Stop","type":"n8n-nodes-base.discord","position":[1820,1300],"parameters":{"text":"={{$node[\"Décode Payload\"].json[\"Account\"][\"title\"]}} stop la lecture de la série {{$node[\"Décode Payload\"].json[\"Metadata\"][\"grandparentTitle\"]}} épisode {{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}} de la saison {{$node[\"Décode Payload\"].json[\"Metadata\"][\"parentTitle\"]}} sur le serveur {{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}} à partir de la bibliothèque {{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}} avec le périphérique {{$node[\"Décode Payload\"].json[\"Player\"][\"title\"]}}","webhookUri":"<Discord APIt>"},"typeVersion":1},{"name":"Discord - Plex - Séries - Pause","type":"n8n-nodes-base.discord","position":[1820,1460],"parameters":{"text":"={{$node[\"Décode Payload\"].json[\"Account\"][\"title\"]}} met en pause la série {{$node[\"Décode Payload\"].json[\"Metadata\"][\"grandparentTitle\"]}} épisode {{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}} de la saison {{$node[\"Décode Payload\"].json[\"Metadata\"][\"parentTitle\"]}} sur le serveur {{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}} à partir de la bibliothèque {{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}} avec le périphérique {{$node[\"Décode Payload\"].json[\"Player\"][\"title\"]}}","webhookUri":"<Discord APIt>"},"typeVersion":1},{"name":"Musiques","type":"n8n-nodes-base.noOp","position":[880,1840],"parameters":{},"typeVersion":1},{"name":"Play2","type":"n8n-nodes-base.noOp","position":[1560,1760],"parameters":{},"typeVersion":1},{"name":"Reprise2","type":"n8n-nodes-base.noOp","position":[1560,1920],"parameters":{},"typeVersion":1},{"name":"Stop2","type":"n8n-nodes-base.noOp","position":[1560,2080],"parameters":{},"typeVersion":1},{"name":"Pause2","type":"n8n-nodes-base.noOp","position":[1560,2240],"parameters":{},"typeVersion":1},{"name":"Switch - Events - Musiques","type":"n8n-nodes-base.switch","position":[1300,1980],"parameters":{"rules":{"rules":[{"value2":"media.play"},{"output":1,"value2":"media.resume"},{"output":2,"value2":"media.stop"},{"output":3,"value2":"media.pause"}]},"value1":"={{$node[\"Décode Payload\"].json[\"event\"]}}","dataType":"string"},"typeVersion":1},{"name":"Discord - Plex - Musiques - Play","type":"n8n-nodes-base.discord","position":[1820,1760],"parameters":{"text":"={{$node[\"Décode Payload\"].json[\"Account\"][\"title\"]}} écoute {{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}} par {{$node[\"Décode Payload\"].json[\"Metadata\"][\"grandparentTitle\"]}} de l'album {{$node[\"Décode Payload\"].json[\"Metadata\"][\"parentTitle\"]}} sur le serveur {{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}} à partir de la bibliothèque {{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}} avec le périphérique {{$node[\"Décode Payload\"].json[\"Player\"][\"title\"]}}","webhookUri":"<Discord APIt>"},"typeVersion":1},{"name":"Discord - Plex - Musiques - Reprise","type":"n8n-nodes-base.discord","position":[1820,1920],"parameters":{"text":"={{$node[\"Décode Payload\"].json[\"Account\"][\"title\"]}} reprend l'écoute de {{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}} par {{$node[\"Décode Payload\"].json[\"Metadata\"][\"grandparentTitle\"]}} de l'album {{$node[\"Décode Payload\"].json[\"Metadata\"][\"parentTitle\"]}} sur le serveur {{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}} à partir de la bibliothèque {{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}} avec le périphérique {{$node[\"Décode Payload\"].json[\"Player\"][\"title\"]}}","webhookUri":"<Discord APIt>"},"typeVersion":1},{"name":"Discord - Plex - Musiques - Stop","type":"n8n-nodes-base.discord","position":[1820,2080],"parameters":{"text":"={{$node[\"Décode Payload\"].json[\"Account\"][\"title\"]}} stop l'écoute de {{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}} par {{$node[\"Décode Payload\"].json[\"Metadata\"][\"grandparentTitle\"]}} de l'album {{$node[\"Décode Payload\"].json[\"Metadata\"][\"parentTitle\"]}} sur le serveur {{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}} à partir de la bibliothèque {{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}} avec le périphérique {{$node[\"Décode Payload\"].json[\"Player\"][\"title\"]}}","webhookUri":"<Discord APIt>"},"typeVersion":1},{"name":"Discord - Plex - Musiques - Pause","type":"n8n-nodes-base.discord","position":[1820,2240],"parameters":{"text":"={{$node[\"Décode Payload\"].json[\"Account\"][\"title\"]}} met en pause l'écoute de {{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}} par {{$node[\"Décode Payload\"].json[\"Metadata\"][\"grandparentTitle\"]}} de l'album {{$node[\"Décode Payload\"].json[\"Metadata\"][\"parentTitle\"]}} sur le serveur {{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}} à partir de la bibliothèque {{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}} avec le périphérique {{$node[\"Décode Payload\"].json[\"Player\"][\"title\"]}}","webhookUri":"<Discord APIt>"},"typeVersion":1},{"name":"Switch - Type Médias","type":"n8n-nodes-base.switch","position":[620,820],"parameters":{"rules":{"rules":[{"value2":"movie"},{"output":1,"value2":"show"},{"output":2,"value2":"artist"}]},"value1":"={{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionType\"]}}","dataType":"string"},"typeVersion":1},{"name":"IF - Nouveaux Films","type":"n8n-nodes-base.if","position":[1080,380],"parameters":{"conditions":{"string":[{"value1":"={{$node[\"Décode Payload\"].json[\"event\"]}}","value2":"library.new"}]}},"typeVersion":1},{"name":"IF - Nouvelles séries","type":"n8n-nodes-base.if","position":[1100,1020],"parameters":{"conditions":{"string":[{"value1":"={{$node[\"Décode Payload\"].json[\"event\"]}}","value2":"library.new"}]}},"typeVersion":1},{"name":"Ajout1","type":"n8n-nodes-base.noOp","position":[1560,840],"parameters":{},"typeVersion":1},{"name":"IF Ajout Musiques","type":"n8n-nodes-base.if","position":[1100,1840],"parameters":{"conditions":{"string":[{"value1":"={{$node[\"Décode Payload\"].json[\"event\"]}}","value2":"library.new"}]}},"typeVersion":1},{"name":"Ajout2","type":"n8n-nodes-base.noOp","position":[1560,1620],"parameters":{},"typeVersion":1},{"name":"Google Sheets - Plex Ajout Films1","type":"n8n-nodes-base.googleSheets","position":[2420,840],"parameters":{"range":"Séries TV!A:E","options":{"valueInputMode":"USER_ENTERED"},"sheetId":"<Id Google Sheet>","operation":"append"},"credentials":{"googleApi":{"id":"3","name":"Google Account N8N "}},"typeVersion":1},{"name":"Ajouts Séries","type":"n8n-nodes-base.set","position":[2060,840],"parameters":{"values":{"string":[{"name":"Serveurs","value":"={{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}}"},{"name":"Bibliothèques","value":"={{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}}"},{"name":"Séries","value":"={{$node[\"Décode Payload\"].json[\"Metadata\"][\"grandparentTitle\"]}}"},{"name":"Saisons","value":"={{$node[\"Décode Payload\"].json[\"Metadata\"][\"parentTitle\"]}}"},{"name":"Episodes","value":"={{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}}"}]},"options":{}},"typeVersion":1},{"name":"Google Sheets - Plex Ajout Films2","type":"n8n-nodes-base.googleSheets","position":[2400,1620],"parameters":{"range":"Musiques!A:D","options":{"valueInputMode":"USER_ENTERED"},"sheetId":"<Id Google Sheet>","operation":"append"},"credentials":{"googleApi":{"id":"3","name":"Google Account N8N "}},"typeVersion":1},{"name":"Ajouts Musiques","type":"n8n-nodes-base.set","position":[2060,1620],"parameters":{"values":{"string":[{"name":"Serveurs","value":"={{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}}"},{"name":"Bibliothèques","value":"={{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}}"},{"name":"Artistes","value":"=2CELLOS"},{"name":"Albums","value":"={{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}}"}]},"options":{}},"typeVersion":1},{"name":"Google Sheets - Plex Traitements1","type":"n8n-nodes-base.googleSheets","position":[600,1300],"parameters":{"range":"Traitement!A:E","options":{"valueInputMode":"USER_ENTERED"},"sheetId":"<Id Google Sheet>","operation":"append"},"credentials":{"googleApi":{"id":"3","name":"Google Account N8N "}},"typeVersion":1},{"name":"Set Ligne Traitement","type":"n8n-nodes-base.set","position":[400,1300],"parameters":{"values":{"string":[{"name":"SERVEUR","value":"={{$json[\"Server\"][\"title\"]}}"},{"name":"EVENT","value":"={{$json[\"event\"]}}"},{"name":"ACCOUNT","value":"={{$json[\"Account\"][\"title\"]}}"},{"name":"BIBLIOTHEQUE","value":"={{$json[\"Metadata\"][\"librarySectionTitle\"]}}"},{"name":"TITLE","value":"={{$json[\"Metadata\"][\"title\"]}}"}]},"options":{}},"typeVersion":1},{"name":"Ajout","type":"n8n-nodes-base.noOp","position":[1560,20],"parameters":{},"typeVersion":1},{"name":"Ajouts Films","type":"n8n-nodes-base.set","position":[2060,20],"parameters":{"values":{"string":[{"name":"Serveurs","value":"={{$node[\"Décode Payload\"].json[\"Server\"][\"title\"]}}"},{"name":"Bibliothèques","value":"={{$node[\"Décode Payload\"].json[\"Metadata\"][\"librarySectionTitle\"]}}"},{"name":"Films","value":"={{$node[\"Décode Payload\"].json[\"Metadata\"][\"title\"]}}"}]},"options":{}},"typeVersion":1},{"name":"Google Sheets - Plex Ajout Films","type":"n8n-nodes-base.googleSheets","position":[2400,20],"parameters":{"range":"Films!A:C","options":{"valueInputMode":"USER_ENTERED"},"sheetId":"<Id Google Sheet>","operation":"append"},"credentials":{"googleApi":{"id":"3","name":"Google Account N8N "}},"typeVersion":1}],"connections":{"Play":{"main":[[{"node":"Discord - Plex - Films - Play","type":"main","index":0}]]},"Stop":{"main":[[{"node":"Discord - Plex - Films - Stop","type":"main","index":0}]]},"Ajout":{"main":[[{"node":"Ajouts Films","type":"main","index":0}]]},"Films":{"main":[[{"node":"IF - Nouveaux Films","type":"main","index":0}]]},"Pause":{"main":[[{"node":"Discord - Plex - Films - Pause","type":"main","index":0}]]},"Play1":{"main":[[{"node":"Discord - Plex - Séries - Play","type":"main","index":0}]]},"Play2":{"main":[[{"node":"Discord - Plex - Musiques - Play","type":"main","index":0}]]},"Stop1":{"main":[[{"node":"Discord - Plex - Séries - Stop","type":"main","index":0}]]},"Stop2":{"main":[[{"node":"Discord - Plex - Musiques - Stop","type":"main","index":0}]]},"Ajout1":{"main":[[{"node":"Ajouts Séries","type":"main","index":0}]]},"Ajout2":{"main":[[{"node":"Ajouts Musiques","type":"main","index":0}]]},"Pause1":{"main":[[{"node":"Discord - Plex - Séries - Pause","type":"main","index":0}]]},"Pause2":{"main":[[{"node":"Discord - Plex - Musiques - Pause","type":"main","index":0}]]},"Reprise":{"main":[[{"node":"Discord - Plex - Films - Reprise","type":"main","index":0}]]},"Séries":{"main":[[{"node":"IF - Nouvelles séries","type":"main","index":0}]]},"Webhook":{"main":[[{"node":"Décode Payload","type":"main","index":0}]]},"Musiques":{"main":[[{"node":"IF Ajout Musiques","type":"main","index":0}]]},"Reprise1":{"main":[[{"node":"Discord - Plex - Séries - Reprise","type":"main","index":0}]]},"Reprise2":{"main":[[{"node":"Discord - Plex - Musiques - Reprise","type":"main","index":0}]]},"Ajouts Films":{"main":[[{"node":"Google Sheets - Plex Ajout Films","type":"main","index":0}]]},"Ajouts Séries":{"main":[[{"node":"Google Sheets - Plex Ajout Films1","type":"main","index":0}]]},"Ajouts Musiques":{"main":[[{"node":"Google Sheets - Plex Ajout Films2","type":"main","index":0}]]},"Décode Payload":{"main":[[{"node":"Switch - Type Médias","type":"main","index":0},{"node":"Set Ligne Traitement","type":"main","index":0}]]},"IF Ajout Musiques":{"main":[[{"node":"Ajout2","type":"main","index":0}],[{"node":"Switch - Events - Musiques","type":"main","index":0}]]},"IF - Nouveaux Films":{"main":[[{"node":"Ajout","type":"main","index":0}],[{"node":"Switch - Events - Films","type":"main","index":0}]]},"Set Ligne Traitement":{"main":[[{"node":"Google Sheets - Plex Traitements1","type":"main","index":0}]]},"On clicking 'execute'":{"main":[[{"node":"Décode Payload","type":"main","index":0}]]},"Switch - Type Médias":{"main":[[{"node":"Films","type":"main","index":0}],[{"node":"Séries","type":"main","index":0}],[{"node":"Musiques","type":"main","index":0}]]},"IF - Nouvelles séries":{"main":[[{"node":"Ajout1","type":"main","index":0}],[{"node":"Switch - Events - Séries","type":"main","index":0}]]},"Switch - Events - Films":{"main":[[{"node":"Play","type":"main","index":0}],[{"node":"Reprise","type":"main","index":0}],[{"node":"Stop","type":"main","index":0}],[{"node":"Pause","type":"main","index":0}]]},"Switch - Events - Séries":{"main":[[{"node":"Play1","type":"main","index":0}],[{"node":"Reprise1","type":"main","index":0}],[{"node":"Stop1","type":"main","index":0}],[{"node":"Pause1","type":"main","index":0}]]},"Switch - Events - Musiques":{"main":[[{"node":"Play2","type":"main","index":0}],[{"node":"Reprise2","type":"main","index":0}],[{"node":"Stop2","type":"main","index":0}],[{"node":"Pause2","type":"main","index":0}]]}}}