custom_variable
Internal beta โ config shape is being migrated
The Automation API is an internal beta and is not released yet โ endpoints and payloads may change or be
withdrawn without notice. This action's config is being migrated to a typed schema; the fields below reflect that
in-progress shape. Always read the authoritative, live shape from
GET /v1/automation/meta/action before building against it.
Set variable โ computes and assigns custom variables for use by its own code and later actions. group: "action". No specific trigger context is required.
Part of the Code & variables family. This page
documents the typed config; for how an action sits inside an automation definition, see
Actions and Action examples.
Configโ
| Key | Type | Required | Description |
|---|---|---|---|
assignment_code | code value | yes | The code that computes and assigns the declared custom variables. |
custom_variable_defs | array of objects | no | Custom variables this action declares for its own code and later actions. Each entry is { custom_type, label }. Empty when omitted. |
custom_variable_defs[].custom_type tokens (lower-case): any, single_file, multi_file, single_link,
html_table_rows. Each entry also carries a label string. Both custom_type and label are required on an entry.
Exampleโ
An action entry inside an automation definition's actions[]:
{
"type": "custom_variable",
"config": {
"assignment_code": ["return { total: ", { "kind": "variable", "source": "meta", "meta_type": "app_record_id" }, " }"],
"custom_variable_defs": [
{ "custom_type": "any", "label": "Total" }
]
}
}
Validation & behaviorโ
assignment_codeis the only required member โ it has no canonical default.custom_variable_defsdefaults to[]when omitted.- Each
custom_variable_defsentry requires bothcustom_type(one of the tokens above) andlabel. - The declared variables become available to this action's own code and to later actions in the definition.
- Beta caveat: with
custom_variable_defsempty, the action still validates but has nothing to assign โ it silently no-ops with no per-action log. Declare at least one entry for the action to do work. (beta โ seeGET /v1/automation/meta/action.)
See alsoโ
- Dynamic values โ code values and references
- Action examples ยท Actions catalog