Scheduled workflow: generate one CSV from a table and send it once via API

Hi everyone, I’m trying to build a scheduled workflow in Glide that runs once per day, queries my clients table, and simply generates one CSV file with all returned clients, and then sends that CSV in a single API call.​

My confusion is around whether I need a Loop at all. If I remove the Loop, the Generate CSV step seems to hit an error since there is no option to save the generated file URL :

If I keep the Loop, I can access the result more easily, but then it looks like the workflow may run per row instead of once for the whole dataset. I also tested the idea of setting the Loop limit to 1, but I’m not sure whether that is a valid workaround or just a hack that could cause issues later.

The results will be around 2k rows and for some reason im getting the same error everytime:

I am not sure if the error is in my settings or the way i set up the api call:

Thank you in advance !

I don’t think you would need a loop at all for the reasons you have lined out. It should work with just a query module and a generate CSV file module.

The Call API might have shown an error because it expects a text/plain type whilst you fed it a URL (the result of generate CSV file)?

Hi @ThinhDinh , thank you!

Im having another issue, apparently, the csv file is heavy so it takes some time for the csv file to be created, so in glide documentation thay recomend a wait step to make sure the file si created, however, in scheduled workflows, wait time step or wait for condition step are not available

Any work arunds youll recommend?

The only thing i can think about is to create a second workflow triggered when the file is created but it seems like a lot to do for such a simple task

Just saw the “from-url” path in your URL, so after all I guess it should have worked?

There’s no native wait, I don’t have a recommendation here.