I opened up a workflow which has been running just fine for some time, and unexpectedly saw a pretty serious looking defect in it.
The first block in this workflow (which I'll refer to as WorkflowA for clarity) is a call to another workflow (WorkflowB), and that call is supposed to reference some specific IDs and settings - we place those values in the startTrigger of WorkflowA and reference them using the {{ startTrigger.data.param_name }}
pattern in the block calling WorkflowB.
But, where I expected to see those {{ startTrigger... }}
lines, the editor was showing the example JSON params for the WorkflowB, here's a screenshot of what that looked like when I first open WorkflowA in the editor:
Thinking maybe someone had accidentally clicked the "reset to example JSON" button while viewing this workflow, I used the Deploy history tab to view the most recently deployed version, and was even more alarmed when it showed a slightly different layout, implying the past version had loaded, but it still showed the incorrect parameters, as shown here:
Knowing that I had deployed the most recent version, and that even if I had deployed it with that mistake in it, I would have quickly found out about my mistake due to the errors it would cause, I checked the run history... and found that the correct values were being used. The editor was supposed to be showing me the same code as was used in the run, but the params shown in the logs didn't match what was shown on screen, as you can see at the bottom of my screenshot
When I used the Deploy history to select an even earlier version, the editor updated to show the correct {{ startTrigger...
expressions for the call to WorkflowB, then I selected the deployed version again, and the correct parameters persisted:
Those two screenshots are supposed to be of the same version, but they show different things, that's a pretty severe defect
I refreshed the page a few times, and on a fresh page load the editor consistently showed the example JSON params for that block. Wanting to ensure those incorrect params never got accidentally deployed, I entered the correct params in again, and tried to deploy the change, which resulted in an internal server error. I neglected to capture a screenshot of that error message or the network request, and when I reloaded the page once more, updated the params again (as they had reset to the example JSON again after the refresh), the deploy went through successfully.
My working theory is that when I first opened WorkflowA, there was likely some error while loading the settings for that get_audience
block, and instead of reporting the error, the editor just fell back to the example JSON. And when I selected the deployed version in Deploy history, the editor again failed to load the settings for get_audience
and left the example JSON in place. But when I loaded the earlier version, it successfully loaded the correct params, and when I swapped back to the deployed version those remained on screen.
If that theory is correct, or close to it, then I see two core defects which should be addressed:
-
If something goes wrong while loading the parameters for a workflow block, falling back to the example JSON is NOT desirable behavior, it's in fact very very risky. I'd much rather see an empty list of parameters or an error message so I know something has gone wrong.
Had I not noticed and deployed an update with those example params included, it could have resulted in pretty severe issues for my business. I'd rather lose the "Reset to Example JSON" functionality entirely than ever risk it happening accidentally, and it should absolutely never happen without user input. -
When loading a past version of a workflow through the Deploy history menu, it should not be possible to "partially load" a past version, as must be happening in order for me to see different things on screen when I navigate directly to the deployed version vs. when I first load an earlier version then load the deployed version - if any part of the previous version can't be loaded correctly, I'd MUCH prefer an error message telling me so over a seeing a partially accurate representation of that version.
Currently I don't believe this has caused any actual problems in my system. The correct code is running. But if I had been making a hasty update to this workflow, or if a new person on my team were tasked with updating it and didn't have enough context to notice the incorrect parameters, it could've been pretty bad.