{ "id": "175", "name": "Get messages with a certain label, remove the label, and add a new one", "nodes": [ { "name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [ 250, 300 ], "parameters": {}, "typeVersion": 1, "id": "e55664fa-a13f-4ae4-8b99-7a13080cda6f", "notes": "This manualTrigger node performs automated tasks as part of the workflow." }, { "name": "Gmail", "type": "n8n-nodes-base.gmail", "position": [ 450, 300 ], "parameters": { "resource": "message", "operation": "getAll", "additionalFields": { "format": "full", "labelIds": [ "Label_103811885290186237" ] } }, "credentials": { "gmailOAuth2": "Gmail" }, "typeVersion": 1, "id": "34882df0-82e9-420e-8c49-576f975b6b55", "notes": "This gmail node performs automated tasks as part of the workflow." }, { "name": "Gmail1", "type": "n8n-nodes-base.gmail", "position": [ 650, 300 ], "parameters": { "labelIds": [ "Label_103811885290186237" ], "resource": "messageLabel", "messageId": "={{$node[\"Gmail\"].json[\"id\"]}}", "operation": "remove" }, "credentials": { "gmailOAuth2": "Gmail" }, "typeVersion": 1, "id": "3f045cd9-0cb9-4700-a551-4d2d58ecd79e", "notes": "This gmail node performs automated tasks as part of the workflow." }, { "name": "Gmail2", "type": "n8n-nodes-base.gmail", "position": [ 850, 300 ], "parameters": { "labelIds": [ "Label_140673791182006844" ], "resource": "messageLabel", "messageId": "={{$node[\"Gmail\"].json[\"id\"]}}" }, "credentials": { "gmailOAuth2": "Gmail" }, "typeVersion": 1, "id": "592bf73a-17e4-4bfc-929b-0cf3b6d307fa", "notes": "This gmail node performs automated tasks as part of the workflow." }, { "id": "error-afb9eee4", "name": "Error Handler", "type": "n8n-nodes-base.stopAndError", "typeVersion": 1, "position": [ 1000, 400 ], "parameters": { "message": "Workflow execution error", "options": {} } } ], "active": false, "settings": { "executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000 }, "connections": {}, "description": "Automated workflow: Get messages with a certain label, remove the label, and add a new one. This workflow processes data and performs automated tasks.", "meta": { "instanceId": "workflow-8a6df07a", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:48.740675", "updatedAt": "2025-09-29T07:07:48.740697", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production" }, "tags": [ "automation", "n8n", "production-ready", "excellent", "optimized" ], "notes": "Excellent quality workflow: Get messages with a certain label, remove the label, and add a new one. This workflow has been optimized for production use with comprehensive error handling, security, and documentation." }