Sync employee data to Pub/Sub from Google Drive
Recipe ToolsDocument/FileSales EnablementData ParserMarketingUtilities
What it does
When someone calls this automation, it downloads the Hogwarts Employees CSV file from Google Drive and parses the records. It publishes each employee record to the Pub/Sub topic with source marked as CASH22_HR_APP.
Who it's for
HR teams who need to sync employee records from Google Drive to Pub/Sub for downstream processing.
How teams use this
Sync employee records on a schedule
Run this automation daily or weekly to keep the Pub/Sub topic updated with the latest employee data from Google Drive. Downstream systems subscribe to the topic and receive each batch automatically.
Route employee data to multiple systems
Publish employee records to Pub/Sub so multiple downstream subscribers can consume the same data without duplicating this sync logic. Each subscriber processes the records for its own system.
Add employee department to published records
Extend the CSV parser step to include a department field from the file so each published record contains department along with email. Downstream systems then have richer employee context.
Filter inactive employees before publishing
Add a condition after parsing to check if an employee status is active, and only publish records that pass the filter. Downstream systems receive only current employees.
How it works
- Receive the function call. A real-time function call starts this automation to sync employee data from Google Drive to the Pub/Sub topic.
- Download the employee file. Download the Hogwarts Employees CSV file from Google Drive so the records can be parsed and sent downstream.
- Parse the CSV records. Parse the CSV file into individual employee records with email and other fields ready to publish to Pub/Sub.
- Publish records to Pub/Sub topic. Publish the batch of employee records to the Pub/Sub topic with source set to CASH22_HR_APP so subscribers know the origin.
- Handle errors and notify admins. If an error occurs during the sync, retry up to 3 times. If the error persists, send an email to the admin team and stop the job.