Reporting Summary of Actions Taken

Hi,

Does anyone have any best practice recommendations for generating activity summary logs from flows?

In my case, I’m developing a flow comprised of a half dozen sub flows to interact with various APIs to check whether certain records exist, run if/else tests, and potentially update some API data.

Each time the flow runs, I’d like to send an email reporting some of the branches/events that occurred in the subflows.

Is there a good pattern to follow to do this in n8n?

One option that seems like it could work is to place SQL-Insert nodes at various points in the sub flows to record messages that should be included in the email, and then select/email them all out at the end of the master flow.

Does that sound like a reasonable approach? Or is there a better way?

Thanks!

One option that seems like it could work is to place SQL-Insert nodes at various points in the sub flows to record messages that should be included in the email, and then select/email them all out at the end of the master flow.

Hi @jzrts, yes this is something I have done in the past and this is something I’d generally recommend as it means you alone can control which information is inserted and how you query it. Even if n8n itself changes, this approach will keep working.

I am doing something similar actually, where I call a bunch of external services through sub-workflows, then generate standard responses in each sub-workflow depending on the outcome. This standard response is then passed back to the “main” workflow. The main workflow finally formats this response and stores it in a database for logging purposes (but you might as well send out an email at this point). I talk about this workflow here (n8n looked very different back then, but the basic idea will still work):

Alternatively, if you don’t want to prepare the data yourself you could read the n8nEventLog*.log files in your .n8n directory and try to parse and filter these as needed to see which nodes were executed in your workflow. That’s not something I suggest doing though as this isn’t exactly documented or supported functionality, so might change in the future. It would give you an overview of what has happened.

Hope this makes sense :slight_smile:

1 Like

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