The anatomy of an Event
Flatfile Events adhere to a standardized structure, and Event listeners have the flexibility to handle Events within Flatfile using any of the following syntaxes. See API ReferenceUsing Events
Once an Event is received, it is routed to any awaiting listeners which are added withaddEventListener() or its alias on().
An Event context is passed to an EventFilter
Building with events
By leveraging the robust capabilities of our @flatfile/listener library, we can seamlessly intercept any Event and execute a callback function based on the values encapsulated within the Event itself.Event Topics
Utilize the reference provided by the response of each Event topic to determine the desired outcome or plan subsequent actions accordingly.Workbook
workbook:created
readonly
Called when a new workbook is created.
workbook:updated
readonly
Called when workbook metadata is updated. For example, updating the name of a
workbook. Adding data to a workbook does not emit this Event.
workbook:deleted
readonly
Called when a workbook is deleted.
workbook:expired
readonly
Called when a workbook is expired.
Document
document:created
readonly
Called when a document is created on a workbook.
document:updated
readonly
Called when a document is updated on a workbook.
document:deleted
readonly
Called when a document is deleted on a workbook.
Sheet
sheet:updated
readonly
Called when a sheet is updated. For example, running sheet level validations.
Adding data to a sheet does not emit this event.
sheet:deleted
readonly
Called when a sheet is deleted.
Snapshot
snapshot:created
readonly
Called when a snapshot is created of the sheet. This can be triggered by the
API endpoint or when AI Assist is used to modify a sheet.
commit:completed
readonly
This only runs when trackChanges is enabled on the workbook. This event fires
when a commit has completed and any record changes have finished.
layer:created
readonly
Called when a new layer is created within a commit. A layer is a
programmatically generated artifact of a commit. For example, when a data hook
or formatting rule applies formatting or validation automatically. Layers
cannot be updated or deleted, but you can ignore them to see the original
source data.
File Upload
file:created
readonly
Called when a file upload begins or a new file is created.
file:updated
readonly
Called when a file is updated. For example, when a file has been extracted
into a workbook.
file:deleted
readonly
Called when a file is deleted.
file:expired
readonly
Called when a file is expired.
Jobs
job:created
readonly
Called when a new job is first created. Some jobs will enter an optional
planning state at this time. A job with ‘immediate’ set to true will skip the
planning step and transition directly to ‘ready.‘
job:ready
readonly
Called when a new job is ready to execute. Either the job has a complete plan
of work or the job is configured to not need a plan. This is the only event
most job implementations will care about. Once a ready job is acknowledged by
a listener, it transitions into an executing state.
job:updated
readonly
Called when a job is updated. For example, when a listener updates the state
or progress of the job. The event will emit many times as the listener
incrementally completes work and updates the job.
job:completed
readonly
Called when a job has completed.
job:outcome-acknowledged
readonly
Called to trigger workflow actions after the user has acknowledged that the
job has completed or failed. Background jobs will skip this step.
job:failed
readonly
Called when a job fails.
job:deleted
readonly
Called when a job is deleted.
Agents
agent:created
readonly
Called when a new agent is deployed.
agent:updated
readonly
Called when an agent is updated.
Space
space:created
readonly
Called when a new space is created.
space:updated
readonly
Called when a space is updated.
space:deleted
readonly
Called when a space is deleted.
space:expired
readonly
Called when a space is expired.
space:archived
readonly
Called when a space is archived.
space:guestAdded
readonly
Called when a guest is added.
space:guestRemoved
readonly
Called when a guest’s access is revoked from a space.
Secret
secret:created
readonly
Called when a new secret is created.
secret:updated
readonly
Called when a secret is updated.
secret:deleted
readonly
Called when a secret is deleted.