Sync opportunity temperature from PostgreSQL on schedule
Recipe ToolsDatabase
What it does
When a scheduled interval arrives, this automation queries PostgreSQL for opportunities and updates their temperature data. It processes records in batches and logs the results back to the database.
Who it's for
Sales operations teams who need to refresh opportunity metrics on a regular cadence without manual intervention.
How teams use this
Refresh opportunity scores nightly
Run the temperature sync every night at midnight so sales reps see fresh opportunity rankings each morning. The query and batch size stay the same and only the schedule changes.
Update metrics for a specific pipeline stage
Modify the SQL query to filter opportunities by stage so only deals in negotiation get a temperature recalculation. The batch process and logging remain unchanged.
Add email notification on completion
Include a step to send an email summary after the batch completes so the team knows how many records were updated. Set a condition to only notify if the count exceeds a threshold.
How it works
- Run on a specified interval. This automation starts at the scheduled time you set, such as daily at 9 AM or every four hours.
- Fetch opportunities from PostgreSQL. Query PostgreSQL with custom SQL to select the opportunity records that need a temperature update.
- Update temperature for each batch. Process the opportunities in batches and call the update temperature logic for each group of records.
- Log results back to PostgreSQL. Run custom SQL to record the update timestamp and status in PostgreSQL so the team can audit what changed.