Retrieve daily workflows executions from n8n API

Good day,

I’m on n8n Cloud and would like to build a workflow to retrieve all workflows executions of the day.
For example yesterday was 2023/10/25 and my last execution exported have the ID 98175

At the moment when I launch the workflow, my executions *ID are between 98175 and 103456, so my challenge is to export only workflow executions between 98175 and 103456.
Or to export only workflow executions that startedAt a specific date (ie yesterday)

So far the only solution I found is to retrieve all executions on daily basis, but with more that 100.000 executions this is clearly not effective at all

Has anyone faced a similar challenge and find a smart solution to handle this case ?

Hi @Yoann :wave:

Unfortunately at the moment, the only way you can get executions is either as you described, or one by one through their ID, I’m afraid :see_no_evil:

The only thing I could think of is getting all executions, and then filtering out anything that wasn’t in the last 24 hours from when your workflow was ran:

You could use a schedule trigger to have this run automatically, or adjust the days / hours to your liking :bowing_man:

1 Like

Thanks Grey,

Indeed I use a similar approach for now. My main point is that n8n node getAll execution takes around 10 min to load, but I’ll keep working this way

1 Like

Hi @Yoann

Why don’t you use SQL query to get execution launch on a specific date with a SQL query on n8n database ?

Hi @Kent1 ,

I doubt I have access to n8n underlaying sql database on the cloud plan :wink:

2 Likes

Ah my apologies. In selft host it’s possible but I don’t know with cloud.

An update on the situation on my n8n Cloud PRO instance:
Each time I run the proposed workflow, I got an execution error 503 after a coupe of minutes. It seems running a getAll execution push the Cloud instance in its limits :frowning:

For such reasons, being able to filter by rage of ID or date within the node would be very welcome

image

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.