Partition the streams
UsekeyBy when each customer, record, conversation, or other business key needs its own coordination state. Use globally only when every occurrence should enter one shared batch or timer.
automations/match-decisions.automation.ts
Merge independent triggers
Usemerge when every occurrence should continue independently through the same flow. Unlike correlate, it doesn’t wait for another stream or consume occurrences in pairs.
automations/process-contact-events.automation.ts
keyBy or globally again before another cross-context operation.
Choose an identity and time
Prefer a provider’s entity or conversation ID when it expresses the relationship. UsecorrelationId when you need a stable opaque identity for one durable occurrence. Use timestamp when you need Automate.ax ingestion, completion, or coordination time instead of a provider timestamp.
Batch or fan out
Usecollect when a count closes the group. The result is a nonempty array in arrival order. Use each when one existing array should create a durable child context per item; return a signal from the section only when you need to gather the per-item results.