Skip to content

Commit 1435d48

Browse files
bram2wjrmipicklepete
authored
Added AI agent node (baserow#4154)
* Added AI integration node * Fix AIAgent node * Renaming AiAgentWorkflowAction->AIAgentWorkflowAction. Renaming AiAgentWorkflowActionType->AIAgentWorkflowActionType. Tweaking the changelog so it's about builder. * Fix tests --------- Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com> Co-authored-by: peter_baserow <peter@baserow.io>
1 parent 32232f8 commit 1435d48

File tree

36 files changed

+2893
-107
lines changed

36 files changed

+2893
-107
lines changed

backend/src/baserow/contrib/automation/apps.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def ready(self):
2020
UpdateAutomationNodeActionType,
2121
)
2222
from baserow.contrib.automation.nodes.node_types import (
23+
AIAgentActionNodeType,
2324
CoreHttpRequestNodeType,
2425
CoreHTTPTriggerNodeType,
2526
CoreIteratorNodeType,
@@ -167,6 +168,7 @@ def ready(self):
167168
)
168169
automation_node_type_registry.register(CorePeriodicTriggerNodeType())
169170
automation_node_type_registry.register(CoreHTTPTriggerNodeType())
171+
automation_node_type_registry.register(AIAgentActionNodeType())
170172

171173
from baserow.core.trash.registries import trash_operation_type_registry
172174

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Generated by Django 5.0.14 on 2025-11-03 16:06
2+
3+
import django.db.models.deletion
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
dependencies = [
9+
(
10+
"automation",
11+
"0021_coreiteratoractionnode_alter_automationnode_options_and_more",
12+
),
13+
]
14+
15+
operations = [
16+
migrations.CreateModel(
17+
name="AIAgentActionNode",
18+
fields=[
19+
(
20+
"automationnode_ptr",
21+
models.OneToOneField(
22+
auto_created=True,
23+
on_delete=django.db.models.deletion.CASCADE,
24+
parent_link=True,
25+
primary_key=True,
26+
serialize=False,
27+
to="automation.automationnode",
28+
),
29+
),
30+
],
31+
options={
32+
"abstract": False,
33+
},
34+
bases=("automation.automationnode",),
35+
),
36+
]

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,7 @@ class CoreRouterActionNode(AutomationActionNode):
224224

