Skip to main content

Attribute Definitions & System Variables

Overview

Flexible customer data lives in line_user.custom_attribute, a JSONB column. A free-form column on its own is not enough, though — something has to act as the dictionary that says which keys genuinely exist, what type each holds, and how it should be displayed. That is the job of attribute_master.

Its counterpart is system_attribute, a set of channel-level variables not tied to any individual user. These hold shared values such as standard message text, promotion quotas, or figures a workflow needs to read.

Core Data Structure

attribute_master (model AttributeMaster)

Bound to a channel through line_oa_id (FK to line_oa.id, ON DELETE CASCADE) and organization_id, with descriptive name and description fields.

The heart of the table is the schema JSONB column, defaulting to {"version":"1.0","attributes":[]}. The key thing to understand is that the entire attribute list is stored in a single row — it is not one row per attribute.

A unique constraint covers (line_oa_id, organization_id, name), and deletion is soft via deleted_date.

system_attribute (model SystemAttribute)

Channel-level key/value storage, made up of key, value (TEXT), data_type (default string), description, and expires_at so values can expire.

The unique constraint uq_system_attribute_oa_org_key covers (line_oa_id, organization_id, key).

Where keys from attribute_master.schema are referenced

Reference pointRole
line_user.custom_attributeThe actual per-user values
form_builder.field_attribute_mappingsWhich attribute a submitted form field writes to
import_mapping_job.mappingsCSV columns mapped onto custom.<key>
audience.filter_infoAudience filter conditions
friend_track_campaign.attribute_configAttributes captured from a tracking link
Merge tags in rich messages / campaignsVariables substituted at send time
  • prisma/schema.prisma:990 — model AttributeMaster
  • prisma/schema.prisma:1586 — model SystemAttribute
  • manual-sql/3.bank.sql and manual-sql/5.sql — the trigger that detects changes to custom.<key> keys
  • schema-dumps/2026-07-24/schema.sql:943 and :2790

Connections to Other Services

  • cms-api-go — serves the attribute-master and system-attribute modules; the number of attributes that can be created is capped by plan_limits.maxAttributes.
  • worker-go — reads these definitions when evaluating trigger rules and workflows, and when refreshing audiences.
  • client-api-go — writes values into custom_attribute when a user submits a form or takes an action in LIFF.
  • Connects to LINE Friends, Audience, Form Builder and Workflow.