griptape-nodes 0.40.0__py3-none-any.whl → 0.42.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- griptape_nodes/app/__init__.py +1 -5
- griptape_nodes/app/app.py +12 -9
- griptape_nodes/app/app_sessions.py +132 -36
- griptape_nodes/app/watch.py +3 -1
- griptape_nodes/drivers/storage/local_storage_driver.py +3 -2
- griptape_nodes/exe_types/flow.py +68 -368
- griptape_nodes/machines/control_flow.py +16 -13
- griptape_nodes/machines/node_resolution.py +16 -14
- griptape_nodes/node_library/workflow_registry.py +2 -2
- griptape_nodes/retained_mode/events/agent_events.py +70 -8
- griptape_nodes/retained_mode/events/app_events.py +132 -11
- griptape_nodes/retained_mode/events/arbitrary_python_events.py +23 -0
- griptape_nodes/retained_mode/events/base_events.py +7 -25
- griptape_nodes/retained_mode/events/config_events.py +87 -11
- griptape_nodes/retained_mode/events/connection_events.py +56 -5
- griptape_nodes/retained_mode/events/context_events.py +27 -4
- griptape_nodes/retained_mode/events/execution_events.py +99 -14
- griptape_nodes/retained_mode/events/flow_events.py +165 -7
- griptape_nodes/retained_mode/events/library_events.py +193 -15
- griptape_nodes/retained_mode/events/logger_events.py +11 -0
- griptape_nodes/retained_mode/events/node_events.py +243 -22
- griptape_nodes/retained_mode/events/object_events.py +40 -4
- griptape_nodes/retained_mode/events/os_events.py +13 -2
- griptape_nodes/retained_mode/events/parameter_events.py +212 -8
- griptape_nodes/retained_mode/events/secrets_events.py +59 -7
- griptape_nodes/retained_mode/events/static_file_events.py +57 -4
- griptape_nodes/retained_mode/events/validation_events.py +39 -4
- griptape_nodes/retained_mode/events/workflow_events.py +188 -17
- griptape_nodes/retained_mode/griptape_nodes.py +46 -323
- griptape_nodes/retained_mode/managers/agent_manager.py +1 -1
- griptape_nodes/retained_mode/managers/engine_identity_manager.py +146 -0
- griptape_nodes/retained_mode/managers/event_manager.py +14 -2
- griptape_nodes/retained_mode/managers/flow_manager.py +749 -64
- griptape_nodes/retained_mode/managers/library_manager.py +112 -2
- griptape_nodes/retained_mode/managers/node_manager.py +35 -32
- griptape_nodes/retained_mode/managers/object_manager.py +11 -3
- griptape_nodes/retained_mode/managers/os_manager.py +70 -1
- griptape_nodes/retained_mode/managers/secrets_manager.py +4 -0
- griptape_nodes/retained_mode/managers/session_manager.py +328 -0
- griptape_nodes/retained_mode/managers/settings.py +7 -0
- griptape_nodes/retained_mode/managers/workflow_manager.py +523 -454
- griptape_nodes/retained_mode/retained_mode.py +44 -0
- griptape_nodes/retained_mode/utils/engine_identity.py +141 -27
- {griptape_nodes-0.40.0.dist-info → griptape_nodes-0.42.0.dist-info}/METADATA +2 -2
- {griptape_nodes-0.40.0.dist-info → griptape_nodes-0.42.0.dist-info}/RECORD +48 -47
- griptape_nodes/retained_mode/utils/session_persistence.py +0 -105
- {griptape_nodes-0.40.0.dist-info → griptape_nodes-0.42.0.dist-info}/WHEEL +0 -0
- {griptape_nodes-0.40.0.dist-info → griptape_nodes-0.42.0.dist-info}/entry_points.txt +0 -0
- {griptape_nodes-0.40.0.dist-info → griptape_nodes-0.42.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -31,6 +31,24 @@ class NewPosition(NamedTuple):
|
|
|
31
31
|
@dataclass
|
|
32
32
|
@PayloadRegistry.register
|
|
33
33
|
class CreateNodeRequest(RequestPayload):
|
|
34
|
+
"""Create a new node in a workflow.
|
|
35
|
+
|
|
36
|
+
Use when: Building workflows programmatically, responding to user requests ("add a CSV reader"),
|
|
37
|
+
loading saved workflows. Validates node type exists, generates unique name if needed.
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
node_type: Class name of the node to create
|
|
41
|
+
specific_library_name: Library to search for the node type (None for any library)
|
|
42
|
+
node_name: Desired name for the node (None for auto-generated)
|
|
43
|
+
override_parent_flow_name: Flow to create the node in (None for current context)
|
|
44
|
+
metadata: Initial metadata for the node (position, display properties)
|
|
45
|
+
resolution: Initial resolution state (defaults to UNRESOLVED)
|
|
46
|
+
initial_setup: Skip setup work when loading from file (defaults to False)
|
|
47
|
+
set_as_new_context: Set this node as current context after creation (defaults to False)
|
|
48
|
+
|
|
49
|
+
Results: CreateNodeResultSuccess (with assigned name) | CreateNodeResultFailure (invalid type, missing library, flow not found)
|
|
50
|
+
"""
|
|
51
|
+
|
|
34
52
|
node_type: str
|
|
35
53
|
specific_library_name: str | None = None
|
|
36
54
|
node_name: str | None = None
|
|
@@ -47,6 +65,14 @@ class CreateNodeRequest(RequestPayload):
|
|
|
47
65
|
@dataclass
|
|
48
66
|
@PayloadRegistry.register
|
|
49
67
|
class CreateNodeResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
|
|
68
|
+
"""Node created successfully. Node is now available for parameter setting, connections, and execution.
|
|
69
|
+
|
|
70
|
+
Args:
|
|
71
|
+
node_name: Final assigned name (may differ from requested)
|
|
72
|
+
node_type: Class name of created node
|
|
73
|
+
specific_library_name: Library that provided this node type
|
|
74
|
+
"""
|
|
75
|
+
|
|
50
76
|
node_name: str
|
|
51
77
|
node_type: str
|
|
52
78
|
specific_library_name: str | None = None
|
|
@@ -55,12 +81,27 @@ class CreateNodeResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
|
|
|
55
81
|
@dataclass
|
|
56
82
|
@PayloadRegistry.register
|
|
57
83
|
class CreateNodeResultFailure(ResultPayloadFailure):
|
|
58
|
-
|
|
84
|
+
"""Node creation failed.
|
|
85
|
+
|
|
86
|
+
Common causes: invalid node_type, missing library, flow not found,
|
|
87
|
+
no current context, or instantiation errors. Workflow unchanged.
|
|
88
|
+
"""
|
|
59
89
|
|
|
60
90
|
|
|
61
91
|
@dataclass
|
|
62
92
|
@PayloadRegistry.register
|
|
63
93
|
class DeleteNodeRequest(RequestPayload):
|
|
94
|
+
"""Delete a node from a workflow.
|
|
95
|
+
|
|
96
|
+
Use when: Removing obsolete nodes, cleaning up failed nodes, restructuring workflows,
|
|
97
|
+
implementing undo. Handles cascading cleanup of connections and execution cancellation.
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
node_name: Name of the node to delete (None for current context node)
|
|
101
|
+
|
|
102
|
+
Results: DeleteNodeResultSuccess | DeleteNodeResultFailure (node not found, cleanup failed)
|
|
103
|
+
"""
|
|
104
|
+
|
|
64
105
|
# If None is passed, assumes we're using the Node in the Current Context.
|
|
65
106
|
node_name: str | None = None
|
|
66
107
|
|
|
@@ -68,18 +109,33 @@ class DeleteNodeRequest(RequestPayload):
|
|
|
68
109
|
@dataclass
|
|
69
110
|
@PayloadRegistry.register
|
|
70
111
|
class DeleteNodeResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
|
|
71
|
-
|
|
112
|
+
"""Node deleted successfully. Node and all connections removed, no longer available for use."""
|
|
72
113
|
|
|
73
114
|
|
|
74
115
|
@dataclass
|
|
75
116
|
@PayloadRegistry.register
|
|
76
117
|
class DeleteNodeResultFailure(ResultPayloadFailure):
|
|
77
|
-
|
|
118
|
+
"""Node deletion failed.
|
|
119
|
+
|
|
120
|
+
Common causes: node not found, no current context,
|
|
121
|
+
execution cancellation failed, or connection cleanup failed. Workflow unchanged.
|
|
122
|
+
"""
|
|
78
123
|
|
|
79
124
|
|
|
80
125
|
@dataclass
|
|
81
126
|
@PayloadRegistry.register
|
|
82
127
|
class GetNodeResolutionStateRequest(RequestPayload):
|
|
128
|
+
"""Get the current resolution state of a node.
|
|
129
|
+
|
|
130
|
+
Use when: Checking if node is ready to execute, monitoring execution progress,
|
|
131
|
+
workflow orchestration, debugging. States: UNRESOLVED -> RESOLVED -> EXECUTING -> COMPLETED/FAILED
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
node_name: Name of the node to check (None for current context node)
|
|
135
|
+
|
|
136
|
+
Results: GetNodeResolutionStateResultSuccess (with state) | GetNodeResolutionStateResultFailure (node not found)
|
|
137
|
+
"""
|
|
138
|
+
|
|
83
139
|
# If None is passed, assumes we're using the Node in the Current Context
|
|
84
140
|
node_name: str | None = None
|
|
85
141
|
|
|
@@ -87,18 +143,35 @@ class GetNodeResolutionStateRequest(RequestPayload):
|
|
|
87
143
|
@dataclass
|
|
88
144
|
@PayloadRegistry.register
|
|
89
145
|
class GetNodeResolutionStateResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
|
|
146
|
+
"""Node resolution state retrieved successfully.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
state: Current state (UNRESOLVED, RESOLVED, EXECUTING, COMPLETED, FAILED)
|
|
150
|
+
"""
|
|
151
|
+
|
|
90
152
|
state: str
|
|
91
153
|
|
|
92
154
|
|
|
93
155
|
@dataclass
|
|
94
156
|
@PayloadRegistry.register
|
|
95
157
|
class GetNodeResolutionStateResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
|
|
96
|
-
|
|
158
|
+
"""Resolution state retrieval failed. Common causes: node not found, no current context."""
|
|
97
159
|
|
|
98
160
|
|
|
99
161
|
@dataclass
|
|
100
162
|
@PayloadRegistry.register
|
|
101
163
|
class ListParametersOnNodeRequest(RequestPayload):
|
|
164
|
+
"""List all parameter names available on a node.
|
|
165
|
+
|
|
166
|
+
Use when: Parameter discovery, validation before setting values, generating UIs,
|
|
167
|
+
implementing completion features. Names can be used with GetParameterValue, SetParameterValue, connections.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
node_name: Name of the node to list parameters for (None for current context node)
|
|
171
|
+
|
|
172
|
+
Results: ListParametersOnNodeResultSuccess (with parameter names) | ListParametersOnNodeResultFailure (node not found)
|
|
173
|
+
"""
|
|
174
|
+
|
|
102
175
|
# If None is passed, assumes we're using the Node in the Current Context
|
|
103
176
|
node_name: str | None = None
|
|
104
177
|
|
|
@@ -106,18 +179,35 @@ class ListParametersOnNodeRequest(RequestPayload):
|
|
|
106
179
|
@dataclass
|
|
107
180
|
@PayloadRegistry.register
|
|
108
181
|
class ListParametersOnNodeResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
|
|
182
|
+
"""Parameter names retrieved successfully.
|
|
183
|
+
|
|
184
|
+
Args:
|
|
185
|
+
parameter_names: List of parameter names available on the node
|
|
186
|
+
"""
|
|
187
|
+
|
|
109
188
|
parameter_names: list[str]
|
|
110
189
|
|
|
111
190
|
|
|
112
191
|
@dataclass
|
|
113
192
|
@PayloadRegistry.register
|
|
114
193
|
class ListParametersOnNodeResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
|
|
115
|
-
|
|
194
|
+
"""Parameter listing failed. Common causes: node not found, no current context."""
|
|
116
195
|
|
|
117
196
|
|
|
118
197
|
@dataclass
|
|
119
198
|
@PayloadRegistry.register
|
|
120
199
|
class GetNodeMetadataRequest(RequestPayload):
|
|
200
|
+
"""Retrieve metadata associated with a node.
|
|
201
|
+
|
|
202
|
+
Use when: Getting node position for layout, retrieving custom properties, implementing selection,
|
|
203
|
+
saving/loading workflow layout. Metadata doesn't affect execution but provides workflow context.
|
|
204
|
+
|
|
205
|
+
Args:
|
|
206
|
+
node_name: Name of the node to get metadata for (None for current context node)
|
|
207
|
+
|
|
208
|
+
Results: GetNodeMetadataResultSuccess (with metadata dict) | GetNodeMetadataResultFailure (node not found)
|
|
209
|
+
"""
|
|
210
|
+
|
|
121
211
|
# If None is passed, assumes we're using the Node in the Current Context
|
|
122
212
|
node_name: str | None = None
|
|
123
213
|
|
|
@@ -125,18 +215,36 @@ class GetNodeMetadataRequest(RequestPayload):
|
|
|
125
215
|
@dataclass
|
|
126
216
|
@PayloadRegistry.register
|
|
127
217
|
class GetNodeMetadataResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
|
|
218
|
+
"""Node metadata retrieved successfully.
|
|
219
|
+
|
|
220
|
+
Args:
|
|
221
|
+
metadata: Dictionary containing position, display properties, custom user data
|
|
222
|
+
"""
|
|
223
|
+
|
|
128
224
|
metadata: dict
|
|
129
225
|
|
|
130
226
|
|
|
131
227
|
@dataclass
|
|
132
228
|
@PayloadRegistry.register
|
|
133
229
|
class GetNodeMetadataResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
|
|
134
|
-
|
|
230
|
+
"""Metadata retrieval failed. Common causes: node not found, no current context."""
|
|
135
231
|
|
|
136
232
|
|
|
137
233
|
@dataclass
|
|
138
234
|
@PayloadRegistry.register
|
|
139
235
|
class SetNodeMetadataRequest(RequestPayload):
|
|
236
|
+
"""Update metadata associated with a node.
|
|
237
|
+
|
|
238
|
+
Use when: Updating node position, storing custom properties/annotations, implementing styling,
|
|
239
|
+
saving user preferences. Metadata doesn't affect execution but provides workflow context.
|
|
240
|
+
|
|
241
|
+
Args:
|
|
242
|
+
metadata: Dictionary of metadata to set (position, display properties, custom data)
|
|
243
|
+
node_name: Name of the node to update metadata for (None for current context node)
|
|
244
|
+
|
|
245
|
+
Results: SetNodeMetadataResultSuccess | SetNodeMetadataResultFailure (node not found, update error)
|
|
246
|
+
"""
|
|
247
|
+
|
|
140
248
|
metadata: dict
|
|
141
249
|
# If None is passed, assumes we're using the Node in the Current Context
|
|
142
250
|
node_name: str | None = None
|
|
@@ -145,13 +253,13 @@ class SetNodeMetadataRequest(RequestPayload):
|
|
|
145
253
|
@dataclass
|
|
146
254
|
@PayloadRegistry.register
|
|
147
255
|
class SetNodeMetadataResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
|
|
148
|
-
|
|
256
|
+
"""Node metadata updated successfully. New metadata stored and available for future requests."""
|
|
149
257
|
|
|
150
258
|
|
|
151
259
|
@dataclass
|
|
152
260
|
@PayloadRegistry.register
|
|
153
261
|
class SetNodeMetadataResultFailure(ResultPayloadFailure):
|
|
154
|
-
|
|
262
|
+
"""Metadata update failed. Common causes: node not found, no current context, invalid metadata format."""
|
|
155
263
|
|
|
156
264
|
|
|
157
265
|
# Get all info via a "jumbo" node event. Batches multiple info requests for, say, a GUI.
|
|
@@ -159,6 +267,17 @@ class SetNodeMetadataResultFailure(ResultPayloadFailure):
|
|
|
159
267
|
@dataclass
|
|
160
268
|
@PayloadRegistry.register
|
|
161
269
|
class GetAllNodeInfoRequest(RequestPayload):
|
|
270
|
+
"""Retrieve comprehensive information about a node in a single call.
|
|
271
|
+
|
|
272
|
+
Use when: Populating UIs, implementing node inspection/debugging, gathering complete state
|
|
273
|
+
for serialization, optimizing performance. Batches metadata, resolution state, connections, parameters.
|
|
274
|
+
|
|
275
|
+
Args:
|
|
276
|
+
node_name: Name of the node to get information for (None for current context node)
|
|
277
|
+
|
|
278
|
+
Results: GetAllNodeInfoResultSuccess (with comprehensive info) | GetAllNodeInfoResultFailure (node not found)
|
|
279
|
+
"""
|
|
280
|
+
|
|
162
281
|
# If None is passed, assumes we're using the Node in the Current Context
|
|
163
282
|
node_name: str | None = None
|
|
164
283
|
|
|
@@ -172,6 +291,16 @@ class ParameterInfoValue:
|
|
|
172
291
|
@dataclass
|
|
173
292
|
@PayloadRegistry.register
|
|
174
293
|
class GetAllNodeInfoResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
|
|
294
|
+
"""Comprehensive node information retrieved successfully.
|
|
295
|
+
|
|
296
|
+
Args:
|
|
297
|
+
metadata: Node metadata (position, display properties, etc.)
|
|
298
|
+
node_resolution_state: Current execution state
|
|
299
|
+
connections: All incoming and outgoing connections
|
|
300
|
+
element_id_to_value: Parameter details and values by element ID
|
|
301
|
+
root_node_element: Root element information
|
|
302
|
+
"""
|
|
303
|
+
|
|
175
304
|
metadata: dict
|
|
176
305
|
node_resolution_state: str
|
|
177
306
|
connections: ListConnectionsForNodeResultSuccess
|
|
@@ -182,7 +311,10 @@ class GetAllNodeInfoResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess)
|
|
|
182
311
|
@dataclass
|
|
183
312
|
@PayloadRegistry.register
|
|
184
313
|
class GetAllNodeInfoResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
|
|
185
|
-
|
|
314
|
+
"""Comprehensive node information retrieval failed.
|
|
315
|
+
|
|
316
|
+
Common causes: node not found, no current context, partial failure in gathering information components.
|
|
317
|
+
"""
|
|
186
318
|
|
|
187
319
|
|
|
188
320
|
# A Node's state can be serialized to a sequence of commands that the engine runs.
|
|
@@ -278,16 +410,17 @@ class SerializedParameterValueTracker:
|
|
|
278
410
|
@dataclass
|
|
279
411
|
@PayloadRegistry.register
|
|
280
412
|
class SerializeNodeToCommandsRequest(RequestPayload):
|
|
281
|
-
"""
|
|
413
|
+
"""Serialize a node into a sequence of commands.
|
|
282
414
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
415
|
+
Use when: Implementing copy/paste, exporting nodes, creating templates, backing up nodes.
|
|
416
|
+
Captures complete node state including parameters and connections.
|
|
417
|
+
|
|
418
|
+
Args:
|
|
419
|
+
node_name: Name of the node to serialize (None for current context node)
|
|
420
|
+
unique_parameter_uuid_to_values: Mapping of UUIDs to unique parameter values (modified in-place)
|
|
421
|
+
serialized_parameter_value_tracker: Tracks serialization state of parameter values
|
|
422
|
+
|
|
423
|
+
Results: SerializeNodeToCommandsResultSuccess (with commands) | SerializeNodeToCommandsResultFailure (serialization error)
|
|
291
424
|
"""
|
|
292
425
|
|
|
293
426
|
node_name: str | None = None
|
|
@@ -350,6 +483,17 @@ class SerializedSelectedNodesCommands:
|
|
|
350
483
|
@dataclass
|
|
351
484
|
@PayloadRegistry.register
|
|
352
485
|
class SerializeSelectedNodesToCommandsRequest(WorkflowNotAlteredMixin, RequestPayload):
|
|
486
|
+
"""Serialize multiple selected nodes into commands.
|
|
487
|
+
|
|
488
|
+
Use when: Implementing copy/paste, exporting workflow sections, creating templates,
|
|
489
|
+
backing up workflows, transferring configurations. Preserves nodes and interconnections.
|
|
490
|
+
|
|
491
|
+
Args:
|
|
492
|
+
nodes_to_serialize: List of node identifiers (each containing [node_name, timestamp])
|
|
493
|
+
|
|
494
|
+
Results: SerializeSelectedNodesToCommandsResultSuccess (with commands) | SerializeSelectedNodesToCommandsResultFailure (node not found, serialization error)
|
|
495
|
+
"""
|
|
496
|
+
|
|
353
497
|
# They will be passed with node_name, timestamp
|
|
354
498
|
nodes_to_serialize: list[list[str]]
|
|
355
499
|
|
|
@@ -357,6 +501,14 @@ class SerializeSelectedNodesToCommandsRequest(WorkflowNotAlteredMixin, RequestPa
|
|
|
357
501
|
@dataclass
|
|
358
502
|
@PayloadRegistry.register
|
|
359
503
|
class SerializeSelectedNodesToCommandsResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
|
|
504
|
+
"""Selected nodes serialized successfully.
|
|
505
|
+
|
|
506
|
+
Preserves complete structure including node configurations, parameter values, and connection relationships.
|
|
507
|
+
|
|
508
|
+
Args:
|
|
509
|
+
serialized_selected_node_commands: Complete serialized representation
|
|
510
|
+
"""
|
|
511
|
+
|
|
360
512
|
# They will be passed with node_name, timestamp
|
|
361
513
|
# Could be a flow command if it's all nodes in a flow.
|
|
362
514
|
serialized_selected_node_commands: SerializedSelectedNodesCommands
|
|
@@ -365,58 +517,127 @@ class SerializeSelectedNodesToCommandsResultSuccess(WorkflowNotAlteredMixin, Res
|
|
|
365
517
|
@dataclass
|
|
366
518
|
@PayloadRegistry.register
|
|
367
519
|
class SerializeSelectedNodesToCommandsResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
|
|
368
|
-
|
|
520
|
+
"""Selected nodes serialization failed.
|
|
521
|
+
|
|
522
|
+
Common causes: nodes not found, non-serializable parameter values, connection resolution failures.
|
|
523
|
+
"""
|
|
369
524
|
|
|
370
525
|
|
|
371
526
|
@dataclass
|
|
372
527
|
@PayloadRegistry.register
|
|
373
528
|
class DeserializeSelectedNodesFromCommandsRequest(WorkflowNotAlteredMixin, RequestPayload):
|
|
529
|
+
"""Recreate nodes from serialized commands.
|
|
530
|
+
|
|
531
|
+
Use when: Implementing paste functionality, importing configurations, restoring from backups,
|
|
532
|
+
duplicating complex structures. Creates new nodes with unique names and restores parameters/connections.
|
|
533
|
+
|
|
534
|
+
Args:
|
|
535
|
+
positions: List of positions for the recreated nodes (None for default positions)
|
|
536
|
+
|
|
537
|
+
Results: DeserializeSelectedNodesFromCommandsResultSuccess (with node names) | DeserializeSelectedNodesFromCommandsResultFailure (deserialization error)
|
|
538
|
+
"""
|
|
539
|
+
|
|
374
540
|
positions: list[NewPosition] | None = None
|
|
375
541
|
|
|
376
542
|
|
|
377
543
|
@dataclass
|
|
378
544
|
@PayloadRegistry.register
|
|
379
545
|
class DeserializeSelectedNodesFromCommandsResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
|
|
546
|
+
"""Nodes recreated successfully from serialized commands. Parameter values and connections restored.
|
|
547
|
+
|
|
548
|
+
Args:
|
|
549
|
+
node_names: List of names assigned to newly created nodes
|
|
550
|
+
"""
|
|
551
|
+
|
|
380
552
|
node_names: list[str]
|
|
381
553
|
|
|
382
554
|
|
|
383
555
|
@dataclass
|
|
384
556
|
@PayloadRegistry.register
|
|
385
557
|
class DeserializeSelectedNodesFromCommandsResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
|
|
386
|
-
|
|
558
|
+
"""Nodes recreation failed.
|
|
559
|
+
|
|
560
|
+
Common causes: invalid/corrupted commands, missing node types/libraries,
|
|
561
|
+
parameter deserialization failures, connection creation errors.
|
|
562
|
+
"""
|
|
387
563
|
|
|
388
564
|
|
|
389
565
|
@dataclass
|
|
390
566
|
@PayloadRegistry.register
|
|
391
567
|
class DeserializeNodeFromCommandsRequest(RequestPayload):
|
|
568
|
+
"""Recreate a single node from serialized commands.
|
|
569
|
+
|
|
570
|
+
Use when: Restoring individual nodes from backups/templates, implementing node-level copy/paste,
|
|
571
|
+
loading configurations, creating from templates. Creates new node with unique name and restores parameters.
|
|
572
|
+
|
|
573
|
+
Args:
|
|
574
|
+
serialized_node_commands: Serialized node commands containing complete node state
|
|
575
|
+
|
|
576
|
+
Results: DeserializeNodeFromCommandsResultSuccess (with node name) | DeserializeNodeFromCommandsResultFailure (deserialization error)
|
|
577
|
+
"""
|
|
578
|
+
|
|
392
579
|
serialized_node_commands: SerializedNodeCommands
|
|
393
580
|
|
|
394
581
|
|
|
395
582
|
@dataclass
|
|
396
583
|
@PayloadRegistry.register
|
|
397
584
|
class DeserializeNodeFromCommandsResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
|
|
585
|
+
"""Node recreated successfully from serialized commands. Parameter values restored.
|
|
586
|
+
|
|
587
|
+
Args:
|
|
588
|
+
node_name: Name assigned to newly created node
|
|
589
|
+
"""
|
|
590
|
+
|
|
398
591
|
node_name: str
|
|
399
592
|
|
|
400
593
|
|
|
401
594
|
@dataclass
|
|
402
595
|
@PayloadRegistry.register
|
|
403
596
|
class DeserializeNodeFromCommandsResultFailure(ResultPayloadFailure):
|
|
404
|
-
|
|
597
|
+
"""Node recreation failed.
|
|
598
|
+
|
|
599
|
+
Common causes: invalid/corrupted commands, missing node type/library,
|
|
600
|
+
parameter deserialization failures, creation errors or constraints.
|
|
601
|
+
"""
|
|
405
602
|
|
|
406
603
|
|
|
407
604
|
@dataclass
|
|
408
605
|
@PayloadRegistry.register
|
|
409
606
|
class DuplicateSelectedNodesRequest(WorkflowNotAlteredMixin, RequestPayload):
|
|
607
|
+
"""Duplicate selected nodes with new positions.
|
|
608
|
+
|
|
609
|
+
Use when: Implementing duplicate functionality, creating multiple instances of same configuration,
|
|
610
|
+
expanding workflows by replicating patterns, quick copying without serialization overhead.
|
|
611
|
+
Preserves connections between duplicated nodes.
|
|
612
|
+
|
|
613
|
+
Args:
|
|
614
|
+
nodes_to_duplicate: List of node identifiers to duplicate (each containing [node_name, timestamp])
|
|
615
|
+
positions: List of positions for the duplicated nodes (None for default positions)
|
|
616
|
+
|
|
617
|
+
Results: DuplicateSelectedNodesResultSuccess (with node names) | DuplicateSelectedNodesResultFailure (duplication error)
|
|
618
|
+
"""
|
|
619
|
+
|
|
410
620
|
nodes_to_duplicate: list[list[str]]
|
|
621
|
+
positions: list[NewPosition] | None = None
|
|
411
622
|
|
|
412
623
|
|
|
413
624
|
@dataclass
|
|
414
625
|
@PayloadRegistry.register
|
|
415
626
|
class DuplicateSelectedNodesResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
|
|
627
|
+
"""Nodes duplicated successfully. Configuration and connections preserved.
|
|
628
|
+
|
|
629
|
+
Args:
|
|
630
|
+
node_names: List of names assigned to newly duplicated nodes
|
|
631
|
+
"""
|
|
632
|
+
|
|
416
633
|
node_names: list[str]
|
|
417
634
|
|
|
418
635
|
|
|
419
636
|
@dataclass
|
|
420
637
|
@PayloadRegistry.register
|
|
421
638
|
class DuplicateSelectedNodesResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
|
|
422
|
-
|
|
639
|
+
"""Node duplication failed.
|
|
640
|
+
|
|
641
|
+
Common causes: nodes not found, constraints/conflicts,
|
|
642
|
+
insufficient resources, connection duplication failures.
|
|
643
|
+
"""
|
|
@@ -12,6 +12,19 @@ from griptape_nodes.retained_mode.events.payload_registry import PayloadRegistry
|
|
|
12
12
|
@dataclass
|
|
13
13
|
@PayloadRegistry.register
|
|
14
14
|
class RenameObjectRequest(RequestPayload):
|
|
15
|
+
"""Rename an object (node, flow, etc.) in the system.
|
|
16
|
+
|
|
17
|
+
Use when: Organizing workflows, fixing naming conflicts, implementing rename features,
|
|
18
|
+
improving readability. Can automatically find alternative names if requested name is taken.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
object_name: Current name of the object to rename
|
|
22
|
+
requested_name: New name for the object
|
|
23
|
+
allow_next_closest_name_available: Whether to use alternative name if requested name is taken
|
|
24
|
+
|
|
25
|
+
Results: RenameObjectResultSuccess (with final name) | RenameObjectResultFailure (rename failed)
|
|
26
|
+
"""
|
|
27
|
+
|
|
15
28
|
object_name: str
|
|
16
29
|
requested_name: str
|
|
17
30
|
allow_next_closest_name_available: bool = False
|
|
@@ -20,28 +33,51 @@ class RenameObjectRequest(RequestPayload):
|
|
|
20
33
|
@dataclass
|
|
21
34
|
@PayloadRegistry.register
|
|
22
35
|
class RenameObjectResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
|
|
36
|
+
"""Object renamed successfully.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
final_name: The actual name assigned (may differ from requested if auto-naming was used)
|
|
40
|
+
"""
|
|
41
|
+
|
|
23
42
|
final_name: str # May not be the same as what was requested, if that bool was set
|
|
24
43
|
|
|
25
44
|
|
|
26
45
|
@dataclass
|
|
27
46
|
@PayloadRegistry.register
|
|
28
47
|
class RenameObjectResultFailure(ResultPayloadFailure):
|
|
48
|
+
"""Object rename failed.
|
|
49
|
+
|
|
50
|
+
Args:
|
|
51
|
+
next_available_name: Suggested alternative name (None if not available)
|
|
52
|
+
"""
|
|
53
|
+
|
|
29
54
|
next_available_name: str | None
|
|
30
55
|
|
|
31
56
|
|
|
32
|
-
# This request will wipe all Flows, Nodes, Connections, everything.
|
|
33
|
-
# But you knew that, right? You knew what you were doing when you called it?
|
|
34
57
|
@dataclass
|
|
35
58
|
@PayloadRegistry.register
|
|
36
59
|
class ClearAllObjectStateRequest(RequestPayload):
|
|
60
|
+
"""WARNING: Clear all object state - wipes all flows, nodes, connections, everything!
|
|
61
|
+
|
|
62
|
+
Use when: Resetting to clean state, recovering from corruption, starting fresh,
|
|
63
|
+
implementing reset functionality. Requires explicit confirmation.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
i_know_what_im_doing: Confirmation flag that must be set to True to proceed
|
|
67
|
+
|
|
68
|
+
Results: ClearAllObjectStateResultSuccess | ClearAllObjectStateResultFailure (clear failed)
|
|
69
|
+
"""
|
|
70
|
+
|
|
37
71
|
i_know_what_im_doing: bool = False
|
|
38
72
|
|
|
39
73
|
|
|
74
|
+
@dataclass
|
|
40
75
|
@PayloadRegistry.register
|
|
41
76
|
class ClearAllObjectStateResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
|
|
42
|
-
|
|
77
|
+
"""All object state cleared successfully. System is now in clean state."""
|
|
43
78
|
|
|
44
79
|
|
|
80
|
+
@dataclass
|
|
45
81
|
@PayloadRegistry.register
|
|
46
82
|
class ClearAllObjectStateResultFailure(ResultPayloadFailure):
|
|
47
|
-
|
|
83
|
+
"""Object state clearing failed. Common causes: confirmation not provided, clear operation failed."""
|
|
@@ -12,16 +12,27 @@ from griptape_nodes.retained_mode.events.payload_registry import PayloadRegistry
|
|
|
12
12
|
@dataclass
|
|
13
13
|
@PayloadRegistry.register
|
|
14
14
|
class OpenAssociatedFileRequest(RequestPayload):
|
|
15
|
+
"""Open a file using the operating system's associated application.
|
|
16
|
+
|
|
17
|
+
Use when: Opening generated files, launching external applications,
|
|
18
|
+
providing file viewing capabilities, implementing file associations.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
path_to_file: Path to the file to open with the associated application
|
|
22
|
+
|
|
23
|
+
Results: OpenAssociatedFileResultSuccess | OpenAssociatedFileResultFailure (file not found, no association)
|
|
24
|
+
"""
|
|
25
|
+
|
|
15
26
|
path_to_file: str
|
|
16
27
|
|
|
17
28
|
|
|
18
29
|
@dataclass
|
|
19
30
|
@PayloadRegistry.register
|
|
20
31
|
class OpenAssociatedFileResultSuccess(WorkflowNotAlteredMixin, ResultPayloadSuccess):
|
|
21
|
-
|
|
32
|
+
"""File opened successfully with associated application."""
|
|
22
33
|
|
|
23
34
|
|
|
24
35
|
@dataclass
|
|
25
36
|
@PayloadRegistry.register
|
|
26
37
|
class OpenAssociatedFileResultFailure(WorkflowNotAlteredMixin, ResultPayloadFailure):
|
|
27
|
-
|
|
38
|
+
"""File opening failed. Common causes: file not found, no associated application, permission denied."""
|