Context
Â
n8n provides a flexible AI workflow automation solution that can interface with various LLMs. within an automation workflow, we may need to have access to credentials to obtain data from an application or web service. While n8n can store credentials in its own data store, it may be required to manage the credentials with PAM or Privileged Access Management.  This article provide step-by-step instructions on how to allow a n8n AI automation workflow to check-out credentials at runtime from Password Safe.
Â

Â
Let’s assume that we need to access a report from a web application that requires credentials for Basic authentication.
Â

Â

Â

Â

Â

Â
Note:Â You can access User Audits under Configuration/General to see a blocked requests from n8n and the source IP, that you can add to the API Registration, to allow n8n.
Â
Note:Â The Application User needs to be added to a Group with Smart Group permissions and the Requestor Password Safe role, to allow the Managed Account to be available to n8n.
Â
Configuring n8n workflow
Â
Note:Â The example workflow export is attached to this post.
Â

Â

Â

Â
Note: The Url for the SignAppIn node is https://myInstance/BeyondTrust/api/public/v3/Auth/SignAppin
and the Access Token Url is:Â Â https://myInstance/beyondtrust/api/public/v3/auth/connect/token
Â

Â

Â

Â

Â

Â

Â
At this point, we have the credentials output from GET Credentials and we are ready to invoke our test App.
Â

Â
This is the value for the http header Authorization:
Basic {{ ("user01234:" + $json.credentials).base64Encode() }}
Â
Â