List workflows with usernames

Dear n8n Community :wave:,

Happy new year to all of you.

I’m currently administrating one 70+ users n8n instance with over 100+ workflows created.
We have setup some monitoring and we are really happy with it.
But I came across some issue in finding out who created and use the workflows in case of n8n crashes.

So I’ve created the following query which allows me to help finding out who I could contact in case of high CPU/RAM usage during an execution:

select we.id, we."name" as workflow_name, "mode", u.email, u."firstName", u."lastName"  
from workflow_entity we
left join execution_entity ee on we.id = cast(ee."workflowId" as INT)
left join shared_workflow sw on sw."workflowId" = we.id 
left join public.user u on u.id = sw."userId" 
group by we."name", "mode", we.id, u.email, u."lastName", u."firstName" 
order by we.id asc

This is a simple sql query which is returned during a webhook workflow.

Hope this will help.

Information on your n8n setup

  • n8n version: 0.209.4
  • Database you’re using (default: SQLite): Postgresql
  • Running n8n with the execution process [own(default), main]: Own
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: On-prem Cloud
4 Likes