Merged
Size
M
Change Breakdown
Bug Fix85%
Testing15%
#28310fix(core): Add projectId and projectName to log streaming events

Log streaming events now include project context

Workflow events sent to external destinations like webhooks, syslog, and Sentry now include projectId and projectName fields — fixing an oversight from a previous logging improvement.

Previously, when n8n sends workflow events to external destinations, the payload was missing project context. A prior fix added projectId and projectName to internal structured logs but overlooked the log streaming event bus that powers webhooks, syslog, and Sentry integrations.

Now, n8n.workflow.started, n8n.workflow.success, and n8n.workflow.failed events include the project fields, so external monitoring tools can correlate events with the correct n8n project. This matters for users who route logs to external aggregators — they finally get the same project visibility that internal logs already had.

In the CLI package, the project context is threaded through the execution lifecycle hooks into the event service and finally into the log streaming relay.

View Original GitHub Description

Summary

PR #27169 added projectId/projectName to structured Winston logs but missed the log streaming event bus that sends events to external destinations (webhooks, syslog, sentry). This threads projectId/projectName from the execution data through the lifecycle hooks into the LogStreamingEventRelay, so n8n.workflow.started, n8n.workflow.success, and n8n.workflow.failed events now include project context in their payloads.

Root cause: Two separate logging systems exist — structured logs (Winston) and the log streaming event bus (MessageEventBus → destinations). PR #27169 only added project fields to the former.

Fix: Thread projectId/projectName from IWorkflowExecutionDataProcess (where they already exist) through hookFunctionsWorkflowEventsEventServiceLogStreamingEventRelayMessageEventBus.

Manually verified locally with a webhook log streaming destination — projectId and projectName now appear in the event payload.

Related Linear tickets, Github issues, and Community forum posts

Follows up on https://github.com/n8n-io/n8n/pull/27169

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Tests included.
  • I have seen this code, I have run this code, and I take responsibility for this code.

🤖 Generated with Claude Code

© 2026 · via Gitpulse