fix: Sync partial execution version of FE and BE, also allow enforcing a specific version (#12840)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
Danny Martini
2025-02-03 14:17:31 +01:00
committed by GitHub
parent a65a9e631b
commit a15504329b
21 changed files with 193 additions and 62 deletions

View File

@@ -1,4 +1,4 @@
import { ImportWorkflowFromUrlDto } from '@n8n/api-types';
import { ImportWorkflowFromUrlDto, ManualRunQueryDto } from '@n8n/api-types';
import { GlobalConfig } from '@n8n/config';
// eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import
import { In, type FindOptionsRelations } from '@n8n/typeorm';
@@ -9,7 +9,6 @@ import { ApplicationError } from 'n8n-workflow';
import { v4 as uuid } from 'uuid';
import { z } from 'zod';
import config from '@/config';
import type { Project } from '@/databases/entities/project';
import { SharedWorkflow } from '@/databases/entities/shared-workflow';
import { WorkflowEntity } from '@/databases/entities/workflow-entity';
@@ -367,7 +366,11 @@ export class WorkflowsController {
@Post('/:workflowId/run')
@ProjectScope('workflow:execute')
async runManually(req: WorkflowRequest.ManualRun) {
async runManually(
req: WorkflowRequest.ManualRun,
_res: unknown,
@Query query: ManualRunQueryDto,
) {
if (!req.body.workflowData.id) {
throw new ApplicationError('You cannot execute a workflow without an ID', {
level: 'warning',
@@ -395,9 +398,7 @@ export class WorkflowsController {
req.body,
req.user,
req.headers['push-ref'],
req.query.partialExecutionVersion === '-1'
? config.getEnv('featureFlags.partialExecutionVersionDefault')
: req.query.partialExecutionVersion,
query.partialExecutionVersion,
);
}