Describe the issue/error/question
Maybe this could be considered a feature request ?
In a code node is it possible to extract / display uuid and name of the current N8N user running the workflow without having to look into the n8n postgres/sqllite DB?
I’ve also looked at the json source of my workflow and there’s no uuid of the creator stored in the json source.
Ideally it’s for when errors occur and my error workflow gets triggered, I can see the workflow name and execution ID, but it’d be nice to have the user id if possible.
What is the error message (if any)?
Information on your n8n setup
n8n version: 0.220.0
Database you’re using (default: SQLite): PostgresDb
- Running n8n with the execution process [own(default), main]:
Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker
Hi @0101binary0101, this would indeed be a feature request, n8n does not have an expression to reference the current user (which might not exist if a workflow isn’t executed manually). I shall convert your question accordingly.
On a side note: I am not sure how much you like the idea of tinkering and what your exact use case is, but on my private instance I am handling authentication completely outside of n8n (through this approach). This also means there are headers that can be attached to all HTTP requests going to n8n including the current username (if applicable, you can of course disable authentication for some routes). You can read this in n8n when using the Webhook node for example:
So, depending on what you’re doing this might work for you too.
I mostly like the additional logging I get from that, which tells me which user has used n8n when, and which workflows/credentials they might have updated (all through the HTTP access logs).
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.