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 MailerLite from '@mailerlite/mailerlite-nodejs';
import { createAction } from '@activepieces/pieces-framework';
import { mailerLiteAuth } from '../auth';
import { addSubscriberToGroupOutputSchema } from '../output-schemas';
import { mailerLiteCommon } from '../common';
export const addSubscriberToGroupAction = createAction({
auth: mailerLiteAuth,
name: 'add_subscriber_to_group',
classification: 'WRITE',
displayName: 'Add Subscriber to Group',
description: 'Add an existing subscriber to a group.',
audience: 'both',
aiMetadata: {
description:
'Assign an existing MailerLite subscriber to a group, given the subscriber ID and group ID. Use this to segment a contact you already have into a list/group. The subscriber must already exist. Idempotent — re-running for a subscriber already in the group leaves membership unchanged.',
idempotent: true,
},
outputSchema: addSubscriberToGroupOutputSchema,
propertyGroups: [
{
key: 'membership',
display: 'section',
label: 'Membership',
icon: 'users',
props: ['subscriberId', 'subscriberGroupId'],
},
],
props: {
subscriberId: mailerLiteCommon.subscriberId(true),
subscriberGroupId: mailerLiteCommon.subscriberGroupId(true),
},
async run(context) {
const client = new MailerLite({ api_key: context.auth.secret_text });
const response = await client.groups.assignSubscriber(
context.propsValue.subscriberId!,
context.propsValue.subscriberGroupId!,
);
return response.data;
},
});