Base Node
graphorchestrator.nodes.base
Node
Bases: ABC
Abstract base class representing a node in a graph.
Nodes have unique IDs and can have incoming and outgoing edges.
Source code in graphorchestrator\nodes\base.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
__init__(node_id)
Initializes a new Node instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_id
|
str
|
The unique identifier for this node. |
required |
Source code in graphorchestrator\nodes\base.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
execute(state)
abstractmethod
Abstract method to execute the node's logic.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
State
|
The current state of the execution. |
required |
Source code in graphorchestrator\nodes\base.py
49 50 51 52 53 54 55 56 57 |
|
set_fallback(fallback_node_id)
Sets the fallback node ID for this node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fallback_node_id
|
str
|
The ID of the fallback node. |
required |
Source code in graphorchestrator\nodes\base.py
59 60 61 62 63 64 65 66 |
|
set_retry_policy(retry_policy)
Sets the retry policy for this node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
retry_policy
|
RetryPolicy
|
The retry policy to apply. |
required |
Source code in graphorchestrator\nodes\base.py
68 69 70 71 72 73 74 75 |
|