diff --git a/.changeset/eleven-colts-march.md b/.changeset/eleven-colts-march.md new file mode 100644 index 000000000..519bf3f88 --- /dev/null +++ b/.changeset/eleven-colts-march.md @@ -0,0 +1,5 @@ +--- +'@openfn/deploy': patch +--- + +Error message for when workflow found in 'state' but not 'spec' during deploy diff --git a/packages/deploy/src/stateTransform.ts b/packages/deploy/src/stateTransform.ts index 1d17397b0..78dee1e15 100644 --- a/packages/deploy/src/stateTransform.ts +++ b/packages/deploy/src/stateTransform.ts @@ -216,6 +216,17 @@ export function mergeSpecIntoState( ]; } + if (!specWorkflow && !isEmpty(stateWorkflow || {})) { + console.log( + 'Workflow found in project state but not spec.', + `Spec: ${specWorkflow}`, + `State: ${stateWorkflow}` + ); + throw new Error( + 'Cannot continue: workflow from state not found in spec.' + ); + } + return [ workflowKey, {