Bug fixes batch (#18457)

Fixes https://github.com/twentyhq/twenty/issues/18181

Fixes https://github.com/twentyhq/twenty/issues/16842
Iterators remain running, which prevent the stopping state to eventually
become stopped

Fixes https://github.com/twentyhq/twenty/issues/18186
This commit is contained in:
Thomas Trompette
2026-03-06 14:20:54 +01:00
committed by GitHub
parent f65aafe96b
commit 1f1da901ea
4 changed files with 62 additions and 15 deletions
@@ -0,0 +1,32 @@
import {
StepStatus,
type WorkflowRunStepInfo,
type WorkflowRunStepInfos,
} from 'twenty-shared/workflow';
import { isWorkflowIteratorAction } from 'src/modules/workflow/workflow-executor/workflow-actions/iterator/guards/is-workflow-iterator-action.guard';
import { type WorkflowAction } from 'src/modules/workflow/workflow-executor/workflow-actions/types/workflow-action.type';
export const setAllIteratorsStepInfosAsStopped = ({
stepInfos,
steps,
}: {
stepInfos: WorkflowRunStepInfos;
steps: WorkflowAction[];
}): Record<string, WorkflowRunStepInfo> => {
const stoppedStepInfos: Record<string, WorkflowRunStepInfo> = {};
for (const step of steps) {
if (
stepInfos[step.id]?.status === StepStatus.RUNNING &&
isWorkflowIteratorAction(step)
) {
stoppedStepInfos[step.id] = {
...stepInfos[step.id],
status: StepStatus.STOPPED,
};
}
}
return stoppedStepInfos;
};