Access saved credentials from "expressions"

Is there a way to access a saved API key and token via expressions, in the same way that we can access values from other nodes with $node()?

Use case: I want to send a POST to a Trello API that would add an attachment to a card. It uses query params for key and token, which are already saved in the Trello API credentials I have set up. Is there a simple way to access those for situations like this? There are so many endpoints in APIs that it would be unrealistic to have them all within n8n, so this is a workaround idea Iā€™m playing with.

@wilsongoode as far as I know this is yet not possible. I see how that can be handy for some use cases.

Is there a workaround for this? I want to use postgres credentials in a function node. Trying to avoid creating my own node for now.

No there is sadly no good workaround. The only thing you can do is to store the credentials in the workflow or reference them from somewhere else for example an environment variable. But no matter what the credentials would then either be saved clear text in the workflow or in the past-executions (at least if you save them).

1 Like

Oh okay, thanks for the quick reply. I guess creating my own node would be the solution then!