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:
- Webhook1 Node: Receives an incoming webhook with a
CVSubmissionID
in thebody
.
- Example
CVSubmissionID
from webhook input:a0PWU000002H53l2AC
- 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 currentlyfalse
.
Observation / What I’ve Tried:
- Salesforce Developer Console Test: I copied the
CVSubmissionID
from theWebhook1
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 thebody.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.