{ "kind": "open-flow-workflow", "version": 1, "name": "Gmail Label Switcher", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_3005c5cb3c8ccae3": { "name": "Switch message labels", "kind": "start", "inputDefs": [] }, "n_d9994c817ee87f43": { "inputs": { "sourceLabelId": { "kind": "value", "value": "YOUR_SOURCE_LABEL_ID" }, "maxResults": { "kind": "value", "value": 10 } }, "name": "Read source-label messages", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "sourceLabelId" }, { "jsonSchema": { "type": "integer", "minimum": 1, "maximum": 500 }, "nullable": false, "handle": "maxResults" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "anyOf": [ { "type": "object", "properties": { "messageId": { "type": "string", "description": "Gmail message ID." }, "threadId": { "type": "string", "description": "Gmail thread ID." } }, "required": [ "messageId", "threadId" ], "additionalProperties": false, "description": "A union variant." }, { "type": "object", "properties": { "historyId": { "type": "string", "description": "The message history ID." }, "internalDate": { "type": "string", "description": "The internal timestamp in milliseconds." }, "sizeEstimate": { "type": "integer", "description": "The estimated message size in bytes." }, "snippet": { "type": "string", "description": "The message snippet." }, "messageId": { "type": "string", "description": "Gmail message ID." }, "threadId": { "type": "string", "description": "Gmail thread ID." }, "labelIds": { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "Label IDs applied to the message." }, "subject": { "type": "string", "description": "Normalized message subject line." }, "sender": { "type": "string", "description": "Normalized sender value." }, "to": { "type": "string", "description": "Normalized To header value." }, "messageTimestamp": { "type": "string", "description": "Message timestamp returned by Gmail." } }, "required": [ "messageId", "threadId", "labelIds", "subject", "sender", "to", "messageTimestamp" ], "additionalProperties": false, "description": "Schema for gmailMessageSummarySchema." }, { "type": "object", "properties": { "historyId": { "type": "string", "description": "The message history ID." }, "internalDate": { "type": "string", "description": "The internal timestamp in milliseconds." }, "sizeEstimate": { "type": "integer", "description": "The estimated message size in bytes." }, "snippet": { "type": "string", "description": "The message snippet." }, "messageId": { "type": "string", "description": "Gmail message ID." }, "threadId": { "type": "string", "description": "Gmail thread ID." }, "labelIds": { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "Label IDs applied to the message." }, "subject": { "type": "string", "description": "Normalized message subject line." }, "sender": { "type": "string", "description": "Normalized sender value." }, "to": { "type": "string", "description": "Normalized To header value." }, "preview": { "type": "object", "properties": { "subject": { "type": "string", "description": "Preview subject extracted from the message." }, "body": { "type": "string", "description": "Preview body text extracted from the message." } }, "required": [ "subject", "body" ], "additionalProperties": false, "description": "Short preview of the message subject and body." }, "payload": { "type": [ "object", "null" ], "additionalProperties": { "description": "A record value." }, "description": "Raw Gmail payload object, or null when it was not included." }, "messageText": { "type": "string", "description": "Best-effort plain-text representation of the message body." }, "attachmentList": { "type": "array", "items": { "type": "object", "properties": { "attachmentId": { "type": [ "string", "null" ], "description": "Attachment ID, or null when Gmail inlines the body." }, "filename": { "type": "string", "description": "Attachment filename." }, "mimeType": { "type": "string", "description": "Attachment MIME type." }, "size": { "type": "integer", "description": "Attachment size in bytes." }, "partId": { "type": [ "string", "null" ], "description": "Gmail MIME part ID, when supplied." }, "contentId": { "type": [ "string", "null" ], "description": "Bare Content-ID, when supplied." }, "disposition": { "type": [ "string", "null" ], "enum": [ "inline", "attachment", null ], "description": "Content-Disposition, when supplied." } }, "required": [ "attachmentId", "filename", "mimeType", "size", "partId", "contentId", "disposition" ], "additionalProperties": false, "description": "Schema for gmailAttachmentSchema." }, "description": "Normalized attachment summaries." }, "messageTimestamp": { "type": "string", "description": "Message timestamp returned by Gmail." }, "raw": { "type": "string", "description": "Raw RFC 2822 message content when Gmail returns it." } }, "required": [ "messageId", "threadId", "labelIds", "subject", "sender", "to", "preview", "payload", "messageText", "attachmentList", "messageTimestamp" ], "additionalProperties": false, "description": "Schema for gmailMessageSchema." } ], "description": "An array item." }, "description": "Messages returned by Gmail as lightweight references, lightweight summaries, or full normalized payloads." }, "nullable": false, "handle": "messages" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "sourceLabelId" } ], "name": "Read source-label messages", "moduleId": "n_a42652fdc246ae61", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [ { "action": "gmail.fetch_emails" } ] } ] } }, "n_6e1c519ac74f0629": { "inputs": { "messages": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d9994c817ee87f43", "output": "messages" } ] }, "sourceLabelId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d9994c817ee87f43", "output": "sourceLabelId" } ] } }, "name": "Remove source labels", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": { "anyOf": [ { "type": "object", "properties": { "messageId": { "type": "string", "description": "Gmail message ID." }, "threadId": { "type": "string", "description": "Gmail thread ID." } }, "required": [ "messageId", "threadId" ], "additionalProperties": false, "description": "A union variant." }, { "type": "object", "properties": { "historyId": { "type": "string", "description": "The message history ID." }, "internalDate": { "type": "string", "description": "The internal timestamp in milliseconds." }, "sizeEstimate": { "type": "integer", "description": "The estimated message size in bytes." }, "snippet": { "type": "string", "description": "The message snippet." }, "messageId": { "type": "string", "description": "Gmail message ID." }, "threadId": { "type": "string", "description": "Gmail thread ID." }, "labelIds": { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "Label IDs applied to the message." }, "subject": { "type": "string", "description": "Normalized message subject line." }, "sender": { "type": "string", "description": "Normalized sender value." }, "to": { "type": "string", "description": "Normalized To header value." }, "messageTimestamp": { "type": "string", "description": "Message timestamp returned by Gmail." } }, "required": [ "messageId", "threadId", "labelIds", "subject", "sender", "to", "messageTimestamp" ], "additionalProperties": false, "description": "Schema for gmailMessageSummarySchema." }, { "type": "object", "properties": { "historyId": { "type": "string", "description": "The message history ID." }, "internalDate": { "type": "string", "description": "The internal timestamp in milliseconds." }, "sizeEstimate": { "type": "integer", "description": "The estimated message size in bytes." }, "snippet": { "type": "string", "description": "The message snippet." }, "messageId": { "type": "string", "description": "Gmail message ID." }, "threadId": { "type": "string", "description": "Gmail thread ID." }, "labelIds": { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "Label IDs applied to the message." }, "subject": { "type": "string", "description": "Normalized message subject line." }, "sender": { "type": "string", "description": "Normalized sender value." }, "to": { "type": "string", "description": "Normalized To header value." }, "preview": { "type": "object", "properties": { "subject": { "type": "string", "description": "Preview subject extracted from the message." }, "body": { "type": "string", "description": "Preview body text extracted from the message." } }, "required": [ "subject", "body" ], "additionalProperties": false, "description": "Short preview of the message subject and body." }, "payload": { "type": [ "object", "null" ], "additionalProperties": { "description": "A record value." }, "description": "Raw Gmail payload object, or null when it was not included." }, "messageText": { "type": "string", "description": "Best-effort plain-text representation of the message body." }, "attachmentList": { "type": "array", "items": { "type": "object", "properties": { "attachmentId": { "type": [ "string", "null" ], "description": "Attachment ID, or null when Gmail inlines the body." }, "filename": { "type": "string", "description": "Attachment filename." }, "mimeType": { "type": "string", "description": "Attachment MIME type." }, "size": { "type": "integer", "description": "Attachment size in bytes." }, "partId": { "type": [ "string", "null" ], "description": "Gmail MIME part ID, when supplied." }, "contentId": { "type": [ "string", "null" ], "description": "Bare Content-ID, when supplied." }, "disposition": { "type": [ "string", "null" ], "enum": [ "inline", "attachment", null ], "description": "Content-Disposition, when supplied." } }, "required": [ "attachmentId", "filename", "mimeType", "size", "partId", "contentId", "disposition" ], "additionalProperties": false, "description": "Schema for gmailAttachmentSchema." }, "description": "Normalized attachment summaries." }, "messageTimestamp": { "type": "string", "description": "Message timestamp returned by Gmail." }, "raw": { "type": "string", "description": "Raw RFC 2822 message content when Gmail returns it." } }, "required": [ "messageId", "threadId", "labelIds", "subject", "sender", "to", "preview", "payload", "messageText", "attachmentList", "messageTimestamp" ], "additionalProperties": false, "description": "Schema for gmailMessageSchema." } ], "description": "An array item." }, "description": "Messages returned by Gmail as lightweight references, lightweight summaries, or full normalized payloads." }, "nullable": false, "handle": "messages" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "sourceLabelId" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "historyId": { "anyOf": [ { "type": "string", "description": "The message history ID." }, { "type": "null" } ] }, "internalDate": { "anyOf": [ { "type": "string", "description": "The internal timestamp in milliseconds." }, { "type": "null" } ] }, "sizeEstimate": { "anyOf": [ { "type": "integer", "description": "The estimated message size in bytes." }, { "type": "null" } ] }, "snippet": { "anyOf": [ { "type": "string", "description": "The message snippet." }, { "type": "null" } ] }, "messageId": { "type": "string", "description": "Gmail message ID." }, "threadId": { "type": "string", "description": "Gmail thread ID." }, "labelIds": { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "Label IDs applied to the message." }, "subject": { "type": "string", "description": "Normalized message subject line." }, "sender": { "type": "string", "description": "Normalized sender value." }, "to": { "type": "string", "description": "Normalized To header value." }, "preview": { "type": "object", "properties": { "subject": { "type": "string", "description": "Preview subject extracted from the message." }, "body": { "type": "string", "description": "Preview body text extracted from the message." } }, "required": [ "subject", "body" ], "additionalProperties": false, "description": "Short preview of the message subject and body." }, "payload": { "anyOf": [ { "type": [ "object", "null" ], "additionalProperties": { "description": "A record value." }, "description": "Raw Gmail payload object, or null when it was not included." }, { "type": "null" } ] }, "messageText": { "type": "string", "description": "Best-effort plain-text representation of the message body." }, "attachmentList": { "type": "array", "items": { "type": "object", "properties": { "attachmentId": { "type": [ "string", "null" ], "description": "Attachment ID, or null when Gmail inlines the body." }, "filename": { "type": "string", "description": "Attachment filename." }, "mimeType": { "type": "string", "description": "Attachment MIME type." }, "size": { "type": "integer", "description": "Attachment size in bytes." }, "partId": { "type": [ "string", "null" ], "description": "Gmail MIME part ID, when supplied." }, "contentId": { "type": [ "string", "null" ], "description": "Bare Content-ID, when supplied." }, "disposition": { "type": [ "string", "null" ], "enum": [ "inline", "attachment", null ], "description": "Content-Disposition, when supplied." } }, "required": [ "attachmentId", "filename", "mimeType", "size", "partId", "contentId", "disposition" ], "additionalProperties": false, "description": "Schema for gmailAttachmentSchema." }, "description": "Normalized attachment summaries." }, "messageTimestamp": { "type": "string", "description": "Message timestamp returned by Gmail." }, "raw": { "anyOf": [ { "type": "string", "description": "Raw RFC 2822 message content when Gmail returns it." }, { "type": "null" } ] } }, "required": [ "messageId", "threadId", "labelIds", "subject", "sender", "to", "preview", "messageText", "attachmentList", "messageTimestamp" ], "additionalProperties": false } }, "nullable": false, "handle": "messages" }, { "jsonSchema": { "type": "integer", "minimum": 0 }, "nullable": false, "handle": "count" } ], "name": "Remove source labels", "moduleId": "n_8cfe664f304d220c", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [ { "action": "gmail.add_label_to_email" } ] } ] } }, "n_269007f091333d55": { "inputs": { "messages": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6e1c519ac74f0629", "output": "messages" } ] }, "destinationLabelId": { "kind": "value", "value": "YOUR_DESTINATION_LABEL_ID" } }, "name": "Add destination labels", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "historyId": { "anyOf": [ { "type": "string", "description": "The message history ID." }, { "type": "null" } ] }, "internalDate": { "anyOf": [ { "type": "string", "description": "The internal timestamp in milliseconds." }, { "type": "null" } ] }, "sizeEstimate": { "anyOf": [ { "type": "integer", "description": "The estimated message size in bytes." }, { "type": "null" } ] }, "snippet": { "anyOf": [ { "type": "string", "description": "The message snippet." }, { "type": "null" } ] }, "messageId": { "type": "string", "description": "Gmail message ID." }, "threadId": { "type": "string", "description": "Gmail thread ID." }, "labelIds": { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "Label IDs applied to the message." }, "subject": { "type": "string", "description": "Normalized message subject line." }, "sender": { "type": "string", "description": "Normalized sender value." }, "to": { "type": "string", "description": "Normalized To header value." }, "preview": { "type": "object", "properties": { "subject": { "type": "string", "description": "Preview subject extracted from the message." }, "body": { "type": "string", "description": "Preview body text extracted from the message." } }, "required": [ "subject", "body" ], "additionalProperties": false, "description": "Short preview of the message subject and body." }, "payload": { "anyOf": [ { "type": [ "object", "null" ], "additionalProperties": { "description": "A record value." }, "description": "Raw Gmail payload object, or null when it was not included." }, { "type": "null" } ] }, "messageText": { "type": "string", "description": "Best-effort plain-text representation of the message body." }, "attachmentList": { "type": "array", "items": { "type": "object", "properties": { "attachmentId": { "type": [ "string", "null" ], "description": "Attachment ID, or null when Gmail inlines the body." }, "filename": { "type": "string", "description": "Attachment filename." }, "mimeType": { "type": "string", "description": "Attachment MIME type." }, "size": { "type": "integer", "description": "Attachment size in bytes." }, "partId": { "type": [ "string", "null" ], "description": "Gmail MIME part ID, when supplied." }, "contentId": { "type": [ "string", "null" ], "description": "Bare Content-ID, when supplied." }, "disposition": { "type": [ "string", "null" ], "enum": [ "inline", "attachment", null ], "description": "Content-Disposition, when supplied." } }, "required": [ "attachmentId", "filename", "mimeType", "size", "partId", "contentId", "disposition" ], "additionalProperties": false, "description": "Schema for gmailAttachmentSchema." }, "description": "Normalized attachment summaries." }, "messageTimestamp": { "type": "string", "description": "Message timestamp returned by Gmail." }, "raw": { "anyOf": [ { "type": "string", "description": "Raw RFC 2822 message content when Gmail returns it." }, { "type": "null" } ] } }, "required": [ "messageId", "threadId", "labelIds", "subject", "sender", "to", "preview", "messageText", "attachmentList", "messageTimestamp" ], "additionalProperties": false } }, "nullable": false, "handle": "messages" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "destinationLabelId" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "historyId": { "anyOf": [ { "type": "string", "description": "The message history ID." }, { "type": "null" } ] }, "internalDate": { "anyOf": [ { "type": "string", "description": "The internal timestamp in milliseconds." }, { "type": "null" } ] }, "sizeEstimate": { "anyOf": [ { "type": "integer", "description": "The estimated message size in bytes." }, { "type": "null" } ] }, "snippet": { "anyOf": [ { "type": "string", "description": "The message snippet." }, { "type": "null" } ] }, "messageId": { "type": "string", "description": "Gmail message ID." }, "threadId": { "type": "string", "description": "Gmail thread ID." }, "labelIds": { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "Label IDs applied to the message." }, "subject": { "type": "string", "description": "Normalized message subject line." }, "sender": { "type": "string", "description": "Normalized sender value." }, "to": { "type": "string", "description": "Normalized To header value." }, "preview": { "type": "object", "properties": { "subject": { "type": "string", "description": "Preview subject extracted from the message." }, "body": { "type": "string", "description": "Preview body text extracted from the message." } }, "required": [ "subject", "body" ], "additionalProperties": false, "description": "Short preview of the message subject and body." }, "payload": { "anyOf": [ { "type": [ "object", "null" ], "additionalProperties": { "description": "A record value." }, "description": "Raw Gmail payload object, or null when it was not included." }, { "type": "null" } ] }, "messageText": { "type": "string", "description": "Best-effort plain-text representation of the message body." }, "attachmentList": { "type": "array", "items": { "type": "object", "properties": { "attachmentId": { "type": [ "string", "null" ], "description": "Attachment ID, or null when Gmail inlines the body." }, "filename": { "type": "string", "description": "Attachment filename." }, "mimeType": { "type": "string", "description": "Attachment MIME type." }, "size": { "type": "integer", "description": "Attachment size in bytes." }, "partId": { "type": [ "string", "null" ], "description": "Gmail MIME part ID, when supplied." }, "contentId": { "type": [ "string", "null" ], "description": "Bare Content-ID, when supplied." }, "disposition": { "type": [ "string", "null" ], "enum": [ "inline", "attachment", null ], "description": "Content-Disposition, when supplied." } }, "required": [ "attachmentId", "filename", "mimeType", "size", "partId", "contentId", "disposition" ], "additionalProperties": false, "description": "Schema for gmailAttachmentSchema." }, "description": "Normalized attachment summaries." }, "messageTimestamp": { "type": "string", "description": "Message timestamp returned by Gmail." }, "raw": { "anyOf": [ { "type": "string", "description": "Raw RFC 2822 message content when Gmail returns it." }, { "type": "null" } ] } }, "required": [ "messageId", "threadId", "labelIds", "subject", "sender", "to", "preview", "messageText", "attachmentList", "messageTimestamp" ], "additionalProperties": false } }, "nullable": false, "handle": "messages" }, { "jsonSchema": { "type": "integer", "minimum": 0 }, "nullable": false, "handle": "count" } ], "name": "Add destination labels", "moduleId": "n_9f30980bec35e13e", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [ { "action": "gmail.add_label_to_email" } ] } ] } }, "n_154648c1ae13d20a": { "name": "Label changes", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "historyId": { "anyOf": [ { "type": "string", "description": "The message history ID." }, { "type": "null" } ] }, "internalDate": { "anyOf": [ { "type": "string", "description": "The internal timestamp in milliseconds." }, { "type": "null" } ] }, "sizeEstimate": { "anyOf": [ { "type": "integer", "description": "The estimated message size in bytes." }, { "type": "null" } ] }, "snippet": { "anyOf": [ { "type": "string", "description": "The message snippet." }, { "type": "null" } ] }, "messageId": { "type": "string", "description": "Gmail message ID." }, "threadId": { "type": "string", "description": "Gmail thread ID." }, "labelIds": { "type": "array", "items": { "type": "string", "description": "An array item." }, "description": "Label IDs applied to the message." }, "subject": { "type": "string", "description": "Normalized message subject line." }, "sender": { "type": "string", "description": "Normalized sender value." }, "to": { "type": "string", "description": "Normalized To header value." }, "preview": { "type": "object", "properties": { "subject": { "type": "string", "description": "Preview subject extracted from the message." }, "body": { "type": "string", "description": "Preview body text extracted from the message." } }, "required": [ "subject", "body" ], "additionalProperties": false, "description": "Short preview of the message subject and body." }, "payload": { "anyOf": [ { "type": [ "object", "null" ], "additionalProperties": { "description": "A record value." }, "description": "Raw Gmail payload object, or null when it was not included." }, { "type": "null" } ] }, "messageText": { "type": "string", "description": "Best-effort plain-text representation of the message body." }, "attachmentList": { "type": "array", "items": { "type": "object", "properties": { "attachmentId": { "type": [ "string", "null" ], "description": "Attachment ID, or null when Gmail inlines the body." }, "filename": { "type": "string", "description": "Attachment filename." }, "mimeType": { "type": "string", "description": "Attachment MIME type." }, "size": { "type": "integer", "description": "Attachment size in bytes." }, "partId": { "type": [ "string", "null" ], "description": "Gmail MIME part ID, when supplied." }, "contentId": { "type": [ "string", "null" ], "description": "Bare Content-ID, when supplied." }, "disposition": { "type": [ "string", "null" ], "enum": [ "inline", "attachment", null ], "description": "Content-Disposition, when supplied." } }, "required": [ "attachmentId", "filename", "mimeType", "size", "partId", "contentId", "disposition" ], "additionalProperties": false, "description": "Schema for gmailAttachmentSchema." }, "description": "Normalized attachment summaries." }, "messageTimestamp": { "type": "string", "description": "Message timestamp returned by Gmail." }, "raw": { "anyOf": [ { "type": "string", "description": "Raw RFC 2822 message content when Gmail returns it." }, { "type": "null" } ] } }, "required": [ "messageId", "threadId", "labelIds", "subject", "sender", "to", "preview", "messageText", "attachmentList", "messageTimestamp" ], "additionalProperties": false } }, "nullable": false, "handle": "messages" }, { "jsonSchema": { "type": "integer", "minimum": 0 }, "nullable": false, "handle": "removedCount" }, { "jsonSchema": { "type": "integer", "minimum": 0 }, "nullable": false, "handle": "addedCount" } ], "outputMappings": { "messages": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_269007f091333d55", "output": "messages" } ] }, "removedCount": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6e1c519ac74f0629", "output": "count" } ] }, "addedCount": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_269007f091333d55", "output": "count" } ] } } } }, "edges": [ { "source": "n_3005c5cb3c8ccae3", "target": "n_d9994c817ee87f43" }, { "source": "n_d9994c817ee87f43", "target": "n_6e1c519ac74f0629" }, { "source": "n_6e1c519ac74f0629", "target": "n_269007f091333d55" }, { "source": "n_269007f091333d55", "target": "n_154648c1ae13d20a" } ] } }, "modules": { "n_a42652fdc246ae61": { "name": "Read source-label messages", "imports": [], "source": "export default async function readLabelMessages({ sourceLabelId, maxResults }, context) {\n const result = await context.actions.gmail.fetch_emails({ labelIds: [sourceLabelId], maxResults, detail: 'full' });\n return { messages: result.messages, sourceLabelId };\n}\n" }, "n_8cfe664f304d220c": { "name": "Remove source labels", "imports": [], "source": "export default async function removeMessageLabel({ messages, sourceLabelId }, context) {\n const modified = [];\n for (const message of messages) {\n if (typeof message.messageId !== 'string' || !message.messageId) throw new Error('Gmail returned a message without its ID');\n modified.push(await context.actions.gmail.add_label_to_email({ messageId: message.messageId, removeLabelIds: [sourceLabelId] }));\n }\n return { messages: modified, count: modified.length };\n}\n" }, "n_9f30980bec35e13e": { "name": "Add destination labels", "imports": [], "source": "export default async function addMessageLabel({ messages, destinationLabelId }, context) {\n const modified = [];\n for (const message of messages) {\n modified.push(await context.actions.gmail.add_label_to_email({ messageId: message.messageId, addLabelIds: [destinationLabelId] }));\n }\n return { messages: modified, count: modified.length };\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }