Durable.Storage.Schemas.WorkflowExecution (Durable v2.0.2)
View SourceEcto schema for workflow execution records.
Each workflow execution represents a single run of a workflow, tracking its status, context, and progress through steps.
Summary
Functions
Creates a changeset for inserting a new workflow execution.
Statuses of a finished run.
Creates a changeset for marking workflow as compensated (all compensations succeeded).
Creates a changeset for marking workflow as compensating.
Creates a changeset for marking workflow compensation as failed.
Creates a changeset for locking a workflow for execution.
Statuses of a run that's still going: it always keeps its key.
The statuses a key's holder can be in for a new start to take the key under
policy. Open holders never give it up.
The reuse: policies a workflow can declare.
Creates a changeset for updating workflow status.
Types
@type status() ::
:pending
| :running
| :completed
| :failed
| :waiting
| :cancelled
| :compensating
| :compensated
| :compensation_failed
@type t() :: %Durable.Storage.Schemas.WorkflowExecution{ __meta__: term(), compensated_at: DateTime.t() | nil, compensation_results: [map()], completed_at: DateTime.t() | nil, context: map(), current_step: String.t() | nil, deadline_at: term(), engine_state: map(), error: map() | nil, holds_key: boolean(), home_queue: String.t() | nil, id: Ecto.UUID.t(), input: map(), inserted_at: DateTime.t(), key: String.t() | nil, lock_token: term(), locked_at: DateTime.t() | nil, locked_by: String.t() | nil, parent_workflow_id: Ecto.UUID.t() | nil, pending_inputs: term(), priority: integer(), queue: String.t(), retried_at: DateTime.t() | nil, root_workflow_id: Ecto.UUID.t() | nil, runs_after_id: Ecto.UUID.t() | nil, scheduled_at: DateTime.t() | nil, started_at: DateTime.t() | nil, status: status(), step_executions: term(), tags: [String.t()], trigger: :api | :schedule | :parent | :rerun | nil, trigger_ref: String.t() | nil, updated_at: DateTime.t(), workflow_module: String.t(), workflow_name: String.t() }
Functions
Creates a changeset for inserting a new workflow execution.
@spec closed_statuses() :: [status()]
Statuses of a finished run.
Creates a changeset for marking workflow as compensated (all compensations succeeded).
Creates a changeset for marking workflow as compensating.
Creates a changeset for marking workflow compensation as failed.
Creates a changeset for locking a workflow for execution.
@spec open_statuses() :: [status()]
Statuses of a run that's still going: it always keeps its key.
The statuses a key's holder can be in for a new start to take the key under
policy. Open holders never give it up.
@spec reuse_policies() :: [atom()]
The reuse: policies a workflow can declare.
Creates a changeset for updating workflow status.