Describe the problem/error/question
Hello,
I’m trying to do get all data from a specific object of Salesforce but I’m facing limitations/issues :
- The native Salesforce node does not have the object I’m looking for on the drop-down list (It’s a Standard Object).
- I tried to use the HTTP Request node and despite I’m able to get the first batch of records, I’m not able to configure the pagination as it does not seems to work.
What is the error message (if any)?
There’s no error message but the node loops without ending.
Please share your workflow
There’s my pagination configuration of the HTTP Request node :
Share the output returned by the last node
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:
Thanks for your help.
Use SOQL and return all.
If object is to big have n8n mark a box or change a field in salesforce to trigger a flow. Then have the salesforce flow do all the heavy lifting like pulling all object records and putting in to a json payload using apex classes and serializer. Then send to n8n webhook. This will require a named credential and external credential and permission set. Stay away from http outcall node (you have been warned)
Thanks @niche_slanger_00 for your feedback.
I don’t think that it is the issue because in the meantime, I’ve build manually the loop and it works :
Salesforce have a limit of 2000 records per batch and provide the URL for the next batch of records on the result. The result also return a boolean to check if all pages were processed.
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_query.htm
So I really think that there’s an issue with the pagination option on the HTTP Request node.
What object are you wanting to get records from?
How many records do you want to get?
What is the desired outcome?
A simple Standard Object not available on the native node (Let’s say Contact for the example).
<20k
Get all records with 2 or 3 fields to compare with another source of data.
Do you see in “Next URL” you have https://…..
even when “the force” returns no next urls because done = true, you will have a url in the next url. You need to use a expression like this:
{{ $response.body.nextRecordsUrl ? https://YOUR_INSTANCE.my.salesforce.com${$response.body.nextRecordsUrl} : ‘’ }}
Does not seems to work, n8n says “invalid syntax”.
Toss it in ai and try a few different options until you get it right, but that is the premise of how to fix it. You need to say if there’s no next URL don’t show any URL.