Skip to content
Passing Variables B...
 
Notifications
Clear all

Passing Variables Between Nodes (Especially for Distant Nodes)

8 Posts
5 Users
0 Reactions
4 Views
Simon_Gur
(@simon_gur)
Posts: 3
Active Member
Topic starter
 

I'm developing a workflow that requires passing variables between nodes, particularly when they aren't directly linked. I've run into problems where certain nodes fail to execute, and when I try to access their data in a subsequent node, it either hangs or returns undefined.

What I've Attempted:

  1. Set Node: I tried saving variables using the Set Node. However, since it was outside the primary execution path, some instances of this node didn't run. Consequently, when a later node attempted to reference the variable, the data was unavailable, leading to errors.
  2. Referencing with $node["Node Name"].json["key"]: This method works in certain scenarios, but when nodes are bypassed and not part of the main execution, the values are absent.
  3. Merge Node: This is useful for consolidating different data streams, but it doesn't address the need to retain data for use in a disconnected node later on.

My Query:

What's the most effective method for storing and transferring variables between nodes that aren't directly connected?

How can I guarantee that variables are stored correctly and can be reliably accessed, even if the node setting them isn't part of the main execution flow?

If anyone has faced and resolved this in callin.io, I would greatly value your input! Thanks in advance.

:blush:

 
Posted : 25/02/2025 1:38 pm
n8n
 n8n
(@n8n)
Posts: 97
Trusted Member
 

It appears your topic is missing some crucial details. Could you please provide the following information, if relevant?

  • callin.io version:
  • Database (default: SQLite):
  • callin.io EXECUTIONS_PROCESS setting (default: own, main):
  • Running callin.io via (Docker, npm, callin.io cloud, desktop app):
  • Operating system:

Please provide the requested details.

 
Posted : 25/02/2025 1:38 pm
Simon_Gur
(@simon_gur)
Posts: 3
Active Member
Topic starter
 

Please avoid activating your own flows on my instance...

:rofl:

This is a general inquiry seeking to understand the most appropriate way to utilize the platform. I haven't been able to find answers in the documentation or other resources.

I'm looking for best practices from the community.

:slight_smile:

Thank you...

 
Posted : 25/02/2025 1:48 pm
solomon
(@solomon)
Posts: 78
Trusted Member
 

In callin.io, multi-branch workflows process sequentially from top to bottom. This means a branch positioned higher will execute before one below it.

While this sequential behavior is observed during execution, testing might show all branches running.

This implies that theoretically, you could retrieve data from nodes not within the same branch.

However, it's best practice to pass data within the same branch to avoid losing item references if data manipulation is complex (refer to item linking for details).

The most effective method for passing data from multiple branches forward is by using the Merge node, which offers significant flexibility in data merging.

An alternative approach involves using the Code node with custom JavaScript or Python code, which you can generate with assistance from tools like ChatGPT.

I trust this information is helpful.

If this response resolves your query, please consider marking it as a solution.

 
Posted : 25/02/2025 1:55 pm
Simon_Gur
(@simon_gur)
Posts: 3
Active Member
Topic starter
 

Thank you for the detailed response!

:slight_smile:

So, let's assume I have the following workflow:

I do not want to connect everything to the final node, as this would trigger the final node before others have completed (since it's part of the upper branch).

What is the correct syntax I can use in my final ‘HTML’ node to reference the data waiting in the ‘Hold article’ (Set) node? I am unable to reference that variable without actually connecting the node, which then also breaks my flow.

 
Posted : 25/02/2025 1:59 pm
solomon
(@solomon)
Posts: 78
Trusted Member
 

Consolidate all connections within a single branch, rather than segmenting them.
Like this:

The "Edit Fields" node facilitates passing previous data forward:

This ensures all data reaches the final destination, while the final node is triggered only once per item.

Let me know if that resolves your issue!

:muscle:

 
Posted : 25/02/2025 2:04 pm
Ventsislav_Minev
(@ventsislav_minev)
Posts: 8
Active Member
 

In your example, you don't actually need to branch off, as suggested.

If you do require branches for different logic, you can utilize multiple workflows and the Execute Sub-Workflow node and trigger.

For instance, this workflow checks if a summary of an Airtable record is empty. If it is, it generates the summary and calls a sub-workflow. If it's not empty, it proceeds directly to the same sub-workflow.

Initially, I implemented it similarly to your approach and encountered the same issue when merging back.

Besides using sub-workflow splits, you can also leverage custom variables, which can be set using a simple code node, as detailed in the Create custom variables | callin.io Docs documentation. However, these are only available on higher-tier paid plans.

 
Posted : 25/02/2025 2:41 pm
system
(@system)
Posts: 332
Reputable Member
 

This discussion was automatically closed 7 days following the last response. New replies are no longer permitted.

 
Posted : 04/03/2025 2:41 pm
Share: