@wix/agent-skills 1.32.0 → 1.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/package.json +2 -2
- package/skills/wix-app/references/DASHBOARD_PAGE.md +1 -1
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +40 -41
- package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +11 -6
- package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +2 -3
- package/skills/wix-app/references/editor-react-component/DISABLED-INVALID.md +31 -0
- package/skills/wix-app/references/editor-react-component/MANIFEST-ERRORS.md +14 -1
- package/skills/wix-app/references/editor-react-component/PARTS.md +32 -3
- package/skills/wix-app/references/editor-react-component/SSR.md +6 -3
- package/skills/wix-headless-kit/install/pins.json +1 -1
- package/skills/wix-manage/SKILL.md +25 -7
- package/skills/wix-manage/references/automations/actions.md +11 -11
- package/skills/wix-manage/references/automations/activation-status.md +6 -9
- package/skills/wix-manage/references/automations/api-catalog.md +48 -32
- package/skills/wix-manage/references/automations/automation-model.md +97 -22
- package/skills/wix-manage/references/automations/bracket-expressions.md +7 -7
- package/skills/wix-manage/references/automations/build-and-manage-automations.md +140 -309
- package/skills/wix-manage/references/automations/conditions.md +187 -0
- package/skills/wix-manage/references/automations/schemas-and-scheduling.md +191 -0
- package/skills/wix-manage/references/automations/special-actions.md +210 -0
- package/skills/wix-manage/references/automations/triggers.md +47 -10
- package/skills/wix-manage/references/automations/validation-and-verification.md +320 -0
- package/skills/wix-manage/references/custom-apps/use-app-tools.md +124 -0
- package/skills/wix-manage/references/events/create-wix-event.md +136 -73
- package/skills/wix-manage/references/events/manage-event-guests.md +366 -0
- package/skills/wix-manage/references/events/manage-event-tickets.md +293 -0
- package/skills/wix-manage/references/events/manage-wix-events.md +313 -55
- package/skills/wix-manage/references/stores/update-product-with-options.md +58 -2
- package/skills/wix-manage/references/custom-apps/use-app-skills-and-app-tools.md +0 -208
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "Automations Activation Status"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Inspect or change active status with lock checks, revision handling and read-back, without requiring unrelated repairs before deactivation."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **Stage scope:** this stage covers only what [Build and Manage Wix Automations](https://dev.wix.com/docs/api-reference/business-management/automations/skills/build-and-manage-wix-automations) lists; do not perform any workflow that needs a guide marked "not yet published". "Stage" and "not yet published" describe how this skill is being rolled out; never mention them to the user. Explain a limit in product terms: what can't be done through the API here and where the user can do it instead (for example, in the automations builder).
|
|
7
|
-
|
|
8
6
|
# Activation status and lifecycle
|
|
9
7
|
|
|
10
8
|
**What the public API can see.** An automation's live state is `configuration.status` —
|
|
@@ -12,8 +10,7 @@ description: "Read an automation’s current ACTIVE or INACTIVE status, and acti
|
|
|
12
10
|
Status does not show whether past runs succeeded. There is no separate
|
|
13
11
|
"published" flag and no public draft API:
|
|
14
12
|
|
|
15
|
-
- **Status check** = Get
|
|
16
|
-
short answer that starts with the automation's name and returned ID;
|
|
13
|
+
- **Status check** = Query by name (if no ID) → Get the single matching ID → read that Get response’s `configuration.status`. Query is discovery only: never answer from its status projection, even if it includes one. Report the name, returned ID and status, explaining ACTIVE as eligible for new trigger events and INACTIVE as not eligible;
|
|
17
14
|
never infer it from the name or from your own earlier writes. If several automations match the
|
|
18
15
|
supplied name, list each one's returned ID and end with a direct question such as "Which one
|
|
19
16
|
do you mean?"; don't report a single status. If no automation matches the supplied name, say
|
|
@@ -44,10 +41,10 @@ Status does not show whether past runs succeeded. There is no separate
|
|
|
44
41
|
1. Get Automation with `fields: ["OVERRIDE_SCHEMA"]` → current `revision`, `origin`, `settings`.
|
|
45
42
|
If `settings.disableStatusChange`
|
|
46
43
|
or `settings.readonly` is true, stop and report the lock: the owning app doesn't allow it
|
|
47
|
-
(
|
|
44
|
+
([Automations Validation and Persistence — included update restrictions](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-validation-and-persistence)).
|
|
48
45
|
2. Already `ACTIVE` → report it and stop (idempotent; no write).
|
|
49
|
-
3. Set only the candidate's status to `ACTIVE`, then apply the §4 checklist in [
|
|
50
|
-
an automation that doesn't validate. Preserve existing supported configurations as the §4 checklist in [
|
|
46
|
+
3. Set only the candidate's status to `ACTIVE`, then apply the §4 checklist in [Automations Validation and Persistence](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-validation-and-persistence) and full Validate — never activate
|
|
47
|
+
an automation that doesn't validate. Preserve existing supported configurations as the §4 checklist in [Automations Validation and Persistence](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-validation-and-persistence) explains.
|
|
51
48
|
4. Explicit activation instructions authorize this change; do not ask again. If the user only
|
|
52
49
|
asked to build or inspect it, obtain authorization before making it eligible for real runs.
|
|
53
50
|
5. Update Automation with the object exactly as fetched, `configuration.status: "ACTIVE"`, and
|
|
@@ -59,7 +56,7 @@ Status does not show whether past runs succeeded. There is no separate
|
|
|
59
56
|
**Deactivate** (on explicit request): Get the complete object with override schemas; check
|
|
60
57
|
`settings.disableStatusChange` and `settings.readonly`; already INACTIVE means no write.
|
|
61
58
|
Otherwise change only `configuration.status` to `INACTIVE`, preserving origin, settings,
|
|
62
|
-
revision, schemas and all nodes, then Update and read back the returned id. **Do not run the §4 checklist in [
|
|
59
|
+
revision, schemas and all nodes, then Update and read back the returned id. **Do not run the §4 checklist in [Automations Validation and Persistence](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-validation-and-persistence) or
|
|
63
60
|
Validate as a prerequisite**, and do not repair or remove unrelated invalid/legacy steps.
|
|
64
61
|
An explicit request to turn it off is sufficient authorization. Deactivating prevents new
|
|
65
62
|
triggered runs; it is not proof that every pending/running activation has stopped or will finish.
|
|
@@ -3,7 +3,7 @@ name: "Automations API Catalog"
|
|
|
3
3
|
description: "Discover site-specific triggers and actions, authenticate public Automation API calls, and choose the API for validation, persistence or catalog lookups."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **Stage scope:** this stage covers only what [Build and Manage Wix Automations](https://dev.wix.com/docs/api-reference/business-management/automations/skills/build-and-manage-wix-automations) lists; do not perform anything marked "Later stages only"
|
|
6
|
+
> **Stage scope:** this stage covers only what [Build and Manage Wix Automations](https://dev.wix.com/docs/api-reference/business-management/automations/skills/build-and-manage-wix-automations) lists; do not perform anything marked "Later stages only", and follow the instruction attached to each guide marked "not yet published". "Stage", "Later stages only" and "not yet published" describe how this skill is being rolled out; never mention them to the user. Explain a limit in product terms: what can't be done through the API here and where the user can do it instead (for example, in the automations builder).
|
|
7
7
|
|
|
8
8
|
# API Catalog — the public Wix Automations APIs
|
|
9
9
|
|
|
@@ -16,19 +16,19 @@ docs URL to get raw markdown. When a field name here and the docs disagree, the
|
|
|
16
16
|
|
|
17
17
|
- Catalogs: Resolve Triggers / Resolve Actions. Oracle: **Validate Automation** — Create and
|
|
18
18
|
Update do **not** validate.
|
|
19
|
-
- Persist: Create `INACTIVE` → Get read-back; activate only when asked.
|
|
20
|
-
Procedures (create, activate, read-back
|
|
21
|
-
— builder drafts are invisible publicly): [
|
|
22
|
-
- **
|
|
19
|
+
- Persist: Create `INACTIVE` → Get read-back; activate only when asked. Updates need the current
|
|
20
|
+
`revision` and are **live** on an active automation. Procedures (create, update, activate, read-back
|
|
21
|
+
— builder drafts are invisible publicly): [Automations Validation and Persistence](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-validation-and-persistence) §3.
|
|
22
|
+
- **Test Automation runs actions for real** — only with explicit user authorization.
|
|
23
23
|
- Resolve responses are large: page small, filter by exact keys, never paste a raw catalog.
|
|
24
24
|
|
|
25
25
|
## 1. Authentication and transport
|
|
26
26
|
|
|
27
27
|
- **Permission scope**: **Set Up Automations** (`SCOPE.CRM.SETUP-AUTOMATIONS`) for every
|
|
28
|
-
Automations method below.
|
|
29
|
-
Email Marketing** (`SCOPE.DC-PROMOTE.EMAIL-MARKETING`)
|
|
28
|
+
Automations method below. Email steps are added in the automations builder, so no **Manage
|
|
29
|
+
Email Marketing** (`SCOPE.DC-PROMOTE.EMAIL-MARKETING`) scope is needed here.
|
|
30
30
|
Entity lookups in other verticals need that vertical's read scope
|
|
31
|
-
(Automations Entity and Provider Configuration (not yet published)).
|
|
31
|
+
(Automations Entity and Provider Configuration (topic guide not yet published; consult the [Automations API reference](https://dev.wix.com/docs/api-reference/business-management/automations))).
|
|
32
32
|
- **Token**: `Authorization: <token>` header — an OAuth app access token (`client_credentials` via
|
|
33
33
|
Create Access Token) or an account API key the site owner generated with the needed scopes.
|
|
34
34
|
- **Site context**: with an **API key**, send `wix-site-id: <metaSiteId>` on every call (all calls
|
|
@@ -44,17 +44,15 @@ docs URL to get raw markdown. When a field name here and the docs disagree, the
|
|
|
44
44
|
confirmed. If anything points at another site, stop.
|
|
45
45
|
- **Errors**: 401 = token expired/invalid (refresh, don't retry blindly). 403 = missing scope, app
|
|
46
46
|
not installed, or — on Create/Update of an automation that validated — a step the public API
|
|
47
|
-
can't create (e.g. the code-variable step,
|
|
47
|
+
can't create (e.g. the code-variable step, [Automations Delays Variables and Branches](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-delays-variables-and-branches) §4). A timeout or 5xx is
|
|
48
48
|
**unknown**, not a verdict — retry read-only calls (Get, Query, Resolve, Validate) a bounded
|
|
49
49
|
number of times. Never blindly retry Create or Update: Query or Get first to see whether the
|
|
50
|
-
write landed ([
|
|
50
|
+
write landed ([Automations Validation and Persistence](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-validation-and-persistence) §3, Reporting rules).
|
|
51
51
|
|
|
52
52
|
## 2. Automations V2 (`automationsV2`) — base `/automations-service/v2/automations`
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
| Purpose | REST | SDK |
|
|
57
|
-
| -------- | ----------------------------------------------------------- | ----------------------------------------- |
|
|
54
|
+
| Purpose | REST | SDK |
|
|
55
|
+
| -------- | ---------------------------------------------------------------------------------- | ----------------------------------------- |
|
|
58
56
|
| Validate | `POST https://www.wixapis.com/automations-service/v2/automations/validate` | `validateAutomation(automation, options)` |
|
|
59
57
|
| Create | `POST https://www.wixapis.com/automations-service/v2/automations` | `createAutomation(automation)` |
|
|
60
58
|
| Get | `GET https://www.wixapis.com/automations-service/v2/automations/{automationId}` | `getAutomation(automationId)` |
|
|
@@ -65,7 +63,7 @@ docs URL to get raw markdown. When a field name here and the docs disagree, the
|
|
|
65
63
|
- **Validate** (unsaved or saved): `{automation, validationSettings?{actionIds[],
|
|
66
64
|
skipProviderValidations}}` → `{status: VALID|VALID_WITH_WARNINGS|INVALID,
|
|
67
65
|
triggerValidationErrors[], actionValidationErrors[]}`. The main oracle; send the full object.
|
|
68
|
-
Reading errors: [
|
|
66
|
+
Reading errors: [Automations Validation and Persistence](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-validation-and-persistence) §2.
|
|
69
67
|
- **Create**: `{automation}` with `name`, `origin: "USER"`, `configuration{status, trigger{appId,
|
|
70
68
|
triggerKey}, rootActionIds, actions}` → created `automation` (has `id`, `revision`). Does NOT
|
|
71
69
|
validate. Always `status: "INACTIVE"`; don't send `settings`.
|
|
@@ -74,8 +72,16 @@ triggerKey}, rootActionIds, actions}` → created `automation` (has `id`, `revis
|
|
|
74
72
|
request them: `fields: ["OVERRIDE_SCHEMA"]` (REST `?fields=OVERRIDE_SCHEMA`). Without it their
|
|
75
73
|
absence is not data loss (Create's response omits them too).
|
|
76
74
|
Request overrides before complete-object updates and status changes too, not just creation read-back.
|
|
77
|
-
- **Update**:
|
|
78
|
-
|
|
75
|
+
- **Update**: `{automation}` incl. `id` and current `revision` → updated `automation` (revision
|
|
76
|
+
+1). Does NOT validate. Send the complete merged `name` + `configuration`, **plus `origin` and
|
|
77
|
+
`settings` exactly as fetched** — an Update without them fails `INVALID_ORIGIN_TYPE`. A
|
|
78
|
+
`fieldMask` (if your client exposes one) only selects what changes — set it to
|
|
79
|
+
`configuration,name` (what the builder sends); it doesn't exempt you from sending `origin` /
|
|
80
|
+
`settings`. A stale `revision` is rejected. Changes are LIVE when `status` is `ACTIVE`. A success
|
|
81
|
+
response and a revision bump do **not** prove the change landed — merge, conflict handling and
|
|
82
|
+
read-back comparison: [Automations Validation and Persistence](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-validation-and-persistence) §3.
|
|
83
|
+
Capture the returned id: creating a site override of a preinstalled automation can change it.
|
|
84
|
+
- **Delete**: → `{}`. Irreversible; only on explicit user request.
|
|
79
85
|
- **Query**: `{query{filter, sort, cursorPaging{limit ≤ 500, cursor}}}` → `automations[]`,
|
|
80
86
|
`pagingMetadata.cursors.next`. Returns only automations of apps installed on the site (incl.
|
|
81
87
|
overridden preinstalled ones), and never unpublished builder drafts. Full objects are large —
|
|
@@ -85,12 +91,12 @@ triggerKey}, rootActionIds, actions}` → created `automation` (has `id`, `revis
|
|
|
85
91
|
Automation object fields and limits (`name` ≤ 100 for the builder, `description` ≤ 2000,
|
|
86
92
|
`origin`, `settings`, `configuration`): [Automations Graph and Data Model](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-graph-and-data-model) §1.
|
|
87
93
|
Create/Update accept `configuration.trigger.automationConfigMapping` for scheduled/custom/webhook
|
|
88
|
-
configuration even where the docs omit it; use [Automations Trigger Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-trigger-configuration) / Automations Schemas and Scheduling
|
|
94
|
+
configuration even where the docs omit it; use [Automations Trigger Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-trigger-configuration) / [Automations Schemas and Scheduling](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-schemas-and-scheduling).
|
|
89
95
|
|
|
90
96
|
## 3. Trigger Catalog (`triggerCatalog`)
|
|
91
97
|
|
|
92
|
-
| Purpose | REST
|
|
93
|
-
| ---------------------- |
|
|
98
|
+
| Purpose | REST | SDK |
|
|
99
|
+
| ---------------------- | ------------------------------------------------------------------------ | ----------------------------------------------- |
|
|
94
100
|
| Triggers on this site | `POST https://www.wixapis.com/v1/triggers/resolve` | `resolveTriggers(options)` |
|
|
95
101
|
| Global catalog | `POST https://www.wixapis.com/v1/triggers/query` | `queryTriggers(query)` |
|
|
96
102
|
| One trigger | `GET https://www.wixapis.com/v1/triggers/apps/{appId}/keys/{triggerKey}` | `getTriggerByAppIdAndKey(identifiers, options)` |
|
|
@@ -117,8 +123,8 @@ payload schema ([Automations Trigger Configuration](https://dev.wix.com/docs/api
|
|
|
117
123
|
|
|
118
124
|
## 4. Action Catalog (`actionCatalog`)
|
|
119
125
|
|
|
120
|
-
| Purpose | REST
|
|
121
|
-
| -------------------------- |
|
|
126
|
+
| Purpose | REST | SDK |
|
|
127
|
+
| -------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------- |
|
|
122
128
|
| Actions on this site | `POST https://www.wixapis.com/v1/actions/resolve` | `resolveActions(options)` |
|
|
123
129
|
| Global catalog | `POST https://www.wixapis.com/v1/actions/query` (and `/query-latest`) | `queryActions(query)`, `queryLatestActions` |
|
|
124
130
|
| Version active on the site | `GET https://www.wixapis.com/v1/actions/apps/{appId}/keys/{actionKey}` | `getRuntimeAction(identifiers)` |
|
|
@@ -138,13 +144,12 @@ payload schema ([Automations Trigger Configuration](https://dev.wix.com/docs/api
|
|
|
138
144
|
- **Dynamic output**: `{appId, actionKey, inputMapping}` → `outputSchema`; bulk
|
|
139
145
|
(`bulkGetActionDynamicOutputSchemas`, POST `/v1/actions/bulk/dynamic-output-schema`, ≤ 20 items) →
|
|
140
146
|
`results[]{itemMetadata{success, error}, outputSchema}`. Only after that action's mapping is
|
|
141
|
-
final.
|
|
142
|
-
says which are dynamic); an error means "no dynamic output" — keep the static `outputSchema`.
|
|
147
|
+
final. For `wix_automations-llm_call` fields defined by your output configuration, declare an override directly ([Automations Schemas and Scheduling](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-schemas-and-scheduling) §3); do not call this SPI to discover fields you chose yourself. For other upstream actions whose configured output is needed, this is a read-only discovery call (no public flag says which are dynamic); an error does not establish additional fields — keep the static `outputSchema`.
|
|
143
148
|
Merge into the static schema. A failed bulk item = unknown schema, not empty.
|
|
144
149
|
- **Generate Input Mapping From Intent** (`POST https://www.wixapis.com/v1/actions/generate-input-mapping-from-intent`)
|
|
145
150
|
is AI-backed — don't call it. For actions you can't map from their schema, tell the user they can't be configured through the API here and can be set up in the automations builder.
|
|
146
|
-
- **Later stages only — email is outside stage
|
|
147
|
-
- **Later stages only — email is outside stage
|
|
151
|
+
- **Later stages only — email is outside stage 3:** **Email content of an existing Send an email step** — Get / Set Email Content; procedure in Automations Email Actions (not yet published; email configuration is outside stage 3).
|
|
152
|
+
- **Later stages only — email is outside stage 3:** **New Send an email step** — Generate Action Input Mapping; procedure in Automations Email Actions (not yet published; email configuration is outside stage 3).
|
|
148
153
|
|
|
149
154
|
Action objects: `appId`, `actionKey`, `displayName`, `description`, `inputSchema`, `outputSchema`,
|
|
150
155
|
`interfaceConfiguration{type: GENERIC\|WIDGET_COMPONENT, genericOptions.uiSchema}`,
|
|
@@ -153,8 +158,12 @@ Action objects: `appId`, `actionKey`, `displayName`, `description`, `inputSchema
|
|
|
153
158
|
|
|
154
159
|
## 5. Activations (`activations`)
|
|
155
160
|
|
|
156
|
-
- **
|
|
157
|
-
|
|
161
|
+
- **Test Automation** — `POST https://www.wixapis.com/automations/v1/events/test-automation`,
|
|
162
|
+
`testAutomation(identifierType, options)`: `{identifierType: "AUTOMATION",
|
|
163
|
+
automationIdentifier{automationId}, payload}` → `activationId`. **Runs every action for real**
|
|
164
|
+
(skips delays, works on INACTIVE) — explicit user authorization only; payload, consent and
|
|
165
|
+
reporting: [Automations Validation and Persistence](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-validation-and-persistence) §5.
|
|
166
|
+
- **Run Automation / Report Event / Rerun Activation** — for the app that owns a trigger; never
|
|
158
167
|
use them to build or "test".
|
|
159
168
|
|
|
160
169
|
## 6. Catalog discovery without flooding your context
|
|
@@ -188,13 +197,13 @@ Discovery hints:
|
|
|
188
197
|
- Search by concept with a keyword ladder ("chat" → "message"). Common aliases: send a chat
|
|
189
198
|
message to the contact = `send-message` (not `inbox-send-message`); a note about a contact in
|
|
190
199
|
the site owner's Inbox, nothing sent to the contact = `inbox-send-message` ("Show in Inbox");
|
|
191
|
-
email to anyone, incl. the site
|
|
200
|
+
email (added by the user in the automations builder here) to anyone, incl. the site
|
|
192
201
|
owner = `triggered-emails` (never the deprecated `send-mail` / "Get an email"); task =
|
|
193
202
|
`createTask`; labels = `addLabelsToContact` / `remove_labels_to_contact`; create a contact =
|
|
194
203
|
`contacts-create_contact` (for triggers whose payload has no contact, e.g. webhooks).
|
|
195
204
|
- Near-duplicates exist (`booking_canceled` vs `bookings_canceled`; new Wix Forms app vs legacy
|
|
196
205
|
"Form submitted"). Compare payload schemas and filters; prefer the one whose entities you can
|
|
197
|
-
actually find on the site (Automations Entity and Provider Configuration (not yet published)).
|
|
206
|
+
actually find on the site (Automations Entity and Provider Configuration (topic guide not yet published; consult the [Automations API reference](https://dev.wix.com/docs/api-reference/business-management/automations))).
|
|
198
207
|
- Enum-like fields often list legal values only in the field `description` (e.g. paymentStatus
|
|
199
208
|
NOT_PAID / PAID). Read descriptions before mapping user words; never invent enum values.
|
|
200
209
|
|
|
@@ -205,9 +214,16 @@ variables + identity enrichment. Recipe and fetch order: [Automations Graph and
|
|
|
205
214
|
|
|
206
215
|
## 8. Selector options and APIs with limitations
|
|
207
216
|
|
|
208
|
-
|
|
217
|
+
**Entity ids** (forms, labels, services, pipeline stages…): resolve them with the owning vertical's public API, following that vertical's API reference, or ask the user for the exact entity. Never save a display name, invent an id or guess an endpoint.
|
|
218
|
+
|
|
219
|
+
**Not public or not available through the general Automations API:**
|
|
209
220
|
|
|
210
|
-
**
|
|
221
|
+
- **Draft automations** → create `INACTIVE`; the user activates. Builder drafts are invisible.
|
|
222
|
+
- **Site-action generation** → §3 of Automations Entity and Provider Configuration (topic guide not yet published; consult the [Automations API reference](https://dev.wix.com/docs/api-reference/business-management/automations)).
|
|
223
|
+
- **Send an email steps** → not configurable through the API here; the user adds them in the automations builder.
|
|
224
|
+
- **Expression parsing/evaluation, code runner** → local checks ([Automations Mapping Expressions](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-mapping-expressions),
|
|
225
|
+
[Automations Conditions](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-conditions)), then Validate Automation.
|
|
226
|
+
- **Validate by id** → Get Automation, then Validate the returned object.
|
|
211
227
|
|
|
212
228
|
## Related API references
|
|
213
229
|
|
|
@@ -3,8 +3,6 @@ name: "Automations Graph and Data Model"
|
|
|
3
3
|
description: "Assemble builder-editable automation graphs with valid node relationships, namespaces and ancestor data access."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **Stage scope:** this stage covers only what [Build and Manage Wix Automations](https://dev.wix.com/docs/api-reference/business-management/automations/skills/build-and-manage-wix-automations) lists; do not perform anything marked "Later stages only" or any workflow that needs a guide marked "not yet published". "Stage", "Later stages only" and "not yet published" describe how this skill is being rolled out; never mention them to the user. Explain a limit in product terms: what can't be done through the API here and where the user can do it instead (for example, in the automations builder).
|
|
7
|
-
|
|
8
6
|
# Automation Model — Object, Graph Rules, Payload Scope
|
|
9
7
|
|
|
10
8
|
**TL;DR**
|
|
@@ -19,14 +17,12 @@ description: "Assemble builder-editable automation graphs with valid node relati
|
|
|
19
17
|
|
|
20
18
|
## 1. The Automation object (public API)
|
|
21
19
|
|
|
22
|
-
> In this stage you create only APP_DEFINED steps. The other step types below are documented so you can read and preserve existing automations, not to author them here.
|
|
23
|
-
|
|
24
20
|
| Field | Rules |
|
|
25
21
|
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
26
22
|
| `id`, `revision` | Read-only. `revision` MUST be sent back on Update Automation (§6). |
|
|
27
23
|
| `name` | Required, 1–100 chars (API allows 500; the builder holds 100); the business outcome ("Send welcome email to new subscribers"). |
|
|
28
24
|
| `description` | Optional, ≤2000 chars. |
|
|
29
|
-
| `origin` | Required on create, immutable. `USER` for anything you create. `APPLICATION`/`PREINSTALLED` carry update locks (
|
|
25
|
+
| `origin` | Required on create, immutable. `USER` for anything you create. `APPLICATION`/`PREINSTALLED` carry update locks ([Automations Validation and Persistence — included update restrictions](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-validation-and-persistence)). |
|
|
30
26
|
| `settings` | Locks for APPLICATION/PREINSTALLED (`readonly`, `actionSettings`, …). Never set it on create; on Update send it back exactly as fetched. |
|
|
31
27
|
| `configuration.status` | Required, `ACTIVE` \| `INACTIVE`. Create `INACTIVE`; activate only on request. |
|
|
32
28
|
| `configuration.trigger` | `{appId, triggerKey, filters[], scheduledEventOffset?, overrideSchema?, automationConfigMapping?}` — [Automations Trigger Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-trigger-configuration). |
|
|
@@ -36,9 +32,9 @@ description: "Assemble builder-editable automation graphs with valid node relati
|
|
|
36
32
|
Action (common fields):
|
|
37
33
|
|
|
38
34
|
- `id` — uuid v4, equal to its map key.
|
|
39
|
-
- `type` — `APP_DEFINED`, `CONDITION`, `CODE_CONDITION`, `DELAY`, `RATE_LIMIT`, `SET_VARIABLES`, `SPLIT` (the last two are not yet in the public API docs, but the builder supports them — Automations Delays Variables and Branches
|
|
35
|
+
- `type` — `APP_DEFINED`, `CONDITION`, `CODE_CONDITION`, `DELAY`, `RATE_LIMIT`, `SET_VARIABLES`, `SPLIT` (the last two are not yet in the public API docs, but the builder supports them — [Automations Delays Variables and Branches](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-delays-variables-and-branches)). NEVER `UNKNOWN_ACTION_TYPE`, NEVER `MERGE`.
|
|
40
36
|
- `namespace` — 1–100 chars, unique except the shared `setVariable` namespace (§3). Outputs of this step appear under it.
|
|
41
|
-
- `displayName` — optional but always set it: 1–60 chars, sentence case, purpose-specific (
|
|
37
|
+
- `displayName` — optional but always set it: 1–60 chars, sentence case, purpose-specific ([Automations Delays Variables and Branches](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-delays-variables-and-branches) §7). Absent → the canvas shows the catalog name.
|
|
42
38
|
- `skipActionExpression` — absent (runs) or exactly `"{{true}}"` (skipped), the only value the builder writes. A skipped step adds NO outputs downstream (§4).
|
|
43
39
|
- exactly one `*Info` matching `type`: `appDefinedInfo`, `conditionInfo`, `codeConditionInfo`, `delayInfo`, `rateLimitInfo`, `setVariablesInfo`, `splitInfo`.
|
|
44
40
|
|
|
@@ -50,7 +46,7 @@ Action (common fields):
|
|
|
50
46
|
4. **No orphans.** An action unreachable from the root is deleted by the builder on the next save.
|
|
51
47
|
5. **No cycles.** Forward only.
|
|
52
48
|
6. **Empty array = the path ends** there. Use `[]`, never omit the field.
|
|
53
|
-
7. **Parallel fan-out only via SPLIT** (
|
|
49
|
+
7. **Parallel fan-out only via SPLIT** ([Automations Delays Variables and Branches](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-delays-variables-and-branches) §5). Never two root ids, never two ids in one field.
|
|
54
50
|
8. **No MERGE.** The API has a `MERGE` type and `conditionInfo.mergeActionId`, but the canvas cannot draw them (MERGE nodes never finish loading). Never create either; when you read an automation that has them, preserve them untouched and don't add more.
|
|
55
51
|
|
|
56
52
|
### Builder rendering MUSTs (graph level)
|
|
@@ -59,20 +55,31 @@ Action (common fields):
|
|
|
59
55
|
- MUST: `actions[k].id === k` for every entry.
|
|
60
56
|
- MUST: ids are unique across ALL of: action ids, SPLIT path ids, the `triggerKey` string (it is the trigger node's id), and the builder's synthetic ids `<id>true`, `<id>false`, `<id>-end`, `<id>true-end`. Duplicates crash the layout. Generate every id as a fresh uuid v4 in code; never reuse ids from these references.
|
|
61
57
|
- MUST: each action carries ONLY its own type's `*Info`. The canvas ignores `type` when finding children and takes the first present of `appDefinedInfo → delayInfo → rateLimitInfo → setVariablesInfo → condition` — even an empty leftover `appDefinedInfo: {postActionIds: []}` on a CONDITION hides both branches.
|
|
62
|
-
- MUST: at most one RATE_LIMIT, and only as the root (
|
|
58
|
+
- MUST: at most one RATE_LIMIT, and only as the root ([Automations Delays Variables and Branches](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-delays-variables-and-branches) §2). A non-root RATE_LIMIT node spins forever.
|
|
63
59
|
- MUST: APP_DEFINED `appId` + `actionKey` match the site's action catalog, else the node shows "Action not available".
|
|
64
60
|
|
|
65
61
|
### Designing within the tree
|
|
66
62
|
|
|
67
|
-
|
|
63
|
+
- **Several independent actions** ("send an email and post a chat message") → chain them A → B → C, most time-sensitive first. Use SPLIT only when the user wants them to run at the same time. Never claim parallel execution is impossible.
|
|
64
|
+
- **Branch, then continue** ("if A, also do A2; after 6h send Y to everyone") → DUPLICATE every later stage into BOTH branches with fresh ids and namespaces (variable steps keep `setVariable`, with fresh variable keys and updated downstream references). A **Send an email** in a duplicated stage is added by the user in each branch — never copy an existing step's `messageId` / `templateId` / `uniqueRuleId`: both steps would share one email, so editing one changes both and deleting one can delete the shared email. Never point both branches at the same action. Never use a "gate" where the TRUE branch does its side-action and stops while the timeline should continue.
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
initial > Check A?
|
|
68
|
+
true > doA > Delay(A) > finalStep(A)
|
|
69
|
+
false > Delay(B) > finalStep(B) // Delay/finalStep duplicated, never shared
|
|
70
|
+
```
|
|
68
71
|
|
|
69
|
-
**
|
|
72
|
+
- **Delay arithmetic when duplicating**: branches that share an absolute deadline anchored at the trigger must each sum to it. "Chat now; if price>100 wait 2h then email; at 24h remind everyone" ⇒ true: 2h delay > email > **22h** delay > reminder; false: 24h delay > reminder. Compute residuals explicitly — copying 24h into both branches double-delays the true branch.
|
|
73
|
+
- **Repeated logic** after different conditions = separate actions with identical configuration but new ids and namespaces.
|
|
70
74
|
|
|
71
75
|
### Only model what the user asked for
|
|
72
76
|
|
|
73
|
-
|
|
77
|
+
Add a condition/delay ONLY for explicit flow control ("if X, do a DIFFERENT step Y", "after 2 days"). Audience/copy framing is CONTENT, not a condition:
|
|
74
78
|
|
|
75
|
-
|
|
79
|
+
- "a VIP follow-up email for high-value customers" → one email, VIP copy, no condition.
|
|
80
|
+
- "if order > $200 mention priority packing" → email copy detail, no branch.
|
|
81
|
+
- "if order > $200 ALSO create a task" → real flow control → condition.
|
|
82
|
+
Test: does a DIFFERENT step run based on the check? Yes → condition; no → one plain action.
|
|
76
83
|
|
|
77
84
|
## 3. Namespaces
|
|
78
85
|
|
|
@@ -83,7 +90,7 @@ Use the builder's own convention (it derives new indexes from the trailing numbe
|
|
|
83
90
|
| APP_DEFINED | `<actionKey>-<N>` (e.g. `triggered-emails-3`) |
|
|
84
91
|
| CONDITION and CODE_CONDITION | `CONDITION-<N>` |
|
|
85
92
|
| DELAY / SPLIT / RATE_LIMIT | `<TYPE>-<N>` (e.g. `DELAY-2`, `SPLIT-5`, `RATE_LIMIT-1`) |
|
|
86
|
-
| SET_VARIABLES (and existing code-variable steps) | always the literal `setVariable` (
|
|
93
|
+
| SET_VARIABLES (and existing code-variable steps) | always the literal `setVariable` ([Automations Delays Variables and Branches](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-delays-variables-and-branches) §4) |
|
|
87
94
|
|
|
88
95
|
`N` = 1 + the largest number after the last `-` among **all** the automation's namespaces (one counter shared across every step type — e.g. `DELAY-1` then `createTask-2`). A namespace with no trailing number (`setVariable`) doesn't count: if it is the only one, the next `N` is 1. A CODE_CONDITION keeps `CONDITION-<N>`. The builder never rewrites an existing namespace — on update keep every existing one as is. Variable and existing code-variable steps intentionally share `setVariable`; their distinct property keys are merged. For other output-producing actions, never reuse a namespace — the later output overwrites the earlier one.
|
|
89
96
|
|
|
@@ -91,16 +98,16 @@ Use the builder's own convention (it derives new indexes from the trailing numbe
|
|
|
91
98
|
|
|
92
99
|
This section owns the rule. Build one JSON Schema object per node, in code, from the root down its own branch, from public schema APIs (calls: [Automations API Catalog](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-api-catalog) §3–§4).
|
|
93
100
|
|
|
94
|
-
1. **Trigger payload** — the trigger's `payloadDataSchema` (custom/webhook triggers: `trigger.overrideSchema` instead,
|
|
101
|
+
1. **Trigger payload** — the trigger's `payloadDataSchema` (custom/webhook triggers: `trigger.overrideSchema` instead, [Automations Schemas and Scheduling](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-schemas-and-scheduling) §3). If the trigger implements dynamic schema, call Get Trigger Dynamic Schema with the SELECTED (saved) filter options and MERGE its `properties` over the static ones ([Automations Trigger Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-trigger-configuration) §5); before filters are chosen, dynamic fields are UNKNOWN, not absent. Trigger fields are un-prefixed: `var("orderId")`.
|
|
95
102
|
2. **Identity enrichment** — for every trigger-payload field (any object depth, not inside arrays) annotated `identityType: "contact"` or `"member"`, a root-level object is added, keyed by that field's `namespace` annotation when it has one, else its (deprecated) `name` annotation, else the identity type (`contact` / `member`). Shape: Get Identities Schema (`identitiesSchema.properties.contact` / `.member`). Both stay valid: `var("contactId")` and `var("contact.name.first")`; also e.g. `var("contact.email")`, `var("member.profile.nickname")`. A field annotated `name: "post_author_member"` (some Blog / File Share triggers) is enriched as `var("post_author_member.profile.nickname")` — two member ids on one trigger give two objects; use the key the field declares (`member.*` does not exist there). Other identity types (e.g. `visitor`) add no object; webhook/custom triggers (override schema) get none. The builder does not enrich identity fields of action outputs — don't read `contact.*` that only an action output would provide.
|
|
96
|
-
3. **Ancestor action outputs** — for each non-skipped APP_DEFINED step ABOVE this node on its own path, under `properties[<namespace>]`: catalog `outputSchema`, with `overrideOutputSchema.properties` merged over it, and —
|
|
97
|
-
4. **Variables** — titled outputs (`outputSchema`) of non-skipped ancestor SET_VARIABLES / code-variable (`namespace: "setVariable"`) steps, merged under `setVariable`: `var("setVariable.<key>")` (
|
|
103
|
+
3. **Ancestor action outputs** — for each non-skipped APP_DEFINED step ABOVE this node on its own path, under `properties[<namespace>]`: catalog `outputSchema`, with `overrideOutputSchema.properties` merged over it, and — for provider-controlled dynamic outputs — Get Action Dynamic Output Schema (called with that step's final `inputMapping`) merged over that. For `wix_automations-llm_call`, declare user-defined result fields directly in `overrideOutputSchema`; do not call dynamic output discovery for those fields ([Automations Action Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-action-configuration) §4). Example ancestor path: `var("triggered-emails-3.messageId")`.
|
|
104
|
+
4. **Variables** — titled outputs (`outputSchema`) of non-skipped ancestor SET_VARIABLES / code-variable (`namespace: "setVariable"`) steps, merged under `setVariable`: `var("setVariable.<key>")` ([Automations Delays Variables and Branches](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-delays-variables-and-branches) §4).
|
|
98
105
|
|
|
99
106
|
Scope rules:
|
|
100
107
|
|
|
101
108
|
- Only ANCESTORS. A node never sees later steps or a sibling branch (true path can't read the false path; SPLIT paths can't read each other).
|
|
102
109
|
- A skipped step (`skipActionExpression: "{{true}}"`) contributes nothing; never skip a step whose outputs a later step reads.
|
|
103
|
-
- Resolution order — finalize an upstream node before computing a descendant's schema: trigger filters → the trigger's dynamic schema → for each step top-down: its dynamic input schema (if any) → its final `inputMapping` → its dynamic output schema (if any) → add it to its children's schema.
|
|
110
|
+
- Resolution order — finalize an upstream node before computing a descendant's schema: trigger filters → the trigger's dynamic schema → for each step top-down: its dynamic input schema (if any) → its final `inputMapping` → its provider-controlled dynamic output schema (if any; user-defined `wix_automations-llm_call` fields come from `overrideOutputSchema` without a dynamic-output call) → add it to its children's schema.
|
|
104
111
|
- Every `var()` path MUST exist in this node's aggregated schema with a compatible type — never reason from a raw trigger or action schema alone, and never invent a field. Copy keys from the schema (titles/labels are not keys); arrays cannot be traversed by path ([Automations Mapping Expressions](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-mapping-expressions) §5).
|
|
105
112
|
- Preferred-language messages: map `var("contact.locale")` into the email's dynamic content; no separate "language" field is needed.
|
|
106
113
|
|
|
@@ -171,17 +178,85 @@ every `var()` path is in that node's aggregated schema; status is INACTIVE.
|
|
|
171
178
|
|
|
172
179
|
### 5.2 Branching (trigger → condition → two branches)
|
|
173
180
|
|
|
174
|
-
|
|
181
|
+
All ids are placeholders; generate real uuid v4s. Resolve `appId`/`triggerKey`/`actionKey`/input keys from the catalogs.
|
|
182
|
+
|
|
183
|
+
```json
|
|
184
|
+
{
|
|
185
|
+
"automation": {
|
|
186
|
+
"name": "Thank big spenders, follow up with others",
|
|
187
|
+
"origin": "USER",
|
|
188
|
+
"configuration": {
|
|
189
|
+
"status": "INACTIVE",
|
|
190
|
+
"trigger": {
|
|
191
|
+
"appId": "<trigger-app-id>",
|
|
192
|
+
"triggerKey": "<trigger-key>",
|
|
193
|
+
"filters": []
|
|
194
|
+
},
|
|
195
|
+
"rootActionIds": ["<uuid-1>"],
|
|
196
|
+
"actions": {
|
|
197
|
+
"<uuid-1>": {
|
|
198
|
+
"id": "<uuid-1>",
|
|
199
|
+
"type": "CONDITION",
|
|
200
|
+
"namespace": "CONDITION-1",
|
|
201
|
+
"displayName": "Check if order is over 100",
|
|
202
|
+
"conditionInfo": {
|
|
203
|
+
"orExpressionGroups": [
|
|
204
|
+
{
|
|
205
|
+
"operator": "AND",
|
|
206
|
+
"booleanExpressions": [
|
|
207
|
+
"{{numberGt(var(\"totals.total\");100)}}"
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
"truePostActionIds": ["<uuid-2>"],
|
|
212
|
+
"falsePostActionIds": ["<uuid-3>"]
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"<uuid-2>": {
|
|
216
|
+
"id": "<uuid-2>",
|
|
217
|
+
"type": "APP_DEFINED",
|
|
218
|
+
"namespace": "<action-key-a>-2",
|
|
219
|
+
"displayName": "Send thank-you email",
|
|
220
|
+
"appDefinedInfo": {
|
|
221
|
+
"appId": "<action-app-id-a>",
|
|
222
|
+
"actionKey": "<action-key-a>",
|
|
223
|
+
"inputMapping": {
|
|
224
|
+
"<input-key>": "{{var(\"contact.name.first\")}}"
|
|
225
|
+
},
|
|
226
|
+
"postActionIds": []
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"<uuid-3>": {
|
|
230
|
+
"id": "<uuid-3>",
|
|
231
|
+
"type": "APP_DEFINED",
|
|
232
|
+
"namespace": "<action-key-b>-3",
|
|
233
|
+
"displayName": "Create follow-up task",
|
|
234
|
+
"appDefinedInfo": {
|
|
235
|
+
"appId": "<action-app-id-b>",
|
|
236
|
+
"actionKey": "<action-key-b>",
|
|
237
|
+
"inputMapping": {
|
|
238
|
+
"<input-key>": "Follow up on order {{var(\"number\")}}"
|
|
239
|
+
},
|
|
240
|
+
"postActionIds": []
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Why it's valid: one parentless root; ≤1 id per connection; one parent each; ids = keys, unique; own `*Info` only; namespaces per §3; one renderable condition group ([Automations Conditions](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-conditions)); inputMapping keys from the input schema ([Automations Action Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-action-configuration)); every `var()` path in that node's aggregated schema.
|
|
175
250
|
|
|
176
251
|
## 6. Persistence & update lifecycle
|
|
177
252
|
|
|
178
|
-
Create `INACTIVE` (your "draft"); activate only on request. Create procedure and read-back: [
|
|
253
|
+
Create `INACTIVE` (your "draft"); activate only on request. Create procedure and read-back: [Automations Validation and Persistence](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-validation-and-persistence) §3; calls: [Automations API Catalog](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-api-catalog) §2.
|
|
179
254
|
|
|
180
|
-
**
|
|
255
|
+
**Update:** Get → change only what was asked, keep every other node byte-for-byte → Validate → Update with the full merged object + `revision`, `origin` and `settings` as fetched; on an ACTIVE automation the change is live — confirm first. Locks: [Automations Validation and Persistence — included update restrictions](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-validation-and-persistence).
|
|
181
256
|
|
|
182
257
|
## 7. Pre-validate self-check (do in code)
|
|
183
258
|
|
|
184
|
-
Script the graph/id/namespace/`var()` items of [
|
|
259
|
+
Script the graph/id/namespace/`var()` items of [Automations Validation and Persistence](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-validation-and-persistence) §4 (items 1–4 and 11 — the rules of §2–§4 above: one parentless root, RATE_LIMIT only as that root, ≤1 id per connection, one parent each, no cycles/orphans/MERGE/`mergeActionId`/`UNKNOWN_ACTION_TYPE`, keys = ids, globally unique uuid v4s incl. SPLIT path ids, `triggerKey` and `<id>true/false/-end`, own `*Info` only, §3 namespaces unique except `setVariable`, every `var()` in THAT node's aggregated schema). Also check that only user-requested conditions/delays exist; then Validate Automation must return no trigger or action errors.
|
|
185
260
|
|
|
186
261
|
## 8. Anti-patterns (all wrong)
|
|
187
262
|
|
|
@@ -3,14 +3,12 @@ name: "Automations Mapping Expressions"
|
|
|
3
3
|
description: "Write builder-compatible automation mapping expressions, literals and data references."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **Stage scope:** this stage covers only what [Build and Manage Wix Automations](https://dev.wix.com/docs/api-reference/business-management/automations/skills/build-and-manage-wix-automations) lists; do not perform any workflow that needs a guide marked "not yet published". "Stage" and "not yet published" describe how this skill is being rolled out; never mention them to the user. Explain a limit in product terms: what can't be done through the API here and where the user can do it instead (for example, in the automations builder).
|
|
7
|
-
|
|
8
6
|
# Bracket Expressions (Formulas) — `{{…}}`
|
|
9
7
|
|
|
10
8
|
**TL;DR**
|
|
11
9
|
|
|
12
10
|
- `{{expression}}`; fields via `var("dotted.path")` (double quotes, one argument); arguments separated by `;`; string literals in double quotes and URI-encoded.
|
|
13
|
-
- In formula fields (action inputs, set-variable values, delay due dates) use ONLY the builder function list in §2. Conditions and trigger filters have their own, stricter vocabularies — Automations Conditions
|
|
11
|
+
- In formula fields (action inputs, set-variable values, delay due dates) use ONLY the builder function list in §2. Conditions and trigger filters have their own, stricter vocabularies — [Automations Conditions](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-conditions), [Automations Trigger Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-trigger-configuration) §4.2.
|
|
14
12
|
- The builder type-checks every argument and the arity (§2): `eq`/`gt`/`gte`/`lt`/`lte` take NUMBERS only (strings → `stringEq`, dates → `date*`); `if()`'s first argument is boolean. There are no operators.
|
|
15
13
|
- No array element access in any form. Project with `arrayMap(array;"path")`, aggregate with `array*`. A single-value field can never be filled from an array — ask the user which item.
|
|
16
14
|
- Only data from the step's aggregated schema (trigger + ancestors) is in scope ([Automations Graph and Data Model](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-graph-and-data-model) §4).
|
|
@@ -46,6 +44,8 @@ Prefix rules: trigger fields have no prefix; action outputs `"<namespace>.<field
|
|
|
46
44
|
- **Format**: `toString(v)` → string · `toNumber(v)` → number
|
|
47
45
|
- **Logic**: `if(bool;then;else)` · `and(b;b;…)` · `or(b;b;…)` · `not(b)` · `isEmpty(v)` (any value, incl. arrays) → boolean (`if` → its branches' value)
|
|
48
46
|
|
|
47
|
+
`isEmpty(v)` is true for a missing value, `null`, `""`, `[]` or `{}`; it is false for a non-empty string, whitespace-only string, `0` or `false`. It alone covers missing/null/empty-string fallbacks; adding `isEmptyString(v)` with `or` is valid but redundant.
|
|
48
|
+
|
|
49
49
|
Arity (write exactly these counts; the builder flags missing and extra arguments for fixed-arity functions): `var`, `not`, `toString`, `toNumber`, `upper`, `lower`, `stringLen`, `abs`, `isEmptyString`, `isEmpty`, every `array*` aggregate = 1 · comparisons, `round`, `subtract`/`divide`/`mod`, `arrayMap` = 2 · `if`, `substring` = 3 (always pass the length) · `addToDate`/`subtractFromDate` = 4 · `now` = 0 · `and`/`or`/`concat`/`sum`/`multiply` ≥ 2 · `min`/`max`/`average`/`median` ≥ 1.
|
|
50
50
|
|
|
51
51
|
Argument types the builder enforces (convert with `toString()`/`toNumber()`):
|
|
@@ -59,12 +59,12 @@ Argument types the builder enforces (convert with `toString()`/`toNumber()`):
|
|
|
59
59
|
| date-time (`hour`, `minute`, `dateTimeEq/Before/After`) | a var with `format: date-time`, a function, or an ISO date-time literal — a `format: date` var or plain-string var is rejected |
|
|
60
60
|
| array (`array*` functions, `isEmpty`) | array var or `arrayMap(…)`; no other function takes an array argument |
|
|
61
61
|
|
|
62
|
-
An encoded date-time literal (`"2026-12-25T10%3A00%3A00Z"`) is not recognized as a date in a formula field — pass a `"YYYY-MM-DD"` literal or a function, or make the whole field a plain ISO value (§4). This exception is for formula fields only: in a CONDITION the panel itself writes date-time literals encoded and reads both forms (
|
|
62
|
+
An encoded date-time literal (`"2026-12-25T10%3A00%3A00Z"`) is not recognized as a date in a formula field — pass a `"YYYY-MM-DD"` literal or a function, or make the whole field a plain ISO value (§4). This exception is for formula fields only: in a CONDITION the panel itself writes date-time literals encoded and reads both forms ([Automations Conditions](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-conditions) §2).
|
|
63
63
|
|
|
64
64
|
Semantics: `stringEq` and `stringHasSubString` are case-insensitive (normalize with `lower()` if it matters). Booleans: use the value directly (`if(var("isVip");…)`, `not(var("isVip"))`), never `eq(var("isVip");true)`.
|
|
65
65
|
|
|
66
66
|
**Never use in a formula field** (the builder flags them as unknown functions):
|
|
67
|
-
`toEpoch`, `arrayFilter`, `hasSubstring`, `textWithExpressions`, `contains`, `arraySome`, `arrayEvery`, `arrayIncludesAnyOf/AllOf/Only`, `stringContains`, `numberContains`, `boolEq`, `numberEq/numberGt/numberGte/numberLt/numberLte`. (Several of these ARE the condition vocabulary —
|
|
67
|
+
`toEpoch`, `arrayFilter`, `hasSubstring`, `textWithExpressions`, `contains`, `arraySome`, `arrayEvery`, `arrayIncludesAnyOf/AllOf/Only`, `stringContains`, `numberContains`, `boolEq`, `numberEq/numberGt/numberGte/numberLt/numberLte`. (Several of these ARE the condition vocabulary — [Automations Conditions](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-conditions) §2 — and `contains`/`arraySome` the trigger-filter vocabulary.)
|
|
68
68
|
|
|
69
69
|
**Do not exist** (never guess): `replace`, `replaceAll`, `trim`, `split`, `join`, `indexOf`, regex/`match`, `ceil`, `floor`, `parseInt`, `parseFloat`, `random`, `filter`, `reduce`, `sort`, `switch`, loops, `try/catch`, `coalesce`, `formatDate`, `formatNumber`, `formatCurrency`, `titleCase`, `add`, `addDays`, `equals`.
|
|
70
70
|
|
|
@@ -98,13 +98,13 @@ A `strict` dynamic field requires the exact return type/format. `skipActionExpre
|
|
|
98
98
|
- **No lists as text**: no `join`; an `arrayMap` result can't go into `concat` or a string field.
|
|
99
99
|
- **Single-value field from an array → impossible.** Ask the user which item or use a user-given value; don't retry array-shaped variants.
|
|
100
100
|
- Empty arrays make `arraySum/arrayMin/arrayMax/arrayMedian/arrayMultiply` fail at runtime.
|
|
101
|
-
- Membership tests (`does the order contain X`) belong in a condition (
|
|
101
|
+
- Membership tests (`does the order contain X`) belong in a condition ([Automations Conditions](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-conditions) §3) or, for complex logic, a code condition.
|
|
102
102
|
|
|
103
103
|
## 6. Dates
|
|
104
104
|
|
|
105
105
|
- `date*` compare calendar dates, `dateTime*` instants (argument formats: §2). `addToDate`/`subtractFromDate` offset by whole years/months/days.
|
|
106
106
|
- "Within N days before X": `{{dateAfter(var("d");subtractFromDate(var("x");0;0;7))}}`. Day differences can't be computed renderably (no `toEpoch`) — use a DELAY, such a comparison, or a code condition.
|
|
107
|
-
- **Annual dates (birthdays)**: never `dateEq(var("birthdate");now())`. Compare month and day: `{{and(eq(month(var("contact.birthdate"));month(now()));eq(day(var("contact.birthdate"));day(now())))}}` — in a formula field; as a condition use code or a boolean set-variable (
|
|
107
|
+
- **Annual dates (birthdays)**: never `dateEq(var("birthdate");now())`. Compare month and day: `{{and(eq(month(var("contact.birthdate"));month(now()));eq(day(var("contact.birthdate"));day(now())))}}` — in a formula field; as a condition use code or a boolean set-variable ([Automations Conditions](https://dev.wix.com/docs/api-reference/business-management/automations/skills/automations-conditions) §4).
|
|
108
108
|
- **Never hardcode a year**; derive it: `{{dateAfter(var("order_date");concat(toString(year(var("order_date")));"-10-31"))}}`. Use `year(now())` only when the rule is about the current calendar year.
|
|
109
109
|
- Windows crossing New Year (Dec 26 – Jan 4): `{{or(and(eq(month(var("d"));12);gt(day(var("d"));25));and(eq(month(var("d"));1);lt(day(var("d"));5)))}}`; pick `gt`/`gte` from the user's wording.
|
|
110
110
|
- Formatting: `{{toString(month(var("d")))}}/{{toString(day(var("d")))}}/{{toString(year(var("d")))}}` in a string field.
|