Repository navigation
Automations server parts: step statistics, journey counts, messages by automation, exited recount - #533
Merged
Conversation
…ast_sent_at, transactional filter, recent failure indexes - message_history analytics: origin dimension (broadcast, automation or transactional) and last_sent_at measure (last send not failed) - messages.list filters by transactional_notification_id - v44 adds partial indexes on failed, bounced and complained messages in messages.list order; new workspaces get them from init.go
… v44 exited recount automations.nodeStats counts, for every step of an automation over a period or all time, the journeys that visited it, its results, the journeys waiting or retrying there and, for email steps, the messages it sent. automations.list adds journey_counts by status with with_journey_counts. messages.list filters by automation_id, and the message history analytics gain an automation_id dimension. v44 raises stats.exited to the exited journeys.
…document the automation routes The demo's node executions carry what each executor writes, its queued emails have their messages, and its failed journeys the error rows of their attempts, so automations.nodeStats shows them. automations.list and automations.nodeStats are in the OpenAPI document, and the CHANGELOG has the feature.
…ed emails in one pass
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md # internal/domain/analytics_test.go # internal/domain/message_history.go # internal/domain/message_history_test.go # internal/migrations/v44.go # internal/migrations/v44_test.go # internal/repository/analytics_postgres_test.go # internal/repository/message_history_postgre.go # internal/repository/message_history_postgre_test.go
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #533 +/- ##
==========================================
- Coverage 89.02% 88.96% -0.06%
==========================================
Files 374 377 +3
Lines 73402 73836 +434
==========================================
+ Hits 65345 65691 +346
- Misses 5369 5437 +68
- Partials 2688 2708 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
pierre-b
marked this pull request as ready for review
November 12, 2026 15:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Server part 4 of 6 for the console redesign (automation screens). No console change: the screens ship in their own PRs.
What changes
automations.nodeStats(new,GET): the statistics of each step of an automation, over a period (since,until) or all time.REPEATABLE READtransaction.automations.listtakeswith_journey_countsand returnsjourney_counts, each automation's journeys by status ({}for an empty page).messages.listfilters byautomation_id; the message history analytics get anautomation_iddimension.stats.exitedof each automation is raised to its number of exited journeys (until 44 a reply exit was not counted there). The recount runs last, after the index builds, so it cannot deadlock with a tracking write. Approved as an addition to v44 (VERSIONstays 44.0).automations.listandautomations.nodeStatswith their schemas.Tests
TestAutomationNodeStats: visits, splits, waiting, retrying, failed attempts,messages.list?automation_id, email counters compared with the analyticscount_sentandcount_opened, queued and not sent (a duplicate queue entry and another automation's entry included), the period, missing message history read, 403, 404 and 400;TestAutomationJourneyCounts;TestV44ExitedRecount: raised, kept, odd stored values, deleted and non-object stats, a rerun writes nothing;TestDemoAutomationsSeedRealHistoryreads the seed through the step statistics.openapi.json.Plan, with its review corrections and an "As built" section:
plans/console-redesign-server-4-automations-plan.md.Known, not handled
waitingcompares a delay'sdelay_until, written with the application clock, with the database'snow(): a clock skew moves a journey between waiting and in progress for that long.EXPLAIN (ANALYZE, BUFFERS)on a 1-million-journey automation is left for the console PR.message_historywait behind it.list_id.errorscounting every completed execution,completedincluding errors,queuedwithout the missing-message condition, the A/B key read fromvariant_name, or the transaction opened without read-only andREPEATABLE READ.