Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(workflows): add email_sending_rate_limit column to hog flows (#87650)

Meikel Ratzb27fb80c3809
diff --git a/products/workflows/backend/migrations/0019_hogflow_email_sending_rate_limit.py b/products/workflows/backend/migrations/0019_hogflow_email_sending_rate_limit.py
new file mode 100644
index 000000000000..cc517bf50ffa
--- /dev/null
+++ b/products/workflows/backend/migrations/0019_hogflow_email_sending_rate_limit.py
@@ -0,0 +1,17 @@
+# Generated by Django 5.2.17 on 2026-08-24 07:11
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("workflows", "0018_teamworkflowsconfig_ses_tenant_state"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="hogflow",
+ name="email_sending_rate_limit",
+ field=models.JSONField(blank=True, null=True),
+ ),
+ ]
diff --git a/products/workflows/backend/migrations/max_migration.txt b/products/workflows/backend/migrations/max_migration.txt
index e31fa678ee93..4f21e3ed545c 100644
--- a/products/workflows/backend/migrations/max_migration.txt
+++ b/products/workflows/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0018_teamworkflowsconfig_ses_tenant_state
+0019_hogflow_email_sending_rate_limit
diff --git a/products/workflows/backend/models/hog_flow/hog_flow.py b/products/workflows/backend/models/hog_flow/hog_flow.py
index b911b8c937cf..bc85eabd9435 100644
--- a/products/workflows/backend/models/hog_flow/hog_flow.py
+++ b/products/workflows/backend/models/hog_flow/hog_flow.py
@@ -125,6 +125,10 @@ class HogFlow(UUIDTModel):
conversion = models.JSONField(null=True, blank=True)
exit_condition = models.CharField(max_length=100, choices=ExitCondition, default=ExitCondition.CONVERSION)
+ # Optional email pacing for deliverability: {"count": <int>, "period": "minute" | "hour"}.
+ # Enforced per workflow by the email worker, which spreads sends instead of dropping them.
+ email_sending_rate_limit = models.JSONField(null=True, blank=True)
+
edges = models.JSONField(default=dict)
actions = models.JSONField(default=dict)
# Secret function inputs (schema fields marked secret, e.g. API keys / auth headers) split out of