Consolidated Report of Executions

Describe the issue/error/question

How to retrieve a list of all executions?

What is the error message (if any)?

none

Hello,
I’ve just switched to n8n from Zapier. I have to say I LOVE this product! It’s absolutely amazing, and I love that all my data is back on my servers.

One feature that Zapier had, was a weekly mailing of the Zap history for the week. Is there any way for me to get a list of all executions for the past week? I can’t seem to find a node that will do that.

Thanks,
Daniel

Here’s a start at least, would love others feedback on this process. This basically queries your n8n instance until it reaches executions older than a week ago. Unfortunately I don’t know how to combine the outputs of multiple executions within a workflow. This means you can’t just pop the entire results in an email or slack message (at this stage).

You can however drop them as rows into a Google Sheets or a DB and work from there?


As you can see I have a lot of executions within a week

Workflow JSON
2 Likes

Thank you for this. That gives me a big jump start on my workflow!

1 Like

Just a note, it might actually be more precise if you change the Sort by Start Time node to use id instead of startedAt.

Another option, depending on your deployment is querying the database directly, which could get all the results in a single execution. Something like this for postgres:

SELECT id, mode, "startedAt", "stoppedAt", "workflowId", "workflowData" FROM "execution_entity" WHERE "startedAt" > '<YOUR DATE>' ORDER BY "startedAt" ASC;

OK I have a solution! The problem before is you can’t explicitly join all executions cleanly if the function node doing the joining gets executed multiple times itself!

So in this revision instead of forking we use the false output from Need More Data? node to run a function to merge all our results from Split Results. We can then sort and format this as for example a markdown table!

Workflow JSON

And for completeness we check if we have no more results, otherwise if we don’t have executions that go back long enough we won’t get output.

Workflow JSON
3 Likes

This is amazing work!

Thank you so much, I’ll be working on implementing it for my setup.