Skip to main content
POST
Cancel an automation
Cancels a pending or in-progress automation execution. Only two cases are cancellable:
  • Participant-scoped fan-out (execution_status is executing): Sets execution_status to failed. Participants already processed retain their generated events; remaining participants are skipped. The automation stays active and fires again on its next scheduled trigger unless you also pause or archive it.
  • Program-scoped one-time (not yet processed): Archives the automation.
All other combinations return a 400 error. For example, a cron+program automation or an already-idle fan-out cannot be cancelled. Fan-out cancellation is best-effort. A small number of additional participants may be processed between the cancel request and acknowledgment.
For usage patterns and examples, see the Automations guide.

Authorizations

X-API-Key
string
header
required

API key passed in the X-API-Key header.

Path Parameters

programId
string<uuid>
required

Program ID

automationId
string<uuid>
required

Automation ID

Response

Automation cancelled

created_at
string<date-time>

When this automation was created

Example:

"2024-01-15T10:30:00Z"

description
string

Optional human-readable description of what this automation does

Example:

"Sends a weekly reminder event to VIP participants"

error_message
string

Error message if the one-time automation failed

Example:

"participant not found"

event_data
object

Event data submitted when this automation fires

execution_completed_at
string<date-time>

When the current fan-out execution completed

Example:

"2024-01-15T09:00:42Z"

execution_error
string

Error message if the fan-out execution failed, or JSON-encoded diagnostics for completed runs with CEL eval skips

Example:

"fanout aborted: program is archived"

execution_started_at
string<date-time>

When the current fan-out execution started

Example:

"2024-01-15T09:00:00Z"

execution_status
enum<string>

Status of the current run sending events to participants, separate from the automation's status.

  • idle: no run is in progress.
  • executing: participants are currently being processed.
  • completed: the current run finished; the automation definition may remain active for future runs.
  • failed: the current run stopped with an error; the automation definition may remain active for a retry or future run.
Available options:
idle,
executing,
completed,
failed
Example:

"completed"

filter_hints
Automation filter hint · object[]

Checks derived from participant_filter that narrow the participants to consider. Scrip still evaluates the full CEL filter for each candidate.

guard_condition
string

CEL expression evaluated at trigger time; skips the participant if false

Example:

"participant.counters.purchases >= 1"

id
string<uuid>

Unique identifier for this automation

Example:

"990e8400-e29b-41d4-a716-446655440000"

last_error
string

Error message from the most recent cron execution, if any (cron trigger only)

Example:

"failed to enqueue event: queue unavailable"

last_evaluated_at
string<date-time>

When participant filters were last evaluated (participant_state trigger only)

Example:

"2024-01-15T10:30:00Z"

last_run_at
string<date-time>

When this automation last fired (cron trigger only)

Example:

"2024-01-15T09:00:00Z"

name
string

Human-readable label for this automation

Example:

"Weekly points reminder"

next_run_at
string<date-time>

When this automation will next fire (cron trigger only)

Example:

"2024-01-22T09:00:00Z"

participant_filter
string

CEL expression that determines which participants are enrolled

Example:

"participant.tags.exists(t, t == 'vip')"

participant_id
string<uuid>

Target participant for program-scoped one-time automations

Example:

"550e8400-e29b-41d4-a716-446655440001"

participants_processed
integer

Participants processed so far in the current run

Example:

150

participants_skipped_error
integer

Participants skipped because participant_filter or guard_condition CEL evaluation errored

Example:

0

participants_total
integer

Total participants to process in the current run

Example:

150

processed_at
string<date-time>

When this one-time automation was processed

Example:

"2024-02-01T09:00:05Z"

program_id
string<uuid>

The program this automation belongs to

Example:

"550e8400-e29b-41d4-a716-446655440000"

scope
string

Whether the automation sends one program event or an event for each selected participant: program or participants.

Example:

"participants"

source
enum<string>

Origin of the automation.

  • api: created directly through the Automations API.
  • rule_action: created by a SCHEDULE_EVENT or BROADCAST rule action.
  • system: created by Scrip for scheduled tasks such as tier expiration.
Available options:
api,
rule_action,
system
Example:

"api"

source_event_id
string<uuid>

The event whose processing created this automation. Omitted when no source event is recorded, for example on automations created through the API.

Example:

"770e8400-e29b-41d4-a716-446655440000"

source_rule_id
string<uuid>

The rule whose action created this automation. Omitted when no rule action created it, including automations created through the API.

Example:

"880e8400-e29b-41d4-a716-446655440000"

status
enum<string>

Lifecycle state of the automation definition.

  • active: eligible to fire when its trigger is due.
  • paused: temporarily prevented from firing and may be reactivated.
  • completed: a one-time automation fired successfully and is terminal.
  • failed: stopped firing after a definition-level failure until explicitly reactivated.
  • archived: soft-deleted and permanently prevented from firing.
Available options:
active,
paused,
completed,
failed,
archived
Example:

"active"

trigger
object

Trigger configuration (type, schedule, and timing)

Example:
updated_at
string<date-time>

When this automation was last updated

Example:

"2024-01-15T10:30:00Z"

warnings
object[]

Non-blocking advisories about participant_filter/guard_condition — e.g. a counter/tag/attribute key no rule in the program writes. Present on create/update only; never blocks the save.