Automate Timesheet Reports with n8n Workflow

Struggling with compiling timesheet data from multiple users into a clear report? This n8n workflow automates sorting, image fetching, and report generation, saving hours and reducing errors in manual timesheet management.
manualTrigger
function
itemLists
+5
Workflow Identifier: 1423
NODES in Use: Manual Trigger, Function, Item Lists, HTTP Request, Merge, Markdown, Move Binary Data, Email Send
Automate timesheet reports with n8n and HTTP Request

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What this workflow does

This workflow takes timesheet entries from different users. It fixes the order by username, task, and date. It finds user avatars without repeats and downloads the images. Then it joins avatars with tasks. It makes a clear markdown report showing tasks and hours, with images included. The report turns into HTML and can be sent by email. This helps avoid manual errors and saves hours each month.

Inputs:

  • Timesheet data with username, avatar link, task info, date, notes, and hours.
  • User avatar image URLs.

Processing steps:

  • Sort timesheets by user, task, date.
  • Remove duplicate avatar URLs to avoid repeat download.
  • Fetch avatar images by HTTP requests.
  • Merge timesheet data with avatar images.
  • Create a markdown report with grouped tasks, hours, and images.
  • Convert markdown report to full styled HTML.
  • Make the HTML report a file ready for email attachment.

Output:

  • Formatted HTML report with user avatars and task details.
  • Optional email sending with report attached.

Who should use this workflow

Anyone who manually collects timesheets from many people. This often takes too long and causes mistakes. It suits managers who want fast, clean reports including user photos. Also good for teams using n8n to reduce repeated manual work.


Tools and services used

  • n8n workflow automation platform: orchestrates nodes and data flow.
  • HTTP Request node: downloads avatar images from URLs.
  • SMTP Email service: sends reports by mail.
  • JavaScript Function nodes: simulate data and produce markdown.
  • Markdown node: converts markdown to HTML.

Beginner step-by-step: How to use this workflow in n8n

Import the workflow

  1. Download the workflow file using the Download button on this page.
  2. Open n8n editor and click Import from File.
  3. Select the workflow file to import it.

Set up required items

  1. Add necessary SMTP credentials under the Send Email node.
  2. Verify any email addresses, IDs, or folder paths in the nodes and update if needed.
  3. Check the GetTimesheetRecords function node if you want to add or modify user tasks or details.

Test and activate

  1. Run the workflow manually using the Manual Trigger node to check report output and email sending.
  2. If all works, activate the workflow using the toggle button.

Note: For automated runs, replace the Manual Trigger node with a CRON Trigger node.

For users running self-host n8n, ensure network and credentials are correctly configured.


Inputs, processing, and outputs

Inputs

  • Timesheet entries: username, avatar URL, task title, date, note, hours.
  • Avatar images fetched by URL.

Processing

  • Sort entries by user, task, date for logic.
  • Remove duplicate avatar URLs.
  • Download avatar images as binaries.
  • Combine image binaries with timesheet data.
  • Create markdown report string with grouped user and task sections.
  • Apply CSS style for table design.
  • Convert markdown to HTML.
  • Convert that HTML string into a binary file.

Outputs

  • Stylized HTML report file with embedded avatars.
  • Email with attached report (optional).

Edge cases and failures

Sometimes avatar URLs may be wrong or broken. Then, HTTP Request fails. Check URLs in the GetImg node output and fix them.

Empty or wrong markdown input to the Markdown node causes no HTML output. Look at the CreateMDReport node carefully.

Email sending errors happen when SMTP credentials are wrong. Re-enter details in the Send Email node and test sending.


Customization ideas

  • Change table colors or text fonts by editing the CSS in the CreateMDReport JavaScript.
  • Add user contact info by expanding the timesheet records in GetTimesheetRecords.
  • Use a CRON Trigger instead of manual trigger to automate report creation.
  • Add a PDF convert node after markdown to send formal document copies.
  • Insert functions to calculate total hours per user or project for deeper reports.

Summary

✓ Saves time by automating timesheet report creation.

✓ Removes repeated avatar downloads for faster processing.

✓ Produces clear reports with images and detailed task info.

→ Result is a ready HTML report file and optional email sending.

→ Simple steps let managers reduce errors and manual work.


return [{UserName: "User 1 - Lead Programmer",
         UserAvatar: "https://www.gravatar.com/avatar/?d=robohash&s=32",
         TaskTitle: "Admin",
         date: "2022-05-31T00:00:00.0000000+02:00",
         note: "Creating invoices and submitting timesheets",
         hours: 0.5},
         {UserName: "User 1 - Lead Programmer",
         UserAvatar: "https://www.gravatar.com/avatar/?d=robohash&s=32",
         TaskTitle: "Admin",
         date: "2022-05-02T00:00:00.0000000+02:00",
         note: "Reporting last month's activity",
         hours: 0.5},
         // continued as in original code
         ];

// created report header and custom table style
var md_reporthead="#Timesheet report\n";
var md_style =  (`\n\n`);

var md_reportbody=md_style+md_reporthead;

var tablehead = "| Date | Hours | Task Description |\n|:---|:---:|---|\n";

var cur_user="";
var cur_usernum=0;

var cur_task="";
var cur_tasktotal=0;

for (item of items) {
  if (item.json.UserName != cur_user) {
    md_reportbody += (cur_tasktotal) ? "\n*"+cur_tasktotal.toFixed(2)+" - Total hours for this task*\n" : "";
    cur_tasktotal = 0; cur_task="";
    cur_user = item.json.UserName;
    md_reportbody += `\n##![img](data:image/png;base64,${items[cur_usernum].binary.data.data}) ${cur_user}\n`;
    cur_usernum   += 1;
  }
  if (item.json.TaskTitle != cur_task) {
    md_reportbody += (cur_tasktotal) ? `\n*${cur_tasktotal.toFixed(2)} - Total hours for this task*\n` : "";
    cur_task = item.json.TaskTitle;
    md_reportbody += `\n###${cur_task}\n${tablehead}`;
    cur_tasktotal = 0;
  }
  md_reportbody += `| ${item.json.date.split('T',1)} | ${item.json.hours.toFixed(2)} | ${item.json.note} |\n`;
  cur_tasktotal += item.json.hours;
}
md_reportbody += (cur_tasktotal) ? `\n*${cur_tasktotal.toFixed(2)} - Total hours for this task*\n` : "";
md_reportbody += `\n*Timesheet report generated on: ${$now.toISODate()}*`;
return [{mdreport: md_reportbody}];

Automate timesheet reports with n8n and HTTP Request

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes, replacing the Manual Trigger node with a CRON Trigger node allows automatic scheduled report runs.
Yes, to add more users, simply update the timesheet records in the GetTimesheetRecords node or connect to an external database.
No, the Send Email node is optional and can be disabled if only report generation is needed.
Check and fix avatar URLs in the GetImg node output. Ensure the URLs are correct and accessible.
Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.