Help with my n8n workflow (Google Sheets → PDF → Drive → Email)

Hello everyone,
I’m trying to build an automated workflow in n8n using an AI Agent, and I’m stuck on the correct approach.
Im new N8n user and a beginner, so I might choose the wrong tools and nodes.
Goal:

  • I have an existing Google Sheets timesheet that represents a 2-week (14-day) pay period.
  • The sheet format and structure must stay exactly the same.
  • Only the date cells should be updated as time moves forward (every new pay period).
    Workflow logic:
  1. AI Agent reads the existing Google Sheets timesheet.
  2. The agent identifies the current 14-day date range.
  3. It updates only the date values for the next pay period (no formatting or structure changes).
  4. After updating the sheet, the workflow should export the Google Sheet as a PDF.
  5. The PDF should be saved into a specific Google Drive folder.
  6. The same PDF should then be sent as an attachment via Gmail.
    What is working:
  • Reading rows from Google Sheets.
  • Updating specific date cells without changing the sheet structure.
  • Scheduling and AI Agent logic.
    Issue:
  • In my n8n version, the Google Drive node does not show an “Export” operation.
  • The “Download” operation does not convert Google Sheets to PDF.
  • I’m unsure of the correct or recommended way to export a Google Sheet to PDF in this case (UI node vs Custom API Call).
  • I want this to remain fully automated (no manual file selection).
    Questions:
  • What is the best practice in n8n to export a Google Sheet as a PDF when the Export option is not available?
  • Is using the Google Drive “Custom API Call” with files.export the correct approach?
  • Are there any recommended patterns for this kind of “update → export → upload → email” workflow?
    I’ve attached my workflow JSON below.
    Thanks in advance for any guidance.

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

hi,
I think your workflow doesn’t need an ai agent, just automation, it will be faster and consume less power, i will try it tomorrow, you’ll find many answers for this taking the n8n courses, I recommend it :wink:

hey, thank you for replying

yeah true, I might don’t need an ai agent to do this work but I used it to actually to be familiar with as I actually might need it one for different work.

So I would really appreciate it if you could help me with this!

thank you in advance

1 Like

hi, can you share a sample of the g sheet file please?

hey there, here I’m sharing a screenshot of it

please share the file directly (remove any sensitive data in it before you do so :wink: )

1 Like

Hi @Kerm, It is overkill to try and use an LLM to do some basic enough to just process using logic and some elbow grease. Below is an example of how you can achieve everything you asked for.

First I calculate the new dates by finding the nearest past Sunday and generating 14 dates from there. This will ensure no matter when the scheduler runes, it will be for the current week plus 14.

To download the sheet as a pdf, you can use the Download node for Google drive and selecting the additional option as pdf:

Of course the solution of Wouter is more efficient as I said before, also as he pointed you have to add an option in the download file node for pdf conversion.so applied to your workflow as you want to play with ai it will give this:

If you really don’t have the option in the download file node you will have to use an http node and enter the query manually.
Hope it helps, have a good day

Thanks a lot for sharing the workflow — I really appreciate it.

so I tested it and the workflow executIes successfully end-to-end with no errors.

However, I’m still seeing an issue with the output:

after the Update Sheet step runs, the Download / export step completes, but the file that gets downloaded/exported still contains the old dates, not the updated ones that were just written to the Google Sheet.

It looks like the export/download is happening before Google Sheets fully commits the updates, so the PDF is generated from the previous version of the sheet rather than the newly updated data, or rather it just download the exact google sheet that is saved in my google drive file.

thank you, I actually tried it with my ai agent built and I was able to see the document been download in my google drive as pdf, but it was exactly the same old document. so it wasn’t updated at all!

also to mention, when I was checking my workflow execution! it was never using the google sheet tool at all.

Did you check the sheet itself after running past the update step? On my instance it updated and reflects the latest dates for my current week.

Also just make sure you have the right timezone set under your workflow settings for the Code node working with dates are correct.

Yes, there is no update on the sheet itself.

I see it has been updated in both get and update google sheet node, but no actual changes in the actual google sheet!

But you’re pointing to two different files? You’re trying to download a file called “N8N testing”, but updating some Copy version? Make sure all the Google Sheet nodes are working with the exact same file as well as the Download node.

Yes, check the file name in the Gsheet nodes, and in the download file node as well

Because I was thinking I will get the “updated file” to be downloaded in “N8N testing” file! in drive!

I just changed it now and ran an exception but still no update has been made in the sheet except inside the nodes only

Are you referencing the same file in the download node?

Hi Wouter,

Yes, inside the workflow I can see the newly generated dates correctly (the expressions are resolving and the execution data shows the updated dates).

However, the issue is that those changes are not being written back to Google Sheets — the sheet itself does not change and no new version/update appears in Google Drive.

So it looks like the workflow generates the new values internally, but the Google Sheets update/write step is not actually applying them to the file (or it’s referencing a different file/sheet than expected).