Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(automation): say empty conditions skip channel and status chats

Yudhi Armyndharisba56e801c340
diff --git a/docs/05-database-design.md b/docs/05-database-design.md
index 69a877222..88763fdab 100644
--- a/docs/05-database-design.md
+++ b/docs/05-database-design.md
@@ -468,7 +468,7 @@ CREATE TABLE automation_rules (
"sessionId" VARCHAR NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,
name VARCHAR(100) NOT NULL,
enabled BOOLEAN NOT NULL DEFAULT true,
- conditions JSONB, -- webhook filter shape; null = match every inbound message
+ conditions JSONB, -- webhook filter shape; null = match all except channel/broadcast/status (need a kind condition)
"replyText" TEXT NOT NULL,
"cooldownSeconds" INTEGER NOT NULL DEFAULT 60, -- per-(rule, chat) quiet period; 0 disables
"createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
diff --git a/src/modules/automation/entities/automation-rule.entity.ts b/src/modules/automation/entities/automation-rule.entity.ts
index 1ecef0417..016eb11cc 100644
--- a/src/modules/automation/entities/automation-rule.entity.ts
+++ b/src/modules/automation/entities/automation-rule.entity.ts
@@ -42,7 +42,8 @@ export class AutomationRule {
@Column({ type: 'boolean', default: true })
enabled!: boolean;
- // Null/absent means "match every inbound message" — mirrors webhook filters' additive default.
+ // Null/absent matches every inbound message except channel, broadcast-list and status chats (those need a
+ // kind condition); otherwise mirrors webhook filters' additive default.
@Column({ type: jsonColumnType(), nullable: true })
conditions!: WebhookFilters | null;