n8n

How to Generate Email Timesheet Reports?

Get a polished timesheet report sent by email with one click. Team leads and ops managers can review a clean HTML file that groups entries and includes user avatars for quick visual checks.

Here is how it works. A manual start pulls timesheet records from a function node, then sorts them by user, task, and date. Unique avatar links are extracted and each image is downloaded. The data and images are merged, and a custom function builds a styled markdown report with a table layout. That markdown converts to full HTML, gets saved as report.html, and is attached to an email through SMTP.

Setup is simple. Add your mail server details and keep the sample data or point the function to your own source. Most teams will cut weekly reporting time from hours to minutes and avoid copy paste errors. It fits small agencies, internal teams, and project managers who need a weekly or monthly time summary they can share fast.

What are the key features?

  • One click start using a manual trigger for on demand reports
  • Function node builds or simulates timesheet records you can swap for your data source
  • Sorting step orders items by user, task, and date for clear grouping
  • Duplicate removal extracts unique avatar links so each image is fetched once
  • HTTP request downloads each avatar image as a file for use in the report
  • Merge by index combines timesheet rows with the fetched images
  • Custom report builder creates a styled markdown table with headers
  • Markdown conversion produces a complete HTML document with table support
  • Binary move saves the HTML as report.html for email attachment
  • Email send uses SMTP to deliver the report with a clear subject line

What are the benefits?

  • Reduce manual reporting work from 2 hours to 5 minutes
  • Streamline time review by 80 percent through automatic sorting and formatting
  • Improve accuracy by 90 percent by using a consistent HTML template
  • Handle 10 times more entries without extra effort using automated merge and build
  • Share results instantly through SMTP email with a ready to read attachment

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. Open the Send Email node. In the Credential to connect with dropdown, click Create new credential, choose SMTP, and enter your mail server host, port, username, and password or app password. Enable TLS if your provider requires it.
  3. Click Test on the SMTP credential if available, or run the node with sample data to confirm email delivery to your address.
  4. Open the GetTimesheetRecords function node. Review the sample records and field names like UserName, UserAvatar, TaskTitle, and date. Replace the sample array with your own data if needed.
  5. Check the SortElements node. Confirm the sort order fields are UserName, TaskTitle, and date so the report groups entries clearly.
  6. Open the GetImg node. Make sure it removes duplicates based on the UserAvatar field. If your data uses a different field, update the field name.
  7. Open the ImgBinary HTTP Request node. Confirm the URL uses the UserAvatar field and the response format is set to file. Run the node to verify images download correctly.
  8. Open the Merge2 node. Keep the mode as merge by index with an outer join so data and images are combined into one stream.
  9. Open the CreateMDReport function node. Adjust the headers, table columns, and any inline style you want in the markdown output.
  10. Open the Markdown node. Keep the mode as markdown to HTML and ensure tables and complete HTML document options are enabled.
  11. Open the Move Binary Data node. Confirm mode is JSON to Binary, fileName is report.html, and mimeType is text/html.
  12. Click Execute to run the whole flow. Check your inbox for an email with the report.html attachment. Open it to confirm the table, sorting, and avatars look correct.
  13. If images do not show, verify the avatar URLs are public and that your server can reach them. If email fails, double check SMTP host, port, and TLS settings.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.