@Gouravdev , as “getHubSpotAccountDetails1” node is directly connected to the “listItems1” node, the expression could be simplified like this, {{ $json.properties.hubspot_owner_id }}. This way you will run “getHubSpotAccountDetails1” node for each item in “listItems1” node (as opposed to just the first one).
@Gouravdev , you seem to be coming from a different workflow automation platform with linear execution. n8n is particularly great due to ability to branch the workflow making it much easier to follow and debug.
I advise you not to mix different tasks - branch them as we discussed it already in your other post and merge the branches when appropriate.
Before I reply to the specific question of yours let me point out that the last node (in the last workflow) appears to use HubSpot API where you GET a specific owner by referencing him by ID. However, none of the previous nodes produce the ID to use in the last node. Your very first workflow makes more sense to me.
But what if I have other nodes before getHubSpotAccountDetails1
There could be different ways to achieve it. Here’s the one which makes it clearer and more manageable as less coding is involved.
@Gouravdev , my answer is still the same - use branching and then merge using the common attribute.
The problem with your workflow as I see it is, you have 2 related but loosely coupled tasks
Get HubSpot companies and all the users associated with them
Get Brevo users for presumably the same organizations
I do not see what would be the common attribute as each system uses own properties/values which seem to be dis-joined. From the discussions with you so far, it seems that the common attribute could be the user email address.
In your linear workflow you put “apples and pears in a one bucket” which adds no clarity to what you are doing. Again, separate HubSpot and Brevo related tasks and join them once you found a common attribute.
Assuming that email address is the common property, your workflow could look something like this.
I believe that “getHubSpotAccountDetails1” node returns the properties id and userId (not sure which one you are after) and email while “brevoUserEmails” node contains brevoUserEmails. Therefore you can merge those by matching email addresses. This way your Brevo user will obtain HubSpot owner ID.