Durable.Storage.Schemas.ScheduledWorkflow (Durable v2.0.2)

View Source

Ecto schema for scheduled workflow records.

Scheduled workflows represent cron-based recurring workflow executions.

Summary

Functions

Creates a changeset for inserting or updating a scheduled workflow.

The fields that say a schedule has been failing, reset. Turning it back on starts it with a clean record.

Creates a changeset for enabling/disabling a scheduled workflow.

Creates a changeset for updating a schedule's configuration.

Creates a changeset for upserting during registration.

Types

t()

@type t() :: %Durable.Storage.Schemas.ScheduledWorkflow{
  __meta__: term(),
  auto_disabled_at: DateTime.t() | nil,
  consecutive_failures: integer(),
  cron_expression: String.t(),
  enabled: boolean(),
  id: Ecto.UUID.t(),
  input: map(),
  inserted_at: DateTime.t(),
  key: term(),
  last_error: String.t() | nil,
  last_error_at: DateTime.t() | nil,
  last_run_at: DateTime.t() | nil,
  name: String.t(),
  next_run_at: DateTime.t() | nil,
  queue: String.t(),
  source: String.t(),
  timezone: String.t(),
  updated_at: DateTime.t(),
  workflow_module: String.t(),
  workflow_name: String.t()
}

Functions

changeset(scheduled_workflow, attrs)

Creates a changeset for inserting or updating a scheduled workflow.

cleared_failures()

The fields that say a schedule has been failing, reset. Turning it back on starts it with a clean record.

enable_changeset(scheduled_workflow, bool)

Creates a changeset for enabling/disabling a scheduled workflow.

update_changeset(scheduled_workflow, attrs)

Creates a changeset for updating a schedule's configuration.

upsert_changeset(scheduled_workflow, attrs)

Creates a changeset for upserting during registration.

Updates cron, timezone, input, and queue. API.register/2 includes :next_run_at when the cron or time zone changed and :enabled when a removed @schedule came back; anything else about the record is preserved.