Merge pull request #1141 from automatisch/fix-dynamic-data
fix: skip prior execution steps if no prior execution
This commit is contained in:
@@ -44,9 +44,12 @@ const getDynamicData = async (
|
||||
$.step.parameters[parameterKey] = parameterValue;
|
||||
}
|
||||
|
||||
const priorExecutionSteps = await ExecutionStep.query().where({
|
||||
execution_id: (await flow.$relatedQuery('lastExecution')).id,
|
||||
});
|
||||
const lastExecution = await flow.$relatedQuery('lastExecution');
|
||||
const lastExecutionId = lastExecution?.id;
|
||||
|
||||
const priorExecutionSteps = lastExecutionId ? await ExecutionStep.query().where({
|
||||
execution_id: lastExecutionId,
|
||||
}) : [];
|
||||
|
||||
// compute variables in parameters
|
||||
const computedParameters = computeParameters($.step.parameters, priorExecutionSteps);
|
||||
|
Reference in New Issue
Block a user