In n8n, while it’s not possible to directly use credentials as variables in the Code node, there’s a simple workaround.
You can store encrypted credentials in a SQL database, retrieve them using the SQL node, and then decrypt them in the Code node. This method ensures your credentials remain secure while still being usable in your workflow.