Quick overview
This workflow lets you upload one or more PDF timesheets in n8n chat, extracts the text, uses an Azure OpenAI model to total onsite/remote/unknown hours per consultant, appends the results to a Microsoft Excel workbook and an n8n Data Table, then sends a confirmation email via Microsoft Outlook.
How it works
- Receives an n8n chat message with one or more PDF file uploads.
- Splits the uploaded files so each PDF is processed as its own item.
- Extracts plain text from each PDF.
- Sends the extracted text to an Azure OpenAI-powered agent to classify entries and return total onsite, remote, and unknown hours plus the consultant name as JSON.
- Parses the agent response into structured JSON and stops with an error if the output is not valid JSON.
- Appends one row per timesheet to a Microsoft Excel worksheet and also inserts the same values into an n8n Data Table.
- Sends a Microsoft Outlook email after all rows are saved to confirm processing is finished.
Setup
- Configure credentials for Azure OpenAI (chat model), Microsoft Excel, and Microsoft Outlook.
- In Microsoft 365 Excel, select the target workbook and worksheet and ensure it has columns named
name, onsite, remote, and unknown.
- Create or select an n8n Data Table with matching columns (
name, onsite, remote, unknown) and set it in the Data Table node.
- Update the Outlook recipient address (and optionally subject/body) in the email step.
- Use the n8n chat to upload a test PDF with a text layer (scanned PDFs require OCR first) and verify rows are written to Excel and the Data Table.