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
Advance the execution pointer to the next node in the workflow graph. This method implements the logic for navigating through nested workflow structures, handling both sequential execution and hierarchical traversal.
126
+
127
+
**Parameters**
128
+
129
+
-`ptr`: Optional external pointer vector to advance. When provided, the method advances this pointer **without modifying the interpreter's own `_pointer`**. Defaults to `None`, in which case `self._pointer` is advanced. This enables external systems to preview pointer advancement paths without disturbing interpreter state.
130
+
131
+
**Returns**
132
+
133
+
-`True` if the pointer was successfully advanced to the next node.
134
+
-`False` if the end of the workflow has been reached.
135
+
136
+
**Algorithm**
137
+
138
+
1. Starting from `ptr` (or `self._pointer`), traverse `base_addr` layer-by-layer to locate the container of the current node.
139
+
2. If the current node is a **non-empty `NodeComposeRendered`** → enter the nested container (`append(0)`), return `True`.
140
+
3. If the current node has a **next sibling**:
141
+
- Sibling is a non-empty `NodeComposeRendered` → enter that nested container, return `True`.
142
+
- Otherwise → move to the sibling node, return `True`.
143
+
4. If no next sibling → **backtrack up** the pointer stack layer-by-layer, looking for a parent container's next sibling.
144
+
5. If a next sibling is found during backtracking → apply the same logic, return `True`.
145
+
6. If backtracking reaches the top level with no more siblings → return `False` (end of workflow).
146
+
147
+
**Deprecation**
148
+
149
+
The `_advance_pointer` property is deprecated since v0.3.0. Use `advance_pointer()` instead. The old property exists only as a compatibility shim and will be removed in a future version.
150
+
123
151
### Execution behavior
124
152
125
153
`WorkflowInterpreter` preserves execution atomicity by holding `_interpret_lock` while a single node is executed. It only checks suspend points at safe boundaries:
0 commit comments