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 { createAction, Property } from '@activepieces/pieces-framework';
import { groupParticipantResultOutputSchema } from '../../../output-schemas';
import { HttpMethod } from '@activepieces/pieces-common';
import { whatsscaleAuth } from '../../../auth';
import { whatsscaleClient } from '../../../common/client';
import { whatsscaleProps } from '../../../common/props';
import { toParticipantJids, ConductorParticipantResult, flattenParticipantResults } from '../../../common/group-participants';
export const removeGroupParticipantsAction = createAction({
auth: whatsscaleAuth,
name: 'whatsscale_remove_group_participants_by_id',
classification: 'WRITE',
displayName: 'Remove Participants from a Group (By ID)',
description: 'Remove (kick) one or more people from a WhatsApp group by group ID.',
audience: 'ai',
aiMetadata: { description: 'Removes one or more phone numbers from a WhatsApp group, given the raw group ID. Idempotent: removing someone already outside the group converges on the same end state.', idempotent: true },
outputSchema: groupParticipantResultOutputSchema,
props: {
session: whatsscaleProps.session,
groupId: Property.ShortText({
displayName: 'Group ID',
description: 'The group ID, with or without the @g.us suffix.',
required: true,
}),
participants: Property.Array({
displayName: 'Participants',
description: 'Phone numbers in international format, digits only (e.g. 31649931832 — no +, spaces or dashes).',
required: true,
}),
},
async run(context) {
const auth = context.auth.secret_text;
const { session, groupId, participants } = context.propsValue;
const response = await whatsscaleClient(
auth,
HttpMethod.POST,
`/v1/groups/${encodeURIComponent(groupId)}/participants/remove`,
{ session, participants: toParticipantJids(participants) },
);
return flattenParticipantResults(response.body as ConductorParticipantResult[]);
},
});