225225
class CoreIteratorActionNode(AutomationActionNode):
226226
...
227+
228+
229+
class AIAgentActionNode(AutomationActionNode):
230+
...

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
AutomationNodeTriggerMustBeFirstNode,
1717
)
1818
from baserow.contrib.automation.nodes.models import (
19+
AIAgentActionNode,
1920
AutomationNode,
2021
AutomationTriggerNode,
2122
CoreHTTPRequestActionNode,
@@ -38,6 +39,7 @@
3839
from baserow.contrib.automation.nodes.types import NodePositionType
3940
from baserow.contrib.automation.workflows.constants import WorkflowState
4041
from baserow.contrib.automation.workflows.models import AutomationWorkflow
42+
from baserow.contrib.integrations.ai.service_types import AIAgentServiceType
4143
from baserow.contrib.integrations.core.service_types import (
4244
CoreHTTPRequestServiceType,
4345
CoreHTTPTriggerServiceType,
@@ -172,6 +174,12 @@ class CoreSMTPEmailNodeType(AutomationNodeActionNodeType):
172174
service_type = CoreSMTPEmailServiceType.type
173175

174176

177+
class AIAgentActionNodeType(AutomationNodeActionNodeType):
178+
type = "ai_agent"
179+
model_class = AIAgentActionNode
180+
service_type = AIAgentServiceType.type
181+
182+
175183
class CoreRouterActionNodeType(AutomationNodeActionNodeType):
176184
type = "router"
177185
model_class = CoreRouterActionNode

backend/src/baserow/contrib/builder/apps.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ def ready(self):
277277

278278
from .workflow_actions.registries import builder_workflow_action_type_registry
279279
from .workflow_actions.workflow_action_types import (
280+
AIAgentWorkflowActionType,
280281
CoreHttpRequestActionType,
281282
CoreSMTPEmailActionType,
282283
CreateRowWorkflowActionType,
@@ -299,6 +300,7 @@ def ready(self):
299300
)
300301
builder_workflow_action_type_registry.register(CoreHttpRequestActionType())
301302
builder_workflow_action_type_registry.register(CoreSMTPEmailActionType())
303+
builder_workflow_action_type_registry.register(AIAgentWorkflowActionType())
302304

303305
from .elements.collection_field_types import (
304306
BooleanCollectionFieldType,

backend/src/baserow/contrib/builder/domains/handler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ def publish(self, domain: Domain, progress: Progress | None = None):
251251
include_permission_data=True,
252252
reduce_disk_space_usage=False,
253253
exclude_sensitive_data=False,
254+
is_publishing=True,
254255
)
255256

256257
default_storage = get_default_storage()
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Generated by Django 5.0.14 on 2025-11-04 14:46
2+
3+
import django.db.models.deletion
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
dependencies = [
9+
("builder", "0064_migrate_to_formula_field_objects"),
10+
("core", "0106_schemaoperation"),
11+
]
12+
13+
operations = [
14+
migrations.CreateModel(
15+
name="AIAgentWorkflowAction",
16+
fields=[
17+
(
18+
"builderworkflowaction_ptr",
19+
models.OneToOneField(
20+
auto_created=True,
21+
on_delete=django.db.models.deletion.CASCADE,
22+
parent_link=True,
23+
primary_key=True,
24+
serialize=False,
25+
to="builder.builderworkflowaction",
26+
),
27+
),
28+
(
29+
"service",
30+
models.ForeignKey(
31+
help_text="The service which this action is associated with.",
32+
on_delete=django.db.models.deletion.CASCADE,
33+
to="core.service",
34+
),
35+
),
36+
],
37+
options={
38+
"abstract": False,
39+
},
40+
bases=("builder.builderworkflowaction",),
41+
),
42+
]

backend/src/baserow/contrib/builder/workflow_actions/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,7 @@ class CoreHTTPRequestWorkflowAction(BuilderWorkflowServiceAction):
121121

122122
class CoreSMTPEmailWorkflowAction(BuilderWorkflowServiceAction):
123123
...
124+
125+
126+
class AIAgentWorkflowAction(BuilderWorkflowServiceAction):
127+
...

backend/src/baserow/contrib/builder/workflow_actions/workflow_action_types.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from baserow.contrib.builder.elements.element_types import NavigationElementManager
1717
from baserow.contrib.builder.formula_importer import import_formula
1818
from baserow.contrib.builder.workflow_actions.models import (
19+
AIAgentWorkflowAction,
1920
CoreHTTPRequestWorkflowAction,
2021
CoreSMTPEmailWorkflowAction,
2122
LocalBaserowCreateRowWorkflowAction,
@@ -30,6 +31,7 @@
3031
BuilderWorkflowActionType,
3132
)
3233
from baserow.contrib.builder.workflow_actions.types import BuilderWorkflowActionDict
34+
from baserow.contrib.integrations.ai.service_types import AIAgentServiceType
3335
from baserow.contrib.integrations.core.service_types import (
3436
CoreHTTPRequestServiceType,
3537
CoreSMTPEmailServiceType,
@@ -477,3 +479,13 @@ class CoreSMTPEmailActionType(BuilderWorkflowServiceActionType):
477479
def get_pytest_params(self, pytest_data_fixture) -> Dict[str, int]:
478480
service = pytest_data_fixture.create_core_smtp_email_service()
479481
return {"service": service}
482+
483+
484+
class AIAgentWorkflowActionType(BuilderWorkflowServiceActionType):
485+
type = "ai_agent"
486+
model_class = AIAgentWorkflowAction
487+
service_type = AIAgentServiceType.type
488+
489+
def get_pytest_params(self, pytest_data_fixture) -> Dict[str, int]:
490+
service = pytest_data_fixture.create_ai_agent_service()
491+
return {"service": service}

backend/src/baserow/contrib/integrations/ai/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)