Execute custom logic on individual data records within a Flatfile Sheet with support for validation, transformation, enrichment, and cleaning.
commit:created
event, which fires when new data is added or existing data is updated.
This plugin is ideal for a variety of use cases, including:
recordHook
for processing records one-by-one, and bulkRecordHook
for processing records in batches, which is more efficient for large datasets.
sheetSlug
(string, required): The slug of the Sheet you want the hook to apply tocallback
(function, required): A function that contains your custom logic. It receives the record and the event object as argumentsoptions
(object, optional): Configuration options
concurrency
(number, default: 10): Controls how many individual record handlers can run in paralleldebug
(boolean, default: false): When set to true
, enables verbose logging to the consolesheetSlug
(string, required): The slug of the Sheet you want the hook to apply tocallback
(function, required): A function that contains your custom logic. It receives an array of records and the event object as argumentsoptions
(object, optional): Configuration options
chunkSize
(number, default: 10000): Specifies the number of records to process in each batch. Maximum recommended value is 5000parallel
(number, default: 1): Specifies how many chunks of records to process in paralleldebug
(boolean, default: false): When set to true
, enables verbose logging to the consolesheetSlug
after a commit is created. bulkRecordHook
processes all records in a single chunk sequentially (parallel: 1
). recordHook
processes up to 10 records concurrently. Debug logging is disabled.
debug: true
option in the plugin configuration. This will print detailed logs to the console, showing the timing and status of each major step: fetching data, running the handler, filtering modified records, and updating records. This can help identify performance bottlenecks or see why records are not being updated as expected.
commit:created
event. This means it runs after Flatfile’s initial parsing and validation but before the data is finalized.recordHook
) or the array of modified records (for bulkRecordHook
). If you return null
, undefined
, or nothing, your changes will not be persisted.chunkSize
for bulkRecordHook
has a recommended maximum of 5000 records to ensure stability and performance.try...catch
block.[FATAL]
prefix.