diff --git a/src/modules/sync/sync/workflows.ts b/src/modules/sync/sync/workflows.ts index 4c8f02bc..80e209e2 100644 --- a/src/modules/sync/sync/workflows.ts +++ b/src/modules/sync/sync/workflows.ts @@ -21,14 +21,16 @@ export const syncWorkflows = async ( logInfo(logOptions, "standard", "Updating workflows"); await serially( - [...operations.updated.keys()].map(codename => () => - modifyWorkflow( + [...operations.updated.entries()].filter(([, arr]) => arr.length).map(([key]) => key).map(codename => () => { + const sourceWorkflow = operations.sourceWorkflows.find(w => w.codename === codename) + ?? throwError(`Workflow { codename: ${codename} } not found.`); + + return modifyWorkflow( client, codename, - operations.sourceWorkflows.find(w => w.codename === codename) - ?? throwError(`Workflow { codename: ${codename} } not found.`), - ) - ), + sourceWorkflow, + ); + }), ); } else { logInfo(logOptions, "standard", "No workflows to update");