Skip to content

Commit 0875582

Browse files
authored
Fix workflow broken after node replace inside a container (baserow#5308)
1 parent cb095b0 commit 0875582

4 files changed

Lines changed: 17 additions & 7 deletions

File tree

backend/src/baserow/contrib/automation/nodes/models.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,12 @@ def get_parent_nodes(self):
127127
the current node instance.
128128
"""
129129

130+
previous_positions = self.workflow.get_graph().get_previous_positions(self)
131+
if previous_positions is None:
132+
return []
133+
130134
return [
131-
position[0]
132-
for position in self.workflow.get_graph().get_previous_positions(self)
133-
if position[1] == "child"
135+
position[0] for position in previous_positions if position[1] == "child"
134136
]
135137

136138
def get_next_nodes(

backend/src/baserow/contrib/automation/nodes/service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,9 @@ def replace_node(
418418
workflow.simulate_until_node = None
419419
workflow.save(update_fields=["simulate_until_node"])
420420

421+
cache_key = WORKFLOW_DIRTY_CACHE_KEY.format(workflow.id)
422+
global_cache.update(cache_key, lambda _: True)
423+
421424
automation_node_deleted.send(
422425
self,
423426
workflow=workflow,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "bug",
3+
"message": "Fix broken workflow after node replacement",
4+
"issue_origin": "github",
5+
"issue_number": null,
6+
"domain": "automation",
7+
"bullet_points": [],
8+
"created_at": "2026-05-05"
9+
}

web-frontend/modules/automation/pages/automationWorkflow.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ const { data: pageData, error } = await useAsyncData(
8888
workflowId: workflowId.value,
8989
})
9090
91-
await $store.dispatch('automationHistory/fetchWorkflowHistory', {
92-
workflowId: workflowId.value,
93-
})
94-
9591
await $store.dispatch('automationWorkflowNode/fetch', {
9692
workflow,
9793
})

0 commit comments

Comments
 (0)