Glossary

Workspace / Subscription

The tenant boundary. Modelled as Subscription; every tenant-scoped row carries a subscriptionId. Users join workspaces through SubscriptionUser with a role of owner, admin or member. "Workspace" is the UI term, "subscription" the database term.

Profile

The application-side record of a Supabase user (Profile.supabaseUserId). Distinct from SalesRep, which is a workspace-scoped CRM identity that may exist before any login.

Campaign

A run of outbound activity. Campaign.type is call (dialer) or email. Both types share the same table and status enum; only the configuration columns differ.

Campaign target

One phone number enrolled in a call campaign (CampaignTarget), carrying its own state machine, attempt count and schedule. Email recipients are a separate model (EmailCampaignTarget).

Broadcast

One tick of a campaign’s send/dial loop. Triggered by pg_cron calling POST /api/campaigns/{id}/broadcast or POST /api/email-campaigns/{id}/broadcast. A broadcast leases a batch of due targets and enqueues one Inngest event per target.

Lease

A short-lived claim on a target so two concurrent broadcasts cannot dial or email it twice. Call targets use leaseExpiresAt; email targets use queuedAt with a lock window of 2 days (EMAIL_TARGET_LOCK_WINDOW_SECONDS).

Double tap

A deterministic same-day retry. When a call ends with a reason in DOUBLE_TAP_REASONS (voicemail, machine detected, no answer, declined), the callEndedAnalysis workflow sleeps one minute and re-fires the dial event for the same target — subject to a one-call-today-per-number guard and the campaign’s maxAttempts.

Cooling off

The standard retry delay for all other recoverable outcomes: nextEarliestAttemptAt = now + waitHoursToRecall (24 hours by default).

Disposition

The business outcome of a call. retellDisposition is the raw provider value; disposition is the platform’s interpretation. Values are enumerated by RetellDisposition in lib/constants.ts and drive HubSpot eligibility and retry rules.

Valid conversation

A call lasting at least RETRY_CONSTANTS.MIN_VALID_CONVERSATION_SECONDS (10 s) that was not voicemail and not screened. Used as the funnel’s first qualification step.

Caller agent

An AiAgent with type = caller, versioned via AiAgentVersion and mirrored to Retell AI (retellAgentId). Its mainPrompt is the call script and is also fed to the analysis LLM as context.

Analysis agent

An AiAgent with type = analysis. Its prompt supplies the criteria used to grade calls; the result is stored in CallAiAgentAnalysisResult.

Variation

An EmailVariation — a subject plus HTML body for an email campaign. A variation with campaignId = NULL is a reusable template and is never sent directly.

Sending domain / email account

Domain is the Resend-verified domain and owns a shared daily cap. EmailSendingDomain is a concrete From address under that domain with its own cap and counters. The UI calls the latter an "email account".

Registry

The per-workspace canonical lists of contactable endpoints: TargetPhoneNumbers for phone numbers and TargetEmails for addresses. They hold carrier data, risk level, block flags and opt-out state, and gate whether an endpoint may be contacted at all.

Suppression

A registry-level block on contacting an address. An address is suppressed when its TargetEmails row has any of newsletterOptOut, marketingOptOut or isBlocked.

Sequence template

A SequenceTemplate plus its ordered SequenceTemplateStep rows: the reusable definition of a nurture journey.

Enrollment

A ContactSequence — one contact travelling through one template. Driven end-to-end by a single durable Inngest run whose id is stamped as executionId.

Data gate

A sequence step (channel = data_gate) that evaluates conditions against a BigQuery view for the contact and either branches, or waits and re-checks up to gateMaxRetries times.

CRM event

A sequence step (channel = crm_event) that publishes a user-defined, template-interpolated JSON body to the CRM SQS queue with an event_type chosen from a fixed registry.

Follow-up task

A FollowUpTask assigned to a SalesRep, optionally mirrored into HubSpot and/or Nooks, with an escalationStage that advances when it is not actioned.

Activity

A unified interaction log (Activity) covering SMS, email, calls, tasks, meetings, notes and reminders. The activity feed merges these with Call rows.

Nooks

The third-party dialer used by human reps. Its call.logged webhook produces Call rows with channelType = "nooks_call" and no campaign or target.

MCP

Model Context Protocol. POST /api/mcp exposes a JSON-RPC 2.0 tool server so external AI orchestrators can list agents, read call history, initiate calls, send SMS and send email.