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 point | Role |
|---|---|
line_user.custom_attribute | The actual per-user values |
form_builder.field_attribute_mappings | Which attribute a submitted form field writes to |
import_mapping_job.mappings | CSV columns mapped onto custom.<key> |
audience.filter_info | Audience filter conditions |
friend_track_campaign.attribute_config | Attributes captured from a tracking link |
| Merge tags in rich messages / campaigns | Variables substituted at send time |
Related Files
prisma/schema.prisma:990— modelAttributeMasterprisma/schema.prisma:1586— modelSystemAttributemanual-sql/3.bank.sqlandmanual-sql/5.sql— the trigger that detects changes tocustom.<key>keysschema-dumps/2026-07-24/schema.sql:943and:2790
Connections to Other Services
- cms-api-go — serves the
attribute-masterandsystem-attributemodules; the number of attributes that can be created is capped byplan_limits.maxAttributes. - worker-go — reads these definitions when evaluating trigger rules and workflows, and when refreshing audiences.
- client-api-go — writes values into
custom_attributewhen a user submits a form or takes an action in LIFF. - Connects to LINE Friends, Audience, Form Builder and Workflow.