{ "name": "Gmail Label Switcher", "nodes": [ { "name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [ 250, 300 ], "parameters": {}, "typeVersion": 1, "id": "gmail-label-switcher-0" }, { "name": "Gmail", "type": "n8n-nodes-base.gmail", "position": [ 450, 300 ], "parameters": { "authentication": "oAuth2", "resource": "message", "operation": "getAll", "returnAll": false, "limit": 10, "additionalFields": { "format": "full", "labelIds": [ "YOUR_SOURCE_LABEL_ID" ] } }, "typeVersion": 1, "id": "gmail-label-switcher-1" }, { "name": "Gmail1", "type": "n8n-nodes-base.gmail", "position": [ 650, 300 ], "parameters": { "authentication": "oAuth2", "resource": "messageLabel", "operation": "remove", "messageId": "={{ $json.id }}", "labelIds": "={{ $node[\"Gmail\"].parameter.additionalFields.labelIds }}" }, "typeVersion": 1, "id": "gmail-label-switcher-2" }, { "name": "Gmail2", "type": "n8n-nodes-base.gmail", "position": [ 850, 300 ], "parameters": { "authentication": "oAuth2", "resource": "messageLabel", "operation": "add", "messageId": "={{ $json.id }}", "labelIds": [ "YOUR_DESTINATION_LABEL_ID" ] }, "typeVersion": 1, "id": "gmail-label-switcher-3" } ], "active": false, "settings": { "executionOrder": "v1", "timezone": "UTC" }, "connections": { "Gmail": { "main": [ [ { "node": "Gmail1", "type": "main", "index": 0 } ] ] }, "Gmail1": { "main": [ [ { "node": "Gmail2", "type": "main", "index": 0 } ] ] }, "On clicking 'execute'": { "main": [ [ { "node": "Gmail", "type": "main", "index": 0 } ] ] } }, "pinData": {} }