Skip to content
Skills Library
Programming · Building & coding

core-graph

/core-graph

Use this skill when working on code involving Element/Page relationships in the Application Builder (contrib/builder) or AutomationNode/AutomationWorkflow relationships in the Automation Builder (contrib/automation). This includes bugs, new features, or refactoring involving node/element placement, element place_in_container, container elements, parent/child/sibling traversal, node edges, or next/previous navigation between points.

Repository
baserow ↗
Licence
MIT
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use this skill when working on code involving Element/Page relationships in the Application Builder (contrib/builder) or AutomationNode/AutomationWorkflow relationships in the Automation Builder (contrib/automation). This includes bugs, new features, or refactoring involving node/element placement, element place_in_container, container elements, parent/child/sibling traversal, node edges, or next/previous navigation between points.

Original author description

Use this skill when working on code involving Element/Page relationships in the Application Builder (contrib/builder) or AutomationNode/AutomationWorkflow relationships in the Automation Builder (contrib/automation). This includes bugs, new features, or refactoring involving node/element placement, element place_in_container, container elements, parent/child/sibling traversal, node edges, or next/previous navigation between points.

How it works

  1. What this is
  2. Core abstractions
  3. Design principles
  4. Key files
  5. How Application Builder uses it
  6. How Automation Builder uses it
  7. Common operations
  8. Common pitfalls
  9. Testing
Original SKILL.md headings · 68 lines, 734 words
SKILL.md preview
---
name: core-graph
description: Use this skill when working on code involving Element/Page relationships in the Application Builder (contrib/builder) or AutomationNode/AutomationWorkflow relationships in the Automation Builder (contrib/automation). This includes bugs, new features, or refactoring involving node/element placement, element place_in_container, container elements, parent/child/sibling traversal, node edges, or next/previous navigation between points.
---

# Core graph

## What this is

The `core/graph` package contains a reusable graph which the Application and Automation Builder (in `contrib/builder` and `contrib/automation` respectively) rely on.

In the Application Builder, it is used to manage and traverse the relationship between `Element`.

In the Automation Builder, it is used to manage and traverse the relationship between `AutomationNode`.

## Core abstractions

- A graph is made up of **points**. This term is deliberately abstract — what a point represents varies between modules (see "How X Builder uses it" sections below).
- An **edge** connects points. Edge semantics also vary per module (see "How X Builder uses it" sections below).
- Points can be **traversed** to determine the "next", "previous", and "parent" points.
- The graph itself is a **JSON object**.
- The graph is stored on a Django **container model** that implements `GraphModelMixin`. Individual **point models** implement `GraphPointMixin`, which provides helpers for traversal, parent access, edge labels, etc.
- An empty string (`""`) consistently represents the default/fallback edge throughout the system — in edge dictionaries, in `children` maps, and in migration from legacy formats.

## Design principles

- **`core/graph` must remain module-agnostic.** No references to `Element`, `AutomationNode`, or any other module-specific concept should appear in `core/graph` code.
- **Push module-specific logic out.** If a feature in the Application or Automation Builder has requirements specific to that module, the reusable parts belong in `core/graph` and the module-specific code belongs in the consuming module.

## Key files

- `src/baserow/core/graph/` - the directory containing the graph system.
- `tests/baserow/core/graph/` - the directory for all backend graph system tests.
- `src/baserow/core/graph/handler.py` — contains the `BaseGraphHandler`
- `src/baserow/core/graph/models.py` — contains the two Django `Model` mixins.


## How Application Builder uses it

- The container model is `Page`; the point model is `Element`.
- Most points won't have an edge, it'll just be a blank string. If, however, the element's parent implements `ContainerElementTypeMixin`, then its edge is the element's `place_in_container`. For example:
    - `element1` is a `ColumnElement` (so its type is `ColumnElementType`, which implements `ContainerElementTypeMixin`). This column has `column_amount=3`.
    - `element2` is a `HeadingElement`. We want it in the second column. We will make its parent `element1`, and set its `place_in_container` to "1".
