Workflow conditions
data.config.conditionType of a condition node. The engine follows the edges that leave the true handle when the condition holds and the false handle otherwise.
if
Compares one field of the payload with a value (the default condition type).
{ "id": "is_stop", "type": "conditionNode",
"data": { "title": "Says STOP?", "config": { "conditionType": "if", "field": "message.body", "operator": "contains", "value": "STOP" } } }
"edges": [
{ "id": "e2", "source": "is_stop", "sourceHandle": "true", "target": "opt_out" },
{ "id": "e3", "source": "is_stop", "sourceHandle": "false", "target": "reply" }
]
| Key | Values | Description |
|---|---|---|
field | one of the fields below | What to look at. |
operator | one of the operators below | How to compare. |
value | scalar or list of scalars | What to compare with. Not needed for is_empty, is_not_empty, is_true and is_false. For contact.group_id a gid_ ID and for message.inbox_id a num_ ID may be used. |
Fields:
| Field | Meaning |
|---|---|
message.body | Text of the message. |
message.channel | sms, whatsapp-business, whatsapp-connect or voice. |
message.inbox_id | Numeric ID of the inbox the message arrived on. |
message.length | Number of characters of the message. |
message.from | Sender of the message. |
contact.phone | Phone number of the contact (the sender for inbound messages). |
contact.name, contact.firstname, contact.lastname | Name fields of the contact. |
contact.group_id | Group of the contact. |
contact.country_code | ISO country code of the contact. |
contact.opted_out | Whether the contact opted out. |
contact.birthday, contact.age | Birthday (DD/MM) and age, birthday trigger. |
contact.extra1 .. contact.extra10 | The extra fields of the contact. |
delivery_report.status | Status of the delivery report. |
execution.run_count | Number of earlier completed executions of this workflow for the same phone number. |
execution.is_first_trigger | True when run_count is 0. |
system.day_of_week, system.time, system.date | monday .. sunday, HH:MM, YYYY-MM-DD of "now" in Europe/Brussels. A test payload may carry system.date, system.time and system.timezone to simulate a moment. |
Operators:
| Operator | Holds when |
|---|---|
equals / not_equals | The field equals / does not equal the value (case-insensitive, numeric strings compare numerically). |
contains / not_contains | The field contains / does not contain the value. |
starts_with / ends_with | The field starts / ends with the value. |
greater_than, greater_than_or_equal, less_than, less_than_or_equal | Numeric or alphabetical comparison. |
between | The field lies within the two values of the list (or comma-separated string). |
in / not_in | The field is / is not one of the values of the list (or comma-separated string). |
is_empty / is_not_empty | The field has no value / has a value. |
is_true / is_false | The field is true / false. |
office_hours
Holds inside your office hours. Useful to reply automatically outside office hours and to assign the conversation during office hours.
{ "id": "office_hours", "type": "conditionNode",
"data": { "title": "Within office hours?", "config": { "conditionType": "office_hours",
"officeHours": { "days": ["monday", "tuesday", "wednesday", "thursday", "friday"], "start": "09:00", "end": "17:00", "timezone": "Europe/Brussels" } } } }
| Key | Values | Description |
|---|---|---|
officeHours.days | list of monday .. sunday, default all | Working days. |
officeHours.start | HH:MM, default 09:00 | Start of the working day. |
officeHours.end | HH:MM, default 17:00 | End of the working day (exclusive). |
officeHours.timezone | IANA name, default Europe/Brussels | Time zone of the hours. |
field, operator and value are accepted on this type and passed through untouched (builder placeholders).