# Scheduled workflow: "Generate CSV file" sometimes produces a CSV with only headers (0 rows)

**URL:** <https://community.glideapps.com/t/scheduled-workflow-generate-csv-file-sometimes-produces-a-csv-with-only-headers-0-rows/87739>\
**Category:** Ask for Help\
**Created:** [October 12, 2026, 5:51am UTC](https://community.glideapps.com/t/scheduled-workflow-generate-csv-file-sometimes-produces-a-csv-with-only-headers-0-rows/87739 "2026-10-12T05:51:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mateo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mateo/32/79814_2.png) [@Mateo](https://community.glideapps.com/u/Mateo)\
**Post date:** [October 12, 2026, 5:51am UTC](https://community.glideapps.com/t/scheduled-workflow-generate-csv-file-sometimes-produces-a-csv-with-only-headers-0-rows/87739/1 "2026-10-12T05:51:07Z")

</div>

Hi everyone,

Follow-up to my earlier thread: [Scheduled workflow: generate one CSV from a table and send it once via API](https://community.glideapps.com/t/86654). The workflow works, but it fails intermittently and I can’t find a pattern.

**Setup** (scheduled workflow, every hour):

1. Query “Clientes (activos)” → Loop → Generate CSV file → Call API (POST the file URL to my server)
2. Query “Clientes (inactivos)” → Loop → Generate CSV file 2 → Call API

**What happens**

- In 10 of the last 30 hourly runs, the **active clients** CSV came out with only the header row and no data rows (1,921 bytes). A normal one is ~943 KB, ~660 rows.
- My server rejects the empty file, so Call API returns 400 and the run is marked as failed.
- The **inactive clients** CSV (same table, ~2,500 rows, ~2.7 MB) came out fine in every one of those runs.
- I changed nothing in the app between runs that work and runs that don’t. For example, on Oct 11 (UTC-5) the 10:05, 11:06, 17:05, 18:04, 20:05 and 21:05 runs failed, and the runs in between succeeded.
- I downloaded the bad file hours later and it still had only the headers, so it isn’t a matter of reading it before Glide finished writing it.

**Questions**

1. Has anyone seen “Generate CSV file” return 0 rows intermittently in a scheduled workflow?
2. Could the query come back empty when the columns it filters on (computed columns) aren’t evaluated yet on the backend at run time?
3. Is there a way to check the row count and retry before the Call API step, given that scheduled workflows have no Wait step?

Thanks!

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [October 12, 2026, 8:38am UTC](https://community.glideapps.com/t/scheduled-workflow-generate-csv-file-sometimes-produces-a-csv-with-only-headers-0-rows/87739/2 "2026-10-12T08:38:17Z")

</div>

I would add an IF block that checks the status of the Query (empty/not empty), and then only proceed with the Generate CSV step if the Query is not empty.
