diff --git a/frontend/ee b/frontend/ee index 5ab476909c..9cfaf2261b 160000 --- a/frontend/ee +++ b/frontend/ee @@ -1 +1 @@ -Subproject commit 5ab476909c9859a4a029185c2c8b922ca6ea0d23 +Subproject commit 9cfaf2261b1801eea1c78beb2c2a9508a39638ff diff --git a/frontend/src/_services/workflow_executions.service.js b/frontend/src/_services/workflow_executions.service.js index 7d39e9b835..ecaa810733 100644 --- a/frontend/src/_services/workflow_executions.service.js +++ b/frontend/src/_services/workflow_executions.service.js @@ -14,9 +14,9 @@ export const workflowExecutionsService = { streamSSE, }; -function previewQueryNode(queryId, appVersionId, nodeId) { +function previewQueryNode(queryId, appVersionId, nodeId, state = {}) { const currentSession = authenticationService.currentSessionValue; - const body = { appVersionId, userId: currentSession.current_user?.id, queryId, nodeId }; + const body = { appVersionId, userId: currentSession.current_user?.id, queryId, nodeId, state }; const requestOptions = { method: 'POST', headers: authHeader(), body: JSON.stringify(body), credentials: 'include' }; return fetch(`${config.apiUrl}/workflow_executions/previewQueryNode`, requestOptions).then(handleResponse); } diff --git a/server/ee b/server/ee index 15013b41ac..5ce75fab06 160000 --- a/server/ee +++ b/server/ee @@ -1 +1 @@ -Subproject commit 15013b41acee6f951195a7ba37031c38f4c297af +Subproject commit 5ce75fab06b309f2e02c9c30f4ceee222113affb diff --git a/server/src/dto/preview-workflow-node.dto.ts b/server/src/dto/preview-workflow-node.dto.ts index 0268f9652c..63c367fba0 100644 --- a/server/src/dto/preview-workflow-node.dto.ts +++ b/server/src/dto/preview-workflow-node.dto.ts @@ -1,4 +1,4 @@ -import { IsString, IsNotEmpty, IsOptional } from 'class-validator'; +import { IsString, IsNotEmpty, IsOptional, IsObject } from 'class-validator'; export class PreviewWorkflowNodeDto { @IsString() @@ -20,4 +20,8 @@ export class PreviewWorkflowNodeDto { @IsString() @IsOptional() appEnvId?: string; + + @IsObject() + @IsOptional() + state?: Record; } diff --git a/server/src/modules/data-queries/repository.ts b/server/src/modules/data-queries/repository.ts index 8caf25ed1f..dc72577126 100644 --- a/server/src/modules/data-queries/repository.ts +++ b/server/src/modules/data-queries/repository.ts @@ -95,7 +95,7 @@ export class DataQueryRepository extends Repository { findOptions: FindOptionsWhere, relations?: string[], manager?: EntityManager - ): Promise { + ): Promise { return dbTransactionWrap(async (manager: EntityManager) => { return manager.find(DataQuery, { where: { ...(findOptions ? findOptions : {}) }, diff --git a/server/src/modules/workflows/interfaces/IWorkflowExecutionsService.ts b/server/src/modules/workflows/interfaces/IWorkflowExecutionsService.ts index 7eeb057902..eac01abd58 100644 --- a/server/src/modules/workflows/interfaces/IWorkflowExecutionsService.ts +++ b/server/src/modules/workflows/interfaces/IWorkflowExecutionsService.ts @@ -6,7 +6,16 @@ export interface IWorkflowExecutionsService { execute(workflowExecution: WorkflowExecution, params: any, envId: string, response: Response): Promise; - getStatus(id: string): Promise<{ logs: string[]; status: boolean; nodes: any[] }>; + getStatus(id: string): Promise<{ + logs: unknown; + status: boolean; + nodes: Array<{ + id: string; + idOnDefinition: string; + executed: boolean; + result: unknown; + }>; + }>; getWorkflowExecution(id: string): Promise; diff --git a/server/src/modules/workflows/services/workflow-executions.service.ts b/server/src/modules/workflows/services/workflow-executions.service.ts index b63056816d..7abf8e42c3 100644 --- a/server/src/modules/workflows/services/workflow-executions.service.ts +++ b/server/src/modules/workflows/services/workflow-executions.service.ts @@ -18,7 +18,16 @@ export class WorkflowExecutionsService implements IWorkflowExecutionsService { throw new Error('Method not implemented.'); } - async getStatus(workflowExecutionId: string): Promise<{ logs: string[]; status: boolean; nodes: any[] }> { + async getStatus(workflowExecutionId: string): Promise<{ + logs: unknown; + status: boolean; + nodes: Array<{ + id: string; + idOnDefinition: string; + executed: boolean; + result: unknown; + }>; + }> { throw new Error('Method not implemented.'); }