Automating Salesforce Data Fetching in n8n Without Manual User Login

Automating Salesforce Data Fetching in n8n Without Manual User Login

I am trying to integrate Salesforce with n8n to automate data fetching and storage in PostgreSQL. Here’s my scenario:

  • I have multiple database schemas, each belonging to a specific organization.
  • Each schema contains an app_config table that stores app credentials (like Salesforce credentials). Some apps may have multiple accounts (e.g., multiple Salesforce credentials per organization).
  • I want to configure n8n such that:
    1. It fetches the Salesforce credentials dynamically from the database (PostgreSQL).
    2. It uses those credentials to authenticate with Salesforce and fetch leads data.
    3. The fetched data is then inserted into the corresponding organization’s schema in PostgreSQL.

However, when configuring the Salesforce node in n8n, it prompts me to manually enter a username and password. Since this process is meant to run in the background, I want to avoid any manual input during authentication.

How can I set up n8n to authenticate with Salesforce (using something like OAuth 2.0 or JWT Bearer Flow) dynamically, without requiring username and password input, and ensure that it fetches and stores data as described?

Any guidance or examples would be greatly appreciated!


Workflow

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @kashaudhan

Welcome to the community!

You should only need to setup the credentials once and after it should always just work.
Or are you talking about Clients and their credentials?

Hi @BramKn ,
I have multiple clients & their credentials.

Hi @kashaudhan

Ok then the question makes more sense indeed.
Just to make sure, do you have a license that allows you to use n8n commercially like that?

@BramKn
I do not have as of now, but if this works I’ll get it.

The Enterprise license has a feature for external credentials, maybe this also works for something like this. I have never tried. :slight_smile:

I do also have a custom node created for it, but getting lots of questions from people not understanding how to use it so not advertising that anymore as I cannot be botherd providing support on that. :slight_smile: You should be able to find it on the forums though. :slight_smile:

@BramKn,

I’m able to automate login for Salesforce actions nodes with OAuth2 JWT but I do not see this option in Salesforce trigger nodes (only OAuth2 is available).
Is there a way to get OAuth2 JWT option for Salesforce trigger nodes?

you would need to put in a feature request or PR for that I guess.

One workaround I found to solve this problem is to create a custom scheduled trigger & the get the credentials from the db & then query required salesforce object.

Like below

Workflow

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.