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 { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { createWebhookTriggerHooks, dynamicWebhookInstructions, webhookUrlInfo } from '../common/webhook-trigger';
import { rowUpdatedTriggerOutputSchema } from '../output-schemas';
const triggerHooks = createWebhookTriggerHooks({
events: ['rows.updated'],
storeKey: 'baserow_row_updated_trigger',
});
export const rowUpdatedTrigger = createTrigger({
name: 'baserow_row_updated',
classification: 'READ',
outputSchema: rowUpdatedTriggerOutputSchema,
auth: baserowAuth,
displayName: 'Updated Row',
description: 'Triggers when an existing row is updated in a Baserow table.',
aiMetadata: {
description:
'Fires when an existing row in the selected Baserow table changes, emitting one event per updated row with both its new and previous field values. Use to react to individual edits; for the batch form use Updated Rows (Batch).',
},
type: TriggerStrategy.WEBHOOK,
propertyGroups: [
{
key: 'table',
display: 'section',
label: 'Table to Watch',
icon: 'file',
props: ['table_id'],
},
{
key: 'setup',
display: 'section',
label: 'Webhook',
icon: 'send',
props: ['webhook_url', 'instructions'],
},
],
props: {
table_id: baserowCommon.tableId(),
webhook_url: webhookUrlInfo(),
instructions: dynamicWebhookInstructions('Rows updated'),
},
sampleData: {
row: {
id: 1,
order: '1.00000000000000000000',
Name: 'Updated row',
},
previous: {
id: 1,
order: '1.00000000000000000000',
Name: 'Original row',
},
},
onEnable: triggerHooks.onEnable,
onDisable: triggerHooks.onDisable,
async run(context) {
const body = context.payload.body as {
items?: Record<string, unknown>[];
old_items?: Record<string, unknown>[];
};
return (body.items ?? [])
.map((item, i) => ({
row: item,
previous: (body.old_items ?? [])[i] ?? null,
}))
.filter(({ row, previous }) => {
if (!previous) return true;
return JSON.stringify(row) !== JSON.stringify(previous);
});
},
async test(context) {
const tableId = context.propsValue.table_id;
if (!tableId) return [];
const client = await makeClient(context.auth);
const response = await client.listRows(tableId, 1, 5);
return response.results.map((row) => ({ row, previous: null }));
},
});