The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Provide executed step output instead of result (#16991)
Thomas Trompette6410157c5cf1
diff --git a/packages/twenty-server/src/modules/workflow/workflow-executor/workspace-services/workflow-executor.workspace-service.ts b/packages/twenty-server/src/modules/workflow/workflow-executor/workspace-services/workflow-executor.workspace-service.tsindex 6d5bd9087ea..d3066e6eb71 100644--- a/packages/twenty-server/src/modules/workflow/workflow-executor/workspace-services/workflow-executor.workspace-service.ts+++ b/packages/twenty-server/src/modules/workflow/workflow-executor/workspace-services/workflow-executor.workspace-service.ts@@ -171,7 +171,7 @@ export class WorkflowExecutorWorkspaceService {const nextStepIdsToExecute = await this.getNextStepIdsToExecute({executedStep: stepToExecute,- executedStepResult: actionOutput,+ executedStepOutput: actionOutput,});if (isDefined(nextStepIdsToExecute) && nextStepIdsToExecute.length > 0) {@@ -187,15 +187,15 @@ export class WorkflowExecutorWorkspaceService {async getNextStepIdsToExecute({executedStep,- executedStepResult,+ executedStepOutput,}: {executedStep: WorkflowAction;- executedStepResult: WorkflowActionOutput;+ executedStepOutput: WorkflowActionOutput;}): Promise<string[] | undefined> {const isIteratorStep = isWorkflowIteratorAction(executedStep);if (isIteratorStep) {- const iteratorStepResult = executedStepResult.result as+ const iteratorStepResult = executedStepOutput.result as| WorkflowIteratorResult| undefined;@@ -207,7 +207,7 @@ export class WorkflowExecutorWorkspaceService {}if (isWorkflowIfElseAction(executedStep)) {- const ifElseResult = executedStepResult.result as+ const ifElseResult = executedStepOutput.result as| WorkflowIfElseResult| undefined;diff --git a/packages/twenty-server/src/modules/workflow/workflow-runner/jobs/run-workflow.job.ts b/packages/twenty-server/src/modules/workflow/workflow-runner/jobs/run-workflow.job.tsindex 7217b1c7d77..9d52ed8e713 100644--- a/packages/twenty-server/src/modules/workflow/workflow-runner/jobs/run-workflow.job.ts+++ b/packages/twenty-server/src/modules/workflow/workflow-runner/jobs/run-workflow.job.ts@@ -142,13 +142,13 @@ export class RunWorkflowJob {);}- const lastExecutedStepResult =- workflowRun.state?.stepInfos[lastExecutedStepId]?.result;+ const lastExecutedStepOutput =+ workflowRun.state?.stepInfos[lastExecutedStepId];const nextStepIdsToExecute =await this.workflowExecutorWorkspaceService.getNextStepIdsToExecute({executedStep: lastExecutedStep,- executedStepResult: lastExecutedStepResult,+ executedStepOutput: lastExecutedStepOutput,});if (!isDefined(nextStepIdsToExecute) || nextStepIdsToExecute.length === 0) {