HephaestusOban.Runner (hephaestus_oban v0.5.0)

Copy Markdown View Source

Oban-backed Hephaestus.Runtime.Runner implementation.

start_instance/3 extracts :workflow_version from opts before persisting the instance and enqueuing the first AdvanceWorker. That same version is then propagated through every worker job as "workflow_version" so retries, resumes, and step result inserts stay tied to the concrete workflow revision that started the instance.

start_instance/3 options

  • :storage — storage backend tuple used to persist instances
  • :config_key — key used to resolve runtime config from :persistent_term
  • :oban — Oban instance name used for inserts
  • :id — required business key used as the workflow instance id
  • :workflow_version — workflow revision stored on the instance and passed through Oban job args (defaults to 1)

Summary

Functions

Starts a workflow instance and enqueues the initial AdvanceWorker.

Functions

child_spec(opts)

@spec child_spec(keyword()) :: Supervisor.child_spec()

start_instance(workflow, context, opts)

@spec start_instance(module(), map(), keyword()) ::
  {:ok, String.t()} | {:error, term()}

Starts a workflow instance and enqueues the initial AdvanceWorker.

The required :id option and :workflow_version option flow into Instance.new/4 and the initial Oban job args as "workflow_version", ensuring downstream workers execute against the same workflow revision.

start_link(opts)

@spec start_link(keyword()) :: :ignore