Re-entry
Every workflow states whether a user who already entered may enter again. The three modes, the cooldown, how event and segment triggers count as entries, why the option is required, and how other products compare.
A user who signs up should get the onboarding series once. A user who abandons a checkout may deserve a reminder every time, but not twice in one week. A user who buys three things in an hour should get three thank-you notes. Whether a user may enter a workflow again is a property of the workflow, and in Sendwend every workflow has to state it. The option is reentry, it is required, and there is no default.
The modes
| Mode | A user enters again... |
|---|---|
never | never: once per user (onboarding, a welcome series) |
after_exit | once their previous instance of this workflow has ended; at most one runs at a time |
concurrent | even while a previous instance still runs |
An instance has ended when it completed, reached its goal, exited (an exit step or exitWhen) or failed.
A trigger that arrives while the policy refuses it is dropped, not queued. A begin_checkout during a running after_exit recovery journey does not wait to start a second one when the first ends.
Cooldown
cooldown is optional, positive, and allowed only with after_exit and concurrent. It is the least time from the user's previous entry to the next one, measured from when they entered, not from when they left.
With after_exit the two are independent conditions and both must hold: the previous instance has ended, and the cooldown since its entry has passed. With { mode: 'after_exit', cooldown: '7 days' }, a user whose recovery journey ended after two days still waits until seven days after its start before another begin_checkout enters them.
With concurrent, a cooldown spaces entries regardless of whether earlier instances are still running. A workflow that emits its own trigger event with .sendEvent() and runs under concurrent with a cooldown is the shape of a periodic flow. Under never and after_exit it does not loop: the emitted event arrives while the instance is still running.
What counts as an entry attempt
- Event triggers: each occurrence of the event is one entry attempt. A redelivered event (the same
id, see Give each event an id) is the same occurrence and enters at most once, in every mode. - Segment triggers: an entry attempt is a fresh qualification: the user left the segment and matched again. Staying a member never enters again, however often the segment is evaluated. This is Customer.io's rule for segment-triggered campaigns.
- Date triggers: one run per workflow and time; whether a user who entered an earlier run may enter a later one (a changed time) is the policy's call.
- A failed instance records an outage, not a journey. If its start was lost or the platform ended it, it neither blocks re-entry nor starts a cooldown, in every mode. A retry of the same occurrence takes its row over; any other occurrence is a new entry if the policy allows it.
A trigger's filter is checked before any of this. A user it turns away has not entered and nothing is held against them.
Visitors who have not signed in can enter workflows whose event trigger allows them ({ visitors: true }). An entry made as a visitor counts as the user's once they sign in, against the policy like any other.
Cross-workflow frequency capping (no more than N messages a week across every journey) is a separate concern and not part of re-entry.
Why it looks like this
Required, with no default. Once and every time are both reasonable defaults, and whichever is picked is silently wrong for the other half of workflows. A recurring workflow that enters each user once looks healthy and simply stops reaching anyone who already went through it. A required field makes the policy visible where the workflow is defined, and leaving it out is a compile error, not a production surprise. The error from a plain JavaScript caller reads:
A discriminated union with one written form. The policy is always an object naming its mode. There is no 'never' string shorthand and no {} meaning "allowed". Impossible combinations cannot be written: never takes no cooldown, an unknown mode does not compile, and plain JavaScript callers get the same refusal when the workflow compiles. One form keeps the DSL and the IR identical (the IR's reentry is exactly what you wrote, with the cooldown normalized like every duration), and grep "mode: 'concurrent'" finds every workflow that allows parallel journeys.
reentry, one word. It is spelled like the redelivery option on templates, not reEntry.
How other products do it
These products document behavior, not storage. The per-entry ledger keyed by the trigger occurrence (below) is Sendwend's own choice, driven by idempotent ingest and at-most-once entry.
- Salesforce Marketing Cloud Journey Builder offers three contact-entry modes: no re-entry, re-entry only after exiting, and re-entry anytime (Trailhead). Sendwend's modes map one to one. The third is called
concurrenthere because "anytime" reads as contradicting a cooldown. - Adobe Journey Optimizer has "Allow re-entrance" plus a "Re-entrance wait period", and a profile cannot re-enter until it has fully exited the previous instance (journey properties, entry management). Adobe's B2B product measures the wait from either the start or the end of the journey (B2B re-entry); Sendwend measures only from entry, which is simpler. Measuring from the end could be added later without breaking anything.
- Braze Canvas has "Allow users to re-enter this Canvas" with a re-eligibility window counted from entry. Being re-eligible and being blocked because the user is still inside are separate, and a zero window allows re-entry without exiting (re-eligibility, troubleshooting). That separation is
after_exitversusconcurrent, withcooldownas the window. - Iterable has a simultaneous-entries setting (unlimited is capped at 1,000 per user) and a maximum number of entries, documented for scheduled entry sources (journey entry, entry limits). Sendwend has no maximum-entries field: only one of these products has it and no current workflow needs it. It could be added later as an optional field on the non-
nevermodes without breaking callers. - Customer.io enters a person once by default, or on every event. Segment- and attribute-triggered campaigns re-enter only after the person stops matching and matches again, and it offers re-entry at fixed intervals (campaign triggers, troubleshooting entrance). Sendwend's segment-trigger rule follows the same re-match edge; fixed intervals were not added.
How it is stored
The entry ledger (the entry table) holds one row per entry: the instance it started, its status (running until the run finalizes it), its anchor time and the triggering occurrence, which is the event id, or $segment:<segment>:<since> for a segment qualification.
- The re-entry decision reads the user's rows for the workflow under the user's lock, so concurrent ingests are admitted exactly as they would be one after another.
- The unique key
(workflow, user_id, occurrence)keeps a redelivered trigger from entering twice. - Each route (
trigger,segment_trigger) carries the workflow's policy as deployed, so deciding an entry reads no IR. - The deploy guard counts
runningrows, one per running instance, to tell how many journeys a version still carries. - Erasing a user deletes every row of theirs.
When an instance dies
The entry commits before the platform creates the instance, so a host cut off between the two leaves an entry with nothing behind it. Two things repair it, and neither can start a second journey for the occurrence:
- A retry of the same event (same
id) creates the missing instance. The instance id is the platform's identity too, so a second create is harmless. - The sweep's maintenance marks an entry left unadmitted for 15 minutes, whose instance the runtime does not know or reports ended, as failed, so the user's next trigger can enter again.
An instance can also end after it was admitted without finalizing its entry: terminated from a dashboard, errored for good because a step kept failing, or evicted. The same maintenance samples entries admitted more than 15 minutes ago (a bounded random sample each sweep, so every entry is reached eventually), and one whose instance the runtime reports complete, errored or terminated, or no longer knows, is marked failed, its wake subscriptions dropped and its ending reported. An instance still running, or one whose lookup fails for another reason, is left alone. A failed entry no longer counts as running, so the next trigger the policy allows enters again.
Related
- Workflows: the triggers whose occurrences are counted here.
- Conditions and segments: what a fresh qualification is.
- Delivery: why every event needs a reproducible id.