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 { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { pollingHelper } from '@activepieces/pieces-common';
import { ninjapipeAuth } from '../auth';
import { ninjapipeSchemas } from '../output-schemas';
import { ninjapipePolling } from './common';
const polling = ninjapipePolling.buildPolling({ path: '/companies', field: 'updated_at' });
export const newOrUpdatedCompany = createTrigger({
auth: ninjapipeAuth,
name: 'new_or_updated_company',
classification: 'READ',
displayName: 'New or Updated Company',
description: 'Triggers when a company is created or updated.',
aiMetadata: {
description:
'Fires whenever a NinjaPipe company is created or changed, found by polling companies sorted by updated_at. The payload is the current company record. One company can fire many times.',
},
type: TriggerStrategy.POLLING,
outputSchema: ninjapipeSchemas.company,
sampleData: {
id: '43e794a1-fbc0-4167-b881-c2c568d30a51',
name: 'Acme GmbH',
domain: 'acme.example',
email: '[email protected]',
phone: '+4930123456',
website: 'https://acme.example',
industry: 'Software',
status: 'Active',
owner_id: '01a55c1c-96af-4a4f-879b-e317def0769a',
is_archived: false,
slug: 'acme-gmbh',
fields: {},
created_at: '2026-10-25T15:33:57.944899+00:00',
updated_at: '2026-10-25T15:33:57.944899+00:00',
},
props: {},
async test(context) {
return pollingHelper.test(polling, context);
},
async onEnable(context) {
await pollingHelper.onEnable(polling, context);
},
async onDisable(context) {
await pollingHelper.onDisable(polling, context);
},
async run(context) {
return pollingHelper.poll(polling, context);
},
});