Skip to main content
Automations are now on v2. For documentation on the legacy v1 syntax, see Automations (Legacy).
Automations are formulas embedded in an entity. They use Python syntax rather than a proprietary formula language — so instead of learning a custom expression builder, you write what you mean:
self["Temperature"] = self["Density"] * self["Volume"]
Automations can calculate and update entity content and values:
self["Category"] = "Stability"
self.status_tag = ("Expired", "danger")
Each automation is sandboxed to the entity it belongs to — it uses Python syntax and runtime, but can only access the global variables listed below. There is no network access, no file system, and no imports. Automations can read the current entity and its related context, but can only write to the current entity. They are version-controlled with the rest of the entity.

Entity properties

Access built-in properties on self with dot notation. All are read-only except self.title and self.status_tag.
PropertyDescription
self.titleEntity title (writable)
self.status_tagStatus tag (writable) — set as (label, style) tuple
self.idEntity UUID
self.indexGlobal creation index (integer)
self.type_indexIndex within its type (instances only)
self.template_indexIndex within its template (instances only)
self.kind"type", "template", "variant", or "instance"
self.is_instance / self.is_templateKind checks
self.status"EDITABLE", "IN_REVIEW", or "FINISHED"
self.versionPublished version string, None if draft
self.created_at / self.updated_atTimestamps
self.created_byUser who created the entity
self.type / self.templateParent type or template entity
self.referenced_byEntities that reference this one (list)

Field access

Access fields using bracket notation with the field name exactly as it appears in the UI:
self["Reactor Temp (°C)"]
self["Lot Number"] = "LOT-2026-001"
Field names are case-sensitive and support spaces, special characters, and any characters you can use in a field name in the UI. What you see in the UI is what you write in the automation.
self["Mass (kg)"] = self["Density (kg/m³)"] * self["Volume (m³)"]
For full field access, use self.fields["Name"] to get the field object with .value and .config:
field = self.fields["Status"]
print(field.value)   # the current field value
print(field.config)  # field configuration (type, options, etc.)
This is useful when your automation logic depends on how a field is configured rather than just its value. self["Name"] is shorthand for self.fields["Name"].value.

Reference fields

Reference fields link to other entities. When a reference field is configured to allow multiple references, .value is a list of entities. When configured for a single reference, .value is a single entity (or None).
# Multi-reference field — iterate over the list
for item in self.fields["Materials"].value:
    print(item.title, item["Purity"])

# Single-reference field — access directly
supplier = self.fields["Supplier"].value
if supplier:
    print(supplier.title, supplier["Country"])
Each referenced entity supports the same bracket notation for reading its fields. References can cross systems — if the automation’s entity has access to a referenced system, it can read fields from entities in that system. Access entities that reference the current entity via self.referenced_by:
for ref in self.referenced_by:
    print(ref.title, ref.id)
self.referenced_by returns a read-only list of entities that have this entity in any of their reference fields (up to 100 most recent).

Status tags

Set the entity’s status tag with a tuple of (label, style):
self.status_tag = ("Approved", "success")
self.status_tag = ("Expired", "danger")

Title

Set the entity’s title directly:
self.title = f"{self['Compound']} — Batch {self['Batch Number']}"
Title is only controlled on instances — you can always edit a template’s title directly, but once an automation sets self.title on an instance, the title becomes read-only on that instance.

Controlled fields

When you save an automation, Seal analyses the code to determine which fields it writes to and marks them as controlled. Controlled fields cannot be manually edited — they only accept updates from the automation. This ensures that calculated values, IDs, and other derived data stay consistent and aren’t accidentally overwritten. For example, if your automation writes to self["Record ID"], that field becomes controlled and users will see it as read-only. If you remove the write from the automation and re-save, the field becomes editable again. Some properties like title are only controlled on instances, not on templates. Other field values are controlled wherever the automation runs.

Available globals

Automations have access to a limited set of globals:
GlobalDescription
selfThe current entity — read and write fields, status tag, and title
skip()Exit the automation early without making changes
datetimePython’s datetime module for date/time operations
timedeltaPython’s timedelta for duration calculations

Triggers

Automations run automatically — triggers are resolved from your code based on which fields and references the automation reads. When a dependency changes (a field value, a referenced entity, or a backlink), the automation re-runs. You can view the resolved triggers with the Show Triggers button next to the run button. You can also run an automation manually at any time to test it.