Skip to content

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

1.3 KB
Raw Blame
import { createAction } from '@activepieces/pieces-framework';
import { baserowAuth } from '../auth';
import { baserowCommon, makeClient } from '../common';
import { deleteRowOutputSchema } from '../output-schemas';

export const deleteRowAction = createAction({
  name: 'baserow_delete_row',
  classification: 'DESTRUCTIVE',
  outputSchema: deleteRowOutputSchema,
  displayName: 'Delete Row',
  description: 'Deletes an existing row.',
  audience: 'human',
  aiMetadata: {
    description:
      'Permanently deletes one row from a Baserow table by its numeric row ID. Use to remove a single known record; for multiple rows use Batch Delete Rows. Destructive — confirm the row ID first (resolve via Find Row or List Rows if unknown). Not idempotent against changing data: once the row is gone a repeat call targets a no-longer-existing ID.',
    idempotent: false,
  },
  auth: baserowAuth,
  propertyGroups: [
    {
      key: 'row',
      display: 'section',
      label: 'Row to Delete',
      icon: 'trash',
      props: ['table_id', 'row_id'],
    },
  ],
  props: {
    table_id: baserowCommon.tableId(),
    row_id: baserowCommon.rowId(),
  },
  async run(context) {
    const { table_id, row_id } = context.propsValue;
    const client = await makeClient(context.auth);
    await client.deleteRow(table_id!, row_id!);
    return { success: true };
  },
});