Durable.Executor.StepRunner (Durable v2.0.2)

View Source

Executes individual workflow steps with retry logic and log capture.

Pipeline Model

Steps receive data from the previous step and return {:ok, data} or {:error, reason}. The first step receives the workflow input.

Summary

Types

result()

@type result() ::
  {:ok, map()}
  | {:error, any()}
  | {:cancel, String.t(), :run | :workflow | :root | nil}
  | {:park, non_neg_integer()}
  | {:decision, atom(), map()}
  | {:sleep, keyword()}
  | {:wait_for_event, keyword()}
  | {:wait_for_input, keyword()}
  | {:wait_for_any, keyword()}
  | {:wait_for_all, keyword()}
  | {:call_workflow, keyword()}

Functions

execute(step, data, workflow_id, config, deadline \\ nil)

@spec execute(
  Durable.Definition.Step.t(),
  map(),
  String.t(),
  Durable.Config.t(),
  DateTime.t() | nil
) ::
  result()

Executes a step with retry logic.

Arguments

  • step - The step definition
  • data - The data to pass to the step (from previous step or workflow input)
  • workflow_id - The workflow execution ID
  • config - The Durable config
  • deadline - When the run's timeout: runs out, if it has one. A step still running then is stopped, and isn't retried.

Returns {:ok, data} on success or {:error, reason} after all retries exhausted.