If you want an n8n flow to run when you change thing in Salesforce or when you start an screenflow in Salesforce and pass the information to other applications the HTTP callout is the right way to do it.
I recently shared a tip connecting Salesforce and n8n with outbound message: Outbound message Salesforce and n8n - Tips & Tricks - n8n
Now I would like to share an improved connection between n8n and Salesforce with the new HTTP Callout in SF. This connection is more secure and modern way to connect n8n with SF.
It takes some time to set up correctly but i think the following steps will help you get there.
The JSON input for the flow is standard {“message”:“Workflow was started”} but it depends what you want send back to Salesforce. The value the n8n flow gives back to Salesforce you will have to define in the flow.
Tip: HTTP Callouts can only run as Asynchronously in Salesforce
Hey! Exciting post. I would appreciate a more detailed walkthrough of this, including on the n8n side. I’m having a hard time seeing an example workflow with this solution. I would appreciate a bit more on the salesforce side too in terms of the flow action set up.
Thanks very much for sharing here in the community. It took a longtail search to surface your Salesforce posts.
There is a webhook node that receives the Salesforce HTTPS Callout. I only send the SF ID to n8n and use the SF nodes to gather the rest of the information.
In n8n you have to add the Webhook and make a new header credential like this, just generate a password. NB: there is a maximum lenght of the token that SF can handle make it long but not too long.
I only send the SF ID to n8n and use the SF nodes to gather the rest of the information.
It sounds like an overkill. I have always been using Outbound messages where you can already provide n8n with all the data you need to process further. Can that be done with HTTP Callout too?
Also, it sounds like while Outbound messages would be used when SFDC passes the data over to external services whereas HTTP callout serves the opposite purpose - SFDC initiates a request to get the data from an external service. Did I get it right?
Hi @timautomation, I know it has been some time. I wanted to thank you as I was able to get this working. I used basic auth instead of the header auth and set the Generate Authorization Header option to true in the named credential callout options.