Automations

Cancel an automation

Cancel a running automation execution.

post/v1/programs/{program_id}/automations/{automation_id}/cancel

Request

  • Base URL: https://api.scrip.dev
  • URL: https://api.scrip.dev/v1/programs/{program_id}/automations/{automation_id}/cancel
  • Auth: HTTP bearer

Path parameters

program_idstring uuid required

The program's id.

automation_idstring uuid required

The automation's id.

Headers

Idempotency-Keystring

A key you choose to make this request safe to retry: 1 to 255 printable ASCII characters. Send the same key with the same request to get the first response again, marked Idempotent-Replayed: true. Routes that return a secret once, and claim links, do not replay a response. Event ingest uses the key as the event's identity.

Response

Automation cancelled

created_atstring date-time

When this automation was created

descriptionstring

Optional human-readable description of what this automation does

error_messagestring

Error message if the one-time automation failed

event_dataobject

Event data submitted when this automation fires

execution_completed_atstring date-time

When the current fan-out execution completed

execution_errorstring

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

execution_started_atstring date-time

When the current fan-out execution started

execution_status'IDLE' | 'EXECUTING' | 'COMPLETED' | 'FAILED'

Progress of the current run that sends events to participants, separate from status.

  • IDLE: no run is in progress.
  • EXECUTING: Scrip is sending events to the matching participants.
  • COMPLETED: the latest run finished; the automation can run again when its trigger is next due.
  • FAILED: the latest run stopped with an error; the automation can still run again when its trigger is next due.
guard_conditionstring

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

idstring uuid

Unique identifier for this automation

last_errorstring

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

last_evaluated_atstring date-time

When participant filters were last evaluated (PARTICIPANT_STATE trigger only)

last_run_atstring date-time

When this automation last fired (cron trigger only)

namestring

Human-readable label for this automation

next_run_atstring date-time

When this automation will next fire (cron trigger only)

participant_filterstring

CEL expression that determines which participants are enrolled

participant_idstring uuid

Target participant for program-scoped one-time automations

participants_processedinteger

Participants Scrip has sent the event to in the current run so far.

participants_skipped_errorinteger

Participants skipped because participant_filter or guard_condition CEL evaluation errored

participants_totalinteger

Active participants in the program that the current run checks. When the automation has a participant_filter or guard_condition, filter_hints narrow this count; the filter and guard themselves are not applied, so a finished run can report fewer participants_processed.

processed_atstring date-time

When this one-time automation was processed

program_idstring uuid

The program this automation belongs to

scope'PROGRAM' | 'PARTICIPANTS'

Whether the automation sends one event to the program (PROGRAM) or one event to each matching participant (PARTICIPANTS).

source'API' | 'RULE_ACTION' | 'SYSTEM'

How the automation was created.

  • API: created through the automations API.
  • RULE_ACTION: created by a SCHEDULE_EVENT or BROADCAST rule action.
  • SYSTEM: created by Scrip for scheduled work such as tier expiration.
source_event_idstring uuid

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

source_rule_idstring uuid

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

status'ACTIVE' | 'PAUSED' | 'COMPLETED' | 'FAILED' | 'ARCHIVED'

Whether the automation can fire.

  • ACTIVE: fires when its trigger is due.
  • PAUSED: does not fire until you set it back to ACTIVE.
  • COMPLETED: a one-time automation that has fired; it cannot fire again.
  • FAILED: stopped after a failure; set it to ACTIVE to try again.
  • ARCHIVED: removed from use; it never fires again.
updated_atstring date-time

When this automation was last updated

Example response

{
  "created_at": "2027-01-15T10:30:00Z",
  "description": "Sends a weekly reminder event to VIP participants",
  "error_message": "participant not found",
  "execution_completed_at": "2027-01-15T10:30:00Z",
  "execution_error": "fanout aborted: program is archived",
  "execution_started_at": "2027-01-15T10:30:00Z",
  "execution_status": "COMPLETED",
  "filter_hints": [
    {
      "type": "HAS_TAG",
      "value": "vip"
    }
  ],
  "guard_condition": "participant.counter.purchases >= 1",
  "id": "6b2d4f81-0e93-4c5a-b7d6-3a8c1e5f9b13",
  "last_error": "failed to enqueue event: queue unavailable",
  "last_evaluated_at": "2027-01-15T10:30:00Z",
  "last_run_at": "2027-01-15T10:30:00Z",
  "name": "Weekly points reminder",
  "next_run_at": "2027-12-31T23:59:59Z",
  "participant_filter": "participant.tags.exists(t, t == 'vip')",
  "participant_id": "f7a8b9c0-1d2e-4f3a-b4c5-d6e7f8a9b006",
  "participants_processed": 150,
  "participants_total": 150,
  "processed_at": "2027-01-15T10:30:00Z",
  "program_id": "8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01",
  "scope": "PARTICIPANTS",
  "source": "API",
  "source_event_id": "e5dc1b6a-7f3d-4e2a-8c1b-9a0f4d7e6c05",
  "source_rule_id": "c9f0f895-fb98-4b39-9f86-1e5a0d3e2b03",
  "status": "ACTIVE",
  "trigger": {
    "cron_expression": "0 9 * * 1",
    "timezone": "America/Chicago",
    "type": "CRON"
  },
  "updated_at": "2027-01-15T10:30:00Z",
  "warnings": [
    {
      "code": "unknown_state_key",
      "key": "purchaseCnt",
      "kind": "counter",
      "message": "unknown counter \"purchaseCnt\" on participant: no rule in this program writes it; did you mean \"purchase_count\"?",
      "scope": "participant",
      "suggestion": "purchase_count"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.