On New Or Updated Records

Lightyear lets you create powerful automations with Airtable
Airtable Icon
import { Airtable } from "@runlightyear/airtable";

Airtable.onNewOrUpdatedRecords({
  name: "onNewOrUpdatedRecords",
  title: "On New or Updated Records",
  run: async ({ data, auths }) => {
    console.log("New or updated records: ", data.newOrUpdatedRecords);

    const airtable = new Airtable({ auth: auths.airtable });

    for (const newOrUpdatedRecord of data.newOrUpdatedRecords) {
      const response = await airtable.getRecord({
        baseId: data.baseId,
        tableIdOrName: newOrUpdatedRecord.tableId,
        recordId: newOrUpdatedRecord.recordId,
      });

      console.log("Record data: ", response.data);
    }
  },
});
© 2025 Lightyear Labs, Inc.
San Francisco, CA 94104, USA
Terms and ConditionsPrivacy Policy

Sync your customer data at scale

Discover what we've built for you