Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MarcL
Copy link
Contributor

@MarcL MarcL commented Dec 17, 2025

Summary

Adds two new log streaming events for audit logging:

  • n8n.audit.user.execution.deleted: Emitted when user deletes executions
  • n8n.audit.user.workflow.executed: Emitted when user manually runs or retries a workflow

Both events include user context for audit tracking.

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/PAY-2936

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

…low execution (PAY-2936)

- Add 'execution-deleted' event when user deletes executions
- Add 'workflow-executed' event when user manually runs or retries workflow
- Emit events with user context for audit logging
- Add comprehensive unit tests for both events
@MarcL MarcL changed the title feat(core): Add log streaming events for executions (PAY-2936) feat(core): Add log streaming events for executions Dec 17, 2025
@MarcL MarcL marked this pull request as ready for review December 17, 2025 17:38
@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

❌ Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/cli/src/workflows/workflows.controller.ts 25.00% 3 Missing ⚠️
packages/cli/src/executions/execution.service.ts 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Dec 17, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 8 files

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/cli/src/executions/execution.service.ts">

<violation number="1" location="packages/cli/src/executions/execution.service.ts:335">
P2: Audit event may log empty `executionIds` when deletions occur via `deleteBefore` filter. Consider either returning deleted IDs from the repository or including `deleteBefore` in the event payload to provide a complete audit trail.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@currents-bot
Copy link

currents-bot bot commented Dec 17, 2025

E2E Tests: n8n tests passed after 8m 46.9s

🟢 590 · 🔴 0 · ⚪️ 27 · 🟣 2

View Run Details

Run Details

  • Project: n8n

  • Groups: 2

  • Framework: Playwright

  • Run Status: Passed

  • Commit: 7f78487

  • Spec files: 131

  • Overall tests: 617

  • Duration: 8m 46.9s

  • Parallelization: 9

Groups

GroupId Results Spec Files Progress
multi-main:ui 🟢 533 · 🔴 0 · ⚪️ 27 · 🟣 2 122 / 122
multi-main:ui:isolated 🟢 57 · 🔴 0 · ⚪️ 0 9 / 9


This message was posted automatically by currents.dev | Integration Settings

@blacksmith-sh

This comment has been minimized.

…lete audit trail

When executions are deleted via date filter (deleteBefore), the executionIds
array would be empty. Including deleteBefore in the event payload provides
a complete audit trail showing what criteria was used for bulk deletion.
…ot set

Only include deleteBefore in the payload when it has a value,
rather than including deleteBefore: undefined.
Organize the workflow-executed event listener and handler alongside
other workflow events for better code organization.
@MarcL MarcL requested review from a team and ireneea and removed request for a team December 18, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants