Workflows - Erroring without explanation

First of all I appreciate that the Workflow feature is in beta.

Main problem I'm having is that my workflows seem to succeed happily when I run each step in succession but as soon as I leave it to the scheduler, the jobs fail and the logs don't tell me what happened.

This isn't just happening on one workflow but rather all of my workflows. The pattern is that they all fail when calling an external API, in this case, ServiceFusion. It's quite possible that the process of calling the external API is different when run by the scheduler rather than by the user but the issue I have with Retool is that the Logs are not doing their job.

I've tried various things like reducing the frequency of the workflow and also reducing the quantity of data it handles. I've not managed to find a clear pattern. Sometimes I will get the workflow to work consistently for hours only to log back in the next day to find it failed again. Not sure if this is some sort of authentication issue or whether it's just that the some data is throwing an error.

So yeah... please can someone offer some guidance as to how to see the actual problem. The only real error I have to go on is one that appears in the console but it's clearly a Retool thing and nothing to do with my code.

GET /api/resources/76c46546-d8b6-4381-8760-9d74ecb66fa7/schema?environment=production&action=workflows 400
Uncaught (in promise) Error: cannot fetch schema
at app.4478f322cdc0edb68fb8.js:2:2828538
at Generator.next ()
at a (app.4478f322cdc0edb68fb8.js:2:2826946)

Hi @Ross_JWHI!
Have you tried using a global error handler in your workflows? @stefancvrkotic made a good example in this thread.

I'd appreciate this as well if workflows can have this documented in the logs but if they are prioritising other features, use the workaround above.

I do have one but currently all it does is write to the console (which doesn't seem to happen) so I could beef this up a bit, thanks for the suggestion.

Logging in today I noticed this in the console, again not sure if it's related...
fs.js:4 POST /api/refreshtoken net::ERR_NETWORK_CHANGED
fs.js:4 Uncaught (in promise) TypeError: Failed to fetch

Implemented the Slack error reporting and tested it to make sure it works.

Still no error. :frowning:

This definitely looks like a bug. I’ve filed it and added a couple tickets to it already, will add this one as well. Hopefully we can get this addressed soon🤞 in the meantime, I’ll ask about any timelines we can share!

As a quick sanity check, might this be an issue of Workflows running on the server side when running automatically vs running on the client side when manually run? Does this auth work consistently when manually run vs when scheduled/automatic?

Hi Victoria,

Sadly not, I've yet to establish any reliable way of replicating the issue, it's intermittent.

I can't be sure without actually seeing the error message but I'm all but convinced the error is actually not in Retool at all and it's actually the third party API refusing or timing out and Retool is not handling the error properly / visibly

Understood. Well do let us know if anything changes from from the Retool side!

Am following along with this thread closely.

I am also having a similar issue where when scheduled, the workflow is failing but when individually running the components in order it works completely fine with no issues.

Some context to the workflow if it helps:

  • Similar to @Ross_JWHI Ross, am pulling from an API. Happens once a day and grabs transactions that occurred the day before and writes to a postgres DB
  • The error that comes up is indicating that ALL transactions are duplicating when trying to write to our DB for storage even though there are only a fraction of records trying to be written that day.
  • The fact that the workflow works when manually executing each element but fails when scheduled indicates to me that it may be out of my control
  • The workflow was working with no issues a week ago with no issues however now consistently fails each day.

Happy to offer more information if it helps the investigation.