# Log errors and audit events: n8n workflow template

> Started by a clock, and works across n8n data table. 12 steps: a working afternoon to understand properly.

Source: https://millionrounds.com/workflow/log-errors-and-audit-events (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Alerts and monitoring](https://millionrounds.com/workflows?category=Alerts+and+monitoring#library)

# Log errors and audit events

Started by a clock, and works across n8n data table. 12 steps: a working afternoon to understand properly.

Medium

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Flog-errors-and-audit-events)

**12 steps** Medium: a working afternoon

**0** Branches: places the flow splits

**0** Loops or waits

**1** Service it connects to

## The flow

Starts it 3 Logic 4 Service 5

The steps in the order they run, from what starts it.

- 1 **Error Trigger - Global** Error trigger *Starts it*
- 2 **Execute Workflow Trigger - Audit API** Execute Workflow trigger *Starts it*
- 3 **Schedule Trigger - Daily Purge** Schedule trigger *Starts it*
- 4 **Normalize Error Event** Code *Logic*
- 5 **Normalize Audit Event** Code *Logic*
- 6 **Build Purge Config** Code *Logic*
- 7 **Insert ErrorLog** Data Table *Service*
- 8 **Insert AuditLog** Data Table *Service*
- 9 **Delete old ErrorLog rows** Data Table *Service*
- 10 **Delete old AuditLog rows** Data Table *Service*
- 11 **Build Purge Audit Event** Code *Logic*
- 12 **Insert Purge AuditLog** Data Table *Service*

## How it's built

- **Starts on:** A clock
- **Steps:** 12
- **Size:** Medium: a working afternoon
- **Connects to:** n8n data table
- **Model:** None. This is plumbing, not judgement

## Questions

What does it need to run?

An n8n account. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Plan an afternoon. 12 steps is enough that you should read each one before running it.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 12 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Flog-errors-and-audit-events)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[n8n data table](https://millionrounds.com/workflows?service=n8n+data+table#library)

## Workflows like it

Also alerts and monitoring, with the same services where possible, closest in size first.

- [**Archive Discord audit logs to Google Sheets** 12 steps · Google Sheets, Slack](https://millionrounds.com/workflow/archive-discord-audit-logs-to-google-sheets)
- [**Monitor GitHub repo access and push events with Slack** 12 steps · Slack, n8n data table](https://millionrounds.com/workflow/monitor-github-repo-access-and-push-events-with-slack)
- [**Monitor server uptime with HTTP** 12 steps · n8n data table](https://millionrounds.com/workflow/monitor-server-uptime-with-http)
- [**Extract key earnings insights from Google News RSS** 12 steps · calls a model · Slack, n8n data table](https://millionrounds.com/workflow/extract-key-earnings-insights-from-google-news-rss)
- [**Monitor backlinks and generate SEO insights with SE Ranking** 12 steps · calls a model · Google Sheets, n8n data table](https://millionrounds.com/workflow/monitor-backlinks-and-generate-seo-insights-with-se-ranking)
- [**Triage Gmail and send high-priority alerts with Gemini** 12 steps · calls a model · Gmail, Telegram](https://millionrounds.com/workflow/triage-gmail-and-send-high-priority-alerts-with-gemini)
