Workflow requires disconnected Javascript code block to return data back to the application

I currently have a workflow that takes in the following data from a retool application:

  • Selection 1
  • Selection 2
  • Start Date
  • End Date
  • Number
  • Selection 3

With these inputs it proceeds to do 5 Queries to a PostGreSQL database, some processing and data transformation and visual generation using Plotly. The final block of the workflow is a response block returning a some outputs from the processing blocks.


The main issue is that when I try to run the Workflow in a Query on the retool App. As soon as I click run, it takes 0.3s to say it has concluded with no errors, but nothing is returned.


(NOTE: When I check the run status on the Workflow page everything looks as it's supposed to, INCLUDING the response block output)

The only solution that I found was to add a random javascript code block to the workflow. I don't connect it to anything, just mark it as error handler and suddenly everything works as it should back in the application:


Why would this be happening?

Do you have any logging you can compare with and without the random JS block? Aside from the standard logging, maybe add some console.log() or print() statements in your critical steps to see what variables are not getting passed with and without the random JS block?

Definitely seems odd. Other items to check would be making sure you are executing against the right environment (if you have multiple set up) and that you deployed the workflow. I can’t tell you how many times I was convinced a workflow wasn’t recognizing my code only to realize I was just running an old version…

Thank you for the comment!

The weird thing about is that when I check the run logs, the data outputs of each block is exactly the same, including for the response block.

Even though the app says the workflow took 0.3s to run, I can see that in the logs it actually takes4 seconds (which is what I expect). It tells me it successfully ran without it even finishing.

With the Javascript empty block:
image

Without:
image

Can you send the logs from the workflow?

Absolutely, here they are:

Hi @Diogo_Mota,

Thanks for sharing this. Could I get an JSON export of your application?

Hi Abbey,

Of course, would it be possible to send it to an email rather than publicly send it in the forum?

You can send it in a DM by clicking my username and the the button that says Message.

Thank you, sent it over by DM.

Hi @Diogo_Mota We've reported this bug to our team & will reach out when we get an update

1 Like

The fix shipped :grinning: let us know if you're still seeing any issues