- At the moment, there is at most one edge between elements, and it's always a string (whether blank, or a numeric `place_in_container`).

## How Automation Builder uses it

- The container model is `AutomationWorkflow`; the point model is `AutomationNode`.
- Points in automation builder can have one or more edges. They can be found by fetching the service, and calling `get_edges`. For example:
    - `node1` is an `AutomationNode`.
    - `service1 = node1.service.specific.get_type()` gives me `node1`'s service type.
    - `service1.get_edges()` returns a dictionary defining the edges between my nodes.
    - Most node services `get_edges` calls will return `{"": {"label": ""}}`. This represents a straight traversal without an edge name — the outer dictionary key of `""` is the default-edge convention (see Core abstractions). The `label` in the inner dictionary is a user-configured label they can see in the UI.
    - The `CoreRouterServiceType` however will return a UUID for the outer dictionary key, for each edge the user has configured, and a default edge (which is the fallback). E.g.
        - `{"condition1Uuid": {"label": "Condition1"}, "condition2Uuid": {"label": "Condition2"}, "": {"label": "Default fallback"}}`

## Common operations

- Given a container model instance, call `.get_graph()` to get the graph handler. This is the standard entry point for inserting, removing, or moving points. Example: `page.get_graph()` in the Application Builder, `workflow.get_graph()` in the Automation Builder.
- Given a point model instance, the `GraphPointMixin` methods provide traversal helpers (next/previous/parent), edge label access, and related operations. Prefer these over hand-rolling traversal logic.

## Common pitfalls

- In the graph, `children` does not contain *all* child points, only the "first" child of the container. To find *all* children, you must choose that first child point, and then keep traversing next until no points remain.
- It is possible to run into a "legacy" `children` that looks like this: `{"children": [7]}`. The `BaseGraphHandler` will support this, and migrate it to the new format: `{"children": {"": [7]}}` (the `""` key follows the default-edge convention described in Core abstractions).

## Testing

- Ensure any handler modifications are tested in its test file, `test_graph_handler.py`.
- Ensure any model mixin modifications are tested in their test file, `test_graph_models.py`.
- Test fixtures and configuration can be found in the test directory's `fixtures.py` and `conftest.py`.

Versions

The database has no other skills named core-graph.

Database snapshot: 13.11.2026 · package version 0a805cd84b60 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90Add Or Update Builder Element Type
    Add or update a Baserow Application Builder element type across backend models, backend ElementType registration, frontend element registry/components/forms/icons/translations, migrations, and targeted tests. Use when creating or changing an element shown in the builder…
  • 100test-data-builder
    Test Data Builder - Auto-activating skill for Test Automation. Triggers on: test data builder, test data builder Part of the Test Automation skill category. Use when writing or running tests. Trigger with phrases like "test data builder", "test builder", "test".
  • 100create-update-service
    Create or update Baserow integration and service types, including services exposed as Application Builder data sources, Builder workflow actions, Automation node actions, Automation node triggers, or dashboard data sources. Use when adding a ServiceType/IntegrationType subclass,…
  • 100global-library
    TIA Portal GlobalLibrary object model — traversal, element placement, type classification, MasterCopy routing, library file handling (.zap/.zal), and post-placement rename. Use when writing or reviewing C# code that opens a GlobalLibrary, traverses TypeFolder or…
  • 90Node-RED
    Node-RED visual automation flows for Home Assistant. Covers visual automation, flow JSON, trigger-state, api-call-service, function nodes, context storage, timer patterns, error handling, and node-red-contrib-home-assistant-websocket nodes. Use when user mentions "Node-RED",…
  • 100gpui-elements
    UI element creation and composition with GPUI. Use when building element trees, creating custom components, implementing layouts, or working with conditional rendering.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.