AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { HttpMethod } from '@activepieces/pieces-common';
import { createAction } from '@activepieces/pieces-framework';
import { zohoMailApiCall } from '../common';
import { zohoMailAuth } from '../common/auth';
import { accountId, folderId, messageId } from '../common/props';
export const moveEmailAction = createAction({
auth: zohoMailAuth,
name: 'move_email',
classification: 'WRITE',
displayName: 'Move Email to Folder',
description: 'Moves an email to a different folder.',
audience: 'both',
aiMetadata: {
description:
'Moves one Zoho Mail message from its current folder to a destination folder, identified by account ID, message ID, source folder, and destination folder. Use to reorganize or file a message. Idempotent: once the message is in the destination folder, repeating the move has no further effect.',
idempotent: true,
},
props: {
accountId: accountId({ displayName: 'Account', required: true }),
folderId: folderId({ displayName: 'Current Folder', required: true }),
messageId: messageId({
displayName: 'Message ID',
description: 'The ID of the email message to move.',
required: true,
}),
destfolderId: folderId({
displayName: 'Destination Folder',
description: 'Select the folder to move the email to.',
required: true,
}),
},
async run(context) {
const { accountId, destfolderId, messageId, folderId } = context.propsValue;
const response = await zohoMailApiCall({
auth: context.auth,
method: HttpMethod.PUT,
resourceUri: `/accounts/${accountId}/updatemessage`,
body: {
mode: 'moveMessage',
destfolderId: destfolderId,
messageId: [messageId],
isFolderSpecific: true,
folderId: folderId,
},
});
return response;
},
});