You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the edge is set to:
graph_builder.add_edge('a3', 'a5')
graph_builder.add_edge('a4', 'a5')
a3 and a4 will each trigger a5 once, meaning a5 will receive the execution results twice, and will be executed 2 times.
If the edge is set to:
graph_builder.add_edge(['a3','a4'], 'a5')
The generated graph is the same, but a5 will be triggered once, and the node task will be executed once.
Test the following scenarios:
No matter how the edge is set, a4 is triggered once.
Therefore, it is speculated that:
1、The overall execution follows the hierarchical structure; regardless of the number of branches, tasks at the same level are executed in parallel, unless a hierarchical relationship is explicitly specified (['a3', 'a4']). In the case of specified hierarchical relationships, the same downstream node at the same level is triggered only once.
2、Manually specified levels do not affect the actual execution levels, as in the following situation:
Regardless of whether a3 and a5 are manually specified to be at the same level, in practice, the execution of a4 will wait for a2 and a3 to complete before proceeding.
I have looked through some documentation and could not find any relevant explanation or rules regarding this; perhaps I just couldn't locate the right section?
Additionally, it seems that there is no way to obtain messages from the previous node in the current branch. For example, in the graph above, when node a4 is executing, to obtain the result of a2, using last_messages might retrieve the value from a3 instead.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As shown in the following graph
If the edge is set to:
graph_builder.add_edge('a3', 'a5')
graph_builder.add_edge('a4', 'a5')
a3 and a4 will each trigger a5 once, meaning a5 will receive the execution results twice, and will be executed 2 times.
If the edge is set to:
graph_builder.add_edge(['a3','a4'], 'a5')
The generated graph is the same, but a5 will be triggered once, and the node task will be executed once.
Test the following scenarios:
No matter how the edge is set, a4 is triggered once.
Therefore, it is speculated that:
1、The overall execution follows the hierarchical structure; regardless of the number of branches, tasks at the same level are executed in parallel, unless a hierarchical relationship is explicitly specified (['a3', 'a4']). In the case of specified hierarchical relationships, the same downstream node at the same level is triggered only once.
2、Manually specified levels do not affect the actual execution levels, as in the following situation:
Regardless of whether a3 and a5 are manually specified to be at the same level, in practice, the execution of a4 will wait for a2 and a3 to complete before proceeding.
I have looked through some documentation and could not find any relevant explanation or rules regarding this; perhaps I just couldn't locate the right section?
Additionally, it seems that there is no way to obtain messages from the previous node in the current branch. For example, in the graph above, when node a4 is executing, to obtain the result of a2, using last_messages might retrieve the value from a3 instead.
Beta Was this translation helpful? Give feedback.
All reactions