I a http request node, I use a Google service account API credential type.
I need the “Impersonate a User” field to be dynamic, pulling data from the “email” field in the previous node.
What is the error message (if any)?
The request fails each time (401) because of this.
It seems impossible to access the previous node from this field, while the data is here. Even the interface displays an error message (see screens):
I tried to reproduce the same request by using a raw email in the field and it works.
I also tried to use the complete syntax with the node name in case it would have been a confusion with $json:
As I understand it, service connections don’t “exist” within your workflow, they are global. So it may be able to “glitch” seem like it can access the data from nodes sometimes, but I don’t think this is officially possible or designed to handle this.
I was going to suggest global variables as self hosted, but those are read-only.
You might be able to use this API mid-run:
Or maybe something like this, but still might not work since I am not sure how connections would handle workflow data itself.
You may be able to edit the credential via API live, but doesn’t seem like there is an endpoint to edit, only create or grab. Maybe you can check if they enabled PATCH or PUT by accident, (try patch instead of post to create new, if enabled it should only update the existing record)
Thank you a lot for your answer. Actually, now I’ve a bit of history with this workflow, it works as I set it, even if n8n returns an error
So I guess I’ll let it like this and ignore errors.
Otherwise I guess the best solution would be to use variables and modify them for each request.