Skip to content

Conversation

@dariacodes
Copy link
Contributor

Summary

  • activate workflow now sets active version id to the current active version in case of errors during activation and populates the active version for return data
  • get workflow endpoint now populates active version for return data

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/ADO-4459/feature-be-workflow-endpoints-follow-up

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)

@dariacodes dariacodes marked this pull request as ready for review November 24, 2025 16:28
@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/cli/src/workflows/workflow.service.ts 66.66% 2 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 Nov 24, 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 3 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="packages/cli/src/workflows/workflow.service.ts">

<violation number="1" location="packages/cli/src/workflows/workflow.service.ts:490">
Activation failures now emit a `workflow-deactivated` event even when the workflow stays active, because the rollback payload can set `active` back to true. Condition the event emission on the rollback state so listeners aren’t told the workflow deactivated when it didn’t.</violation>
</file>

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

workflow.active = false;
workflow.activeVersionId = null;
workflow.activeVersion = null;
workflow.active = rollbackPayload.active;
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 24, 2025

Choose a reason for hiding this comment

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

Activation failures now emit a workflow-deactivated event even when the workflow stays active, because the rollback payload can set active back to true. Condition the event emission on the rollback state so listeners aren’t told the workflow deactivated when it didn’t.

Prompt for AI agents
Address the following comment on packages/cli/src/workflows/workflow.service.ts at line 490:

<comment>Activation failures now emit a `workflow-deactivated` event even when the workflow stays active, because the rollback payload can set `active` back to true. Condition the event emission on the rollback state so listeners aren’t told the workflow deactivated when it didn’t.</comment>

<file context>
@@ -457,37 +471,25 @@ export class WorkflowService {
-			workflow.active = false;
-			workflow.activeVersionId = null;
-			workflow.activeVersion = null;
+			workflow.active = rollbackPayload.active;
+			workflow.activeVersionId = rollbackPayload.activeVersionId;
+			workflow.activeVersion = rollbackPayload.activeVersion;
</file context>

✅ Addressed in 836dfe8

@currents-bot
Copy link

currents-bot bot commented Nov 24, 2025

E2E Tests: n8n tests passed after 11m 5.6s

🟢 588 · 🔴 0 · ⚪️ 12 · 🟣 5

View Run Details

Run Details

  • Project: n8n

  • Groups: 2

  • Framework: Playwright

  • Run Status: Passed

  • Commit: 836dfe8

  • Spec files: 96

  • Overall tests: 600

  • Duration: 11m 5.6s

  • Parallelization: 9

Groups

GroupId Results Spec Files Progress
ui 🟢 539 · 🔴 0 · ⚪️ 12 · 🟣 4 90 / 90
ui:isolated 🟢 49 · 🔴 0 · ⚪️ 0 · 🟣 1 6 / 6


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

@blacksmith-sh

This comment has been minimized.

@dariacodes dariacodes requested a review from scdekov November 24, 2025 17:33
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