This workflow automates the entire weekly timesheet reporting cycle by integrating Salesforce, OpenAI, Gmail, and n8n. It retrieves employee timesheets for the previous week, identifies which were submitted or not, summarizes all line-item activities using OpenAI, and delivers a consolidated, manager-ready summary that mirrors the final email output.
The workflow eliminates manual checking, reduces repeated follow-ups, and ensures leadership receives an accurate, structured, and consistent weekly report.
This workflow requires the Digital Biz Tech – Simple Timesheet managed package to be installed in Salesforce.
Install the Timesheet App:
https://appexchange.salesforce.com/appxListingDetail?listingId=a077704c-2e99-4653-8bde-d32e1fafd8c6
The workflow retrieves:
dbt__Timesheet__c — weekly timesheet recordsdbt__Timesheet_Line_Item__c — project and activity entriesdbt__Employee__c — employee reference and metadataThese combined objects form the complete dataset used for both submitted and pending sections.
Weekly n8n Schedule Trigger — runs once every week.
Retrieve submitted timesheets → Fetch line items → Convert to HTML → OpenAI summary → Merge with employee details.
Identify “New” timesheets → Fetch employee details → Generate pending submission list.
Merge both paths → Build formatted report → Gmail sends weekly email to managers.
Runs weekly without manual intervention and targets the previous full week.
Fetches all dbt__Timesheet__c records matching:
Timesheet for <week-start> to <week-end>
Extracted fields include:
Feeds both processing paths.
Filters timesheets where dbt__Status__c == "Submitted".
Each employee’s timesheet is processed individually.
Fetches all dbt__Timesheet_Line_Item__c entries:
Transforms line items into well-structured HTML tables for clean LLM input.
OpenAI receives the HTML + Employee ID and returns a 4-point activity summary avoiding:
Retrieves employee name, email, and additional fields if needed.
Combines:
Creates a unified object.
Produces the formatted block used in the final email:
Employee: Name
Period: Start → End
Status: Submitted
Total Hours: ...
Timesheet Line Items Breakdown:
- summary point
- summary point
- summary point
- summary point
Timesheets still in dbt__Status__c == "New" are flagged.
Fetches employee name and email.
Maps each missing submission with its reporting period.
Creates formatted pending entries:
TIMESHEET NOT SUBMITTED
Employee Name
Email: [email protected]
Combines all processed data.
Builds:
Matches the final email layout.
Automatically delivers the weekly summary to managers via Gmail OAuth.
No manual involvement required.
👤 Employee: Name
📅 Period: Start Date → End Date
📌 Status: Submitted
🕒 Total Hours: XX hrs
- Billable: XX hrs
- Non-Billable: XX hrs
- Absence: XX hrs
Weekly Requirement Met: ✔️ / ❌
📂 Timesheet Line Items Breakdown:
• Summary point 1
• Summary point 2
• Summary point 3
• Summary point 4
==========================================================
🟥 TIMESHEET NOT SUBMITTED 🟥
Employee Name
📧 Email: [email protected]
Salesforce
→ Filter Submitted / Not Submitted
↳ Submitted → Line Items → HTML → OpenAI Summary → Merge
↳ Not Submitted → Employee Lookup → Merge
→ Code Node formats unified report
→ Gmail sends professional weekly summary
| System | Purpose | Authentication |
|---|---|---|
| Salesforce | Timesheets, Employees, Timesheet Line Items | Salesforce OAuth |
| OpenAI | Weekly activity summarization | API Key |
| Gmail | Automated email delivery | Gmail OAuth |
| n8n | Workflow automation & scheduling | Native |
You are an AI assistant that extracts and summarizes weekly timesheet line items. Produce a clean, structured summary of work done for each employee. Focus only on project activities, tasks, accomplishments, and notable positives or negatives. Follow a strict JSON-only output format with four short points and no extra text or symbols.
This unified workflow delivers a complete, automated weekly reporting system that:
We can integrate this into your environment, tune the agent prompt, or extend it for more automation.
We can also help you set it up for free — from connecting credentials to deployment.
Contact: [email protected]
Website: https://www.digitalbiz.tech
LinkedIn: https://www.linkedin.com/company/digital-biz-tech/
You can also DM us on LinkedIn for any help.