Skip to navigation

Campaign lifecycle

The states of a campaign and its recipients, which command each state accepts, and when Rasen dials again.

Summary

This page gives the states of a campaign and of its recipients, and the commands that each campaign state accepts. It also covers redial, retry, suppression and calling windows. It does not cover how to create and run a campaign; see Run an outbound campaign.

Facts

ItemValue
Create operationscreateCampaign (POST /campaigns), uploadCampaign (POST /campaigns/upload)
Command operationsplanCampaign, admitCampaign, startCampaign, pauseCampaign, resumeCampaign, retryCampaign, cancelCampaign, each POST /campaigns/{campaign_id}/<command>
Read operationsgetCampaign, listCampaigns, listCampaignRecipients
Suppression operationsuppressCampaignDestination (POST /campaign-suppressions)
Command headersIf-Match with the campaign’s current ETag, and a new Idempotency-Key
Campaign state valuesdraft, planned, admitted, dialing, paused, stalled, completed, failed, cancelled. Open vocabulary
Terminal campaign statescompleted, failed, cancelled
Recipient state valuespending, dialing, reached, exhausted, suppressed, cancelled
Row outcomes of a recipient listaccepted, invalid, duplicate, suppressed, removed
max_attempts_per_recipient1 to 10, default 1
retry_backoff_msDefault 3600000 (1 hour)
max_concurrent_calls1 to 1000, default 1. planCampaign lowers it to the workspace’s concurrent-call entitlement when that is lower
StallAfter 180 seconds without dialing progress
dialing_time_zoneAn IANA time zone name, default UTC

Campaign states

stateMeaningTerminalWhat happens next
draftRasen saved the campaign and its recipients. Nothing dials.NoplanCampaign makes it planned.
plannedThe plan froze the recipients, the agent’s live version, the settings and the concurrency ceiling.NoadmitCampaign makes it admitted.
admittedAdmission checked the quota for the planned dials.NostartCampaign makes it dialing.
dialingRasen dials the recipients that are due.Nocompleted when no recipient remains to dial. stalled after 180 seconds without progress. pauseCampaign makes it paused.
pausedYou paused it. Rasen places no new dial, and the recipients wait.NoresumeCampaign makes it dialing.
stalledRasen moved it here because dialing made no progress for 180 seconds. No recipient changes, and Rasen places no new dial.Nodialing again on its own when dialing progresses.
completedEvery recipient is in a final state.YesretryCampaign reopens it to dialing.
failedThe campaign ended in failure. failure_reason says why.YesretryCampaign reopens it to dialing.
cancelledYou cancelled it.YesNothing. Create a new campaign to call the recipients again.

cancelCampaign moves every state that is not terminal to cancelled.

Commands in each state

Each cell gives the state after the command, or the error code of its refusal (409).

Stateplanadmitstartpauseresumeretrycancel
draftplannednot_plannednot_plannednot_dialingnot_pausednot_plannedcancelled
plannednot_draftadmittednot_plannednot_dialingnot_pausednot_plannedcancelled
admittednot_draftnot_planneddialingnot_dialingnot_pausednot_plannedcancelled
dialingnot_draftnot_plannednot_plannedpausednot_pauseddialingcancelled
pausednot_draftnot_plannednot_plannednot_dialingdialingpausedcancelled
stallednot_draftnot_plannednot_plannednot_dialingnot_pausednot_plannedcancelled
completednot_draftnot_plannednot_plannednot_dialingnot_pauseddialingalready_terminal
failednot_draftnot_plannednot_plannednot_dialingnot_pauseddialingalready_terminal
cancellednot_draftnot_plannednot_plannednot_dialingnot_pausedalready_terminalalready_terminal

A command checks other conditions before the state, so it can answer another code first:

CodeWhen
revision_required (428)The command has no If-Match.
conflict with details.reason: stale_revisionThe campaign changed since your read.
agent_not_publishedThe agent has no published version.
conflictThe agent’s live version or the outbound number changed since the plan. retryCampaign also answers it when no recipient matched.
no_recipientsadmitCampaign or startCampaign found no pending recipient.
quota_exceeded (429)admitCampaign or retryCampaign asked for more dials than the quota allows.

Recipient states

stateMeaningFinal
pendingThe recipient waits for a dial. next_attempt_at is the earliest time.No
dialingA dial is in progress, or its outcome is not known yet.No
reachedA person or a voicemail answered a dial.Yes, until retryCampaign selects it
exhaustedThe attempts ran out without an answer.Yes, until retryCampaign selects it
suppressedRasen does not dial this recipient. suppression_reason says why, for example do_not_call or window_closed.Yes
cancelledYou cancelled the campaign before Rasen dialed this recipient.Yes

attempts on a recipient lists each dial, with its disposition and call_session_id. Each attempt is a call: read it with getCall.

Row outcomes

checkCampaignRecipients and uploadCampaign give each row of a recipient list one outcome. checkCampaignRecipients saves nothing.

OutcomeMeaning
acceptedA valid E.164 number and valid variable names. The row becomes a recipient.
invalidThe number is not valid E.164. Rasen reports the row and does not dial it.
duplicateThe same destination (dial_key) is already in the list. Rasen keeps one row.
suppressedThe destination is on the workspace’s suppression list.
removedA remove edit in recipient_edits removed the row.

Redial and retry

Rasen redials a recipient on its own only within the campaign’s attempt budget:

Outcome of the last dialWhat Rasen does
answered or voicemailThe recipient is reached. Rasen does not dial it again.
no_answer, busy, rejected, invalid_number, failed, cancelled, indeterminateThe recipient is pending again after retry_backoff_ms, while attempts_made is below max_attempts. Otherwise it is exhausted.
Not known (the dial may or may not have reached the carrier)Rasen holds the recipient in dialing. It never redials an uncertain dial on its own.

retryCampaign dials recipients again on your request:

  • Without dispositions, it selects the recipients whose last outcome was not answered, within their remaining attempts.
  • With dispositions, it selects exactly those outcomes, answered too, and adds one attempt when a recipient has none left. An empty list selects nothing.
  • It never selects a recipient that is suppressed, cancelled, still in a call, or held after an uncertain dial.
  • The answer’s retry object gives selected, retried and budget_exhausted.
  • A retry of a completed or failed campaign reopens it to dialing. A retry of a dialing or paused campaign keeps its state.

Suppression

suppressCampaignDestination adds a number to the workspace’s suppression list, with reason do_not_call or opt_out. No operation removes it: a suppression is permanent. A number that is already on the list answers added: false.

Rasen checks the list when you create a campaign, and again before every dial. A recipient whose number is on the list becomes suppressed, also in a campaign that is already dialing.

Calling windows

FieldMeaning
window_start_atThe earliest time the campaign dials. null dials at once.
window_end_atThe time after which the campaign never dials.
daily_opens_minute, daily_closes_minuteThe daily hours, in minutes after local midnight (0 to 1440) in dialing_time_zone. Send both or neither; the opening is before the closing.
dialing_time_zoneThe IANA time zone of the daily hours, default UTC.

Rasen checks the window before each dial. Outside the daily hours, recipients stay pending until the next opening. After window_end_at, the pending recipients become suppressed with suppression_reason window_closed. Without daily hours, Rasen dials at any time of day.

The daily hours apply on every day of the week, weekends included. A campaign has no weekday field. To skip a day, pause the campaign before it (pauseCampaign) and resume it after (resumeCampaign).

planCampaign answers ceiling and window. ceiling gives effective, requested, workspace_entitlement and source. window.disposition is open, hold (with next_opening) or closed (with a reason).

Cancel and pause

  • cancelCampaign places no new dial. Calls already placed run to their end.
  • Each pending recipient becomes cancelled. A recipient in dialing becomes cancelled when its dial ends without an answer.
  • pauseCampaign places no new dial and leaves every recipient as it is. Calls already placed run to their end.
  • pauseCampaign and resumeCampaign refuse a stalled campaign. Wait for it to return to dialing, or cancel it.

Rules

  • MUST send the campaign’s current ETag in If-Match and a new Idempotency-Key with each command.
  • MUST read the campaign again after a refusal, and check its state before the next command.
  • MUST NOT send startCampaign after a refused plan or admission.
  • MUST treat a suppression as permanent. No operation removes a number from the list.
  • MUST NOT treat a recipient in dialing as safe to call again. Rasen holds an uncertain dial and never redials it on its own.
  • MUST keep an unknown campaign or recipient state, and never read it as success.