Salesforce "No output data returned" despite successful SOQL query in Developer Console

Hello n8n Community,

I’m encountering a persistent issue with my n8n workflow involving the Salesforce node, and I’m hoping someone can shed some light on it.

Problem: My “Salesforce1” node consistently returns “No output data returned” when using a dynamic expression for the SOQL WHERE clause, even though the exact same query, with the exact same ID, yields a successful result in the Salesforce Developer Console. When I hardcode the ID directly into the Salesforce node’s query in n8n, it works perfectly.

Workflow Setup:

  1. Webhook1 Node: Receives an incoming webhook with a CVSubmissionID in the body.
  • Example CVSubmissionID from webhook input: a0PWU000002H53l2AC
  1. Salesforce1 Node: Configured to “Search” and “Query” the ContentDocumentLink object.
  • SOQL Query: SQLSELECT ContentDocumentId, ContentDocument.LatestPublishedVersionId, ContentDocument.Title FROM ContentDocumentLink WHERE LinkedEntityId = '{{ $json.body.CVSubmissionID }}'
  • The alwaysOutputData setting on this node is currently false.

Observation / What I’ve Tried:

  • Salesforce Developer Console Test: I copied the CVSubmissionID from the Webhook1 input (e.g., a0PWU000002H53l2AC) and ran the SOQL query directly in the Salesforce Developer Console: SQLSELECT Id, ContentDocumentId, ContentDocument.LatestPublishedVersionId, ContentDocument.Title, LinkedEntityId FROM ContentDocumentLink WHERE LinkedEntityId = 'a0PWU000002H53l2AC' This query successfully returns 1 record in the Developer Console, confirming that the record exists and is accessible via this query and ID.
  • Hardcoding in n8n: If I replace {{ $json.body.CVSubmissionID }} with the hardcoded ID (a0PWU000002H53l2AC) directly in the n8n Salesforce node’s query field, the node executes successfully and returns the expected data.
  • Dynamic Expression Failure: When using {{ $json.body.CVSubmissionID }}, the Salesforce node outputs “No output data returned.”
  • Input Data Validation: I have verified the input to the Salesforce1 node in n8n (via the “INPUT” tab in the execution view) and the body.CVSubmissionID is present and appears correct.

My Question: Given that the SOQL query works fine with a hardcoded ID in n8n and also directly in the Salesforce Developer Console, what could be preventing the dynamic expression {{ $json.body.CVSubmissionID }} from correctly passing the value or being interpreted correctly by the Salesforce node? Is there a known issue with expression handling for WHERE clauses in the Salesforce node, or something I’m missing regarding data types or timing when using dynamic values from a preceding node?

Any insights or suggestions for further debugging would be greatly appreciated!

Thank you!

I’m using the cloud version and the latest stable release.


If hardcoding works but the dynamic variable doesn’t, add a Code node right before Salesforce to double-check your data is coming through properly,like"webhook1-code-Salesforce1"

Thanks for your reply. Now the code is catching the id, which is fine, but the problem is still the same with the query node. Hard coded fine, dynamic not.

The strange part is, its working fine in test mode.

UPDATE: The problem was in the salesforce side. I have a screen flow, where the user can upload a file to a custom object record (CV Submission) which will be created before the update action.
I added an extra checkbox, “Executed” on the CV Submission record and the record triggered flow, which is sending the the ID-s to N8N - will be triggered with this checkbox. Now it works.

1 Like

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