# AshWorkflow v0.6.0 - Table of Contents

> Declarative workflow orchestration for the Ash Framework — multi-step
workflows combining human actions, background jobs, and time-based deadlines.

## GUIDES

- [Home](readme.md)

- Tutorials
  - [Getting Started with AshWorkflow](getting-started-with-ash-workflow.md)

- Topics
  - [Automatic vs Manual Steps](automatic-vs-manual-steps.md)
  - [Error Handling](error-handling.md)
  - [Timeouts and Deadlines](timeouts-and-deadlines.md)
  - [Workflow History](workflow-history.md)
  - [Undo](undo.md)
  - [Authorization](authorization.md)
  - [Telemetry](telemetry.md)
  - [Workflows and Relationships](workflows-and-relationships.md)
  - [Comparison to BPMN 2.0](bpmn-comparison.md)

- DSLs
  - [AshWorkflow](dsl-ashworkflow.md)

## Modules

- Dsl
  - [AshWorkflow](AshWorkflow.md): Declarative workflow orchestration for Ash Framework.

- Entities
  - [AshWorkflow.Entities.Step](AshWorkflow.Entities.Step.md): Defines a workflow step entity with its configuration schema.
  - [AshWorkflow.Entities.Timeout](AshWorkflow.Entities.Timeout.md): Defines a workflow timeout entity with its configuration schema.
  - [AshWorkflow.Entities.Transition](AshWorkflow.Entities.Transition.md): A named transition from a manual step to another step.
  - [AshWorkflow.Entities.TransitionLog](AshWorkflow.Entities.TransitionLog.md): Configures an opt-in transition log for a workflow.
  - [AshWorkflow.Entities.Undo](AshWorkflow.Entities.Undo.md): Configures undo for a workflow.

- Checks
  - [AshWorkflow.Checks](AshWorkflow.Checks.md): Re-exports Ash policy check helpers for use inside workflow step blocks.

- Telemetry
  - [AshWorkflow.Telemetry](AshWorkflow.Telemetry.md): The `:telemetry` events AshWorkflow emits.

- Internals
  - [AshWorkflow.Calculations.AvailableActions](AshWorkflow.Calculations.AvailableActions.md): Ash calculation that returns the list of user-facing actions available
for a workflow record's current step.
  - [AshWorkflow.Calculations.CurrentStep](AshWorkflow.Calculations.CurrentStep.md): Ash calculation that returns the name of the workflow's current step.
  - [AshWorkflow.Calculations.EnteredCurrentStateAt](AshWorkflow.Calculations.EnteredCurrentStateAt.md): Ash calculation that returns the `occurred_at` of the most recent transition
log row where `from_state != to_state`.
  - [AshWorkflow.Calculations.PendingDeadlines](AshWorkflow.Calculations.PendingDeadlines.md): Ash calculation listing the timeouts still ahead of a record in its current
step, soonest first.
  - [AshWorkflow.Calculations.Steps](AshWorkflow.Calculations.Steps.md): Ash calculation that returns the list of all workflow step names.
  - [AshWorkflow.Changes.ConditionalOnSuccess](AshWorkflow.Changes.ConditionalOnSuccess.md): An Ash change that evaluates an automatic step's `on_success` routes to
determine the transition target.
  - [AshWorkflow.Changes.ConditionalTransition](AshWorkflow.Changes.ConditionalTransition.md): An Ash change that evaluates conditional routes at runtime to determine the
transition target.
  - [AshWorkflow.Changes.RecordEvent](AshWorkflow.Changes.RecordEvent.md): Records a workflow event: writes through `state_entered_at` and, if a
`transition_log` is configured, appends one row describing what happened.
  - [AshWorkflow.Changes.UndoTransition](AshWorkflow.Changes.UndoTransition.md): Performs the state half of an undo: resolves the row to reverse, rewinds the
record to that row's `from_state`, and hands the row to
`AshWorkflow.Changes.RecordEvent` through the changeset context so the new
log row can point at it.
  - [AshWorkflow.Duration](AshWorkflow.Duration.md): The duration tuple a `timeout` measures with `fire_after` and a `retry` block
waits with `backoff`.
  - [AshWorkflow.Entities.BelongsToActor](AshWorkflow.Entities.BelongsToActor.md): Configures actor capture on a `transition_log`.
  - [AshWorkflow.Entities.Retry](AshWorkflow.Entities.Retry.md): Defines the failure policy for a step's or timeout's generated work.
  - [AshWorkflow.Entities.Route](AshWorkflow.Entities.Route.md): A conditional target for a transition. Evaluated at runtime using `Ash.Expr.eval/2`.
  - [AshWorkflow.Errors.UndoNotPermitted](AshWorkflow.Errors.UndoNotPermitted.md): Raised (or returned) when `undo` is called on a record that cannot be
rewound.
  - [AshWorkflow.Info](AshWorkflow.Info.md): Introspection helpers for AshWorkflow resources.

  - [AshWorkflow.Scheduler](AshWorkflow.Scheduler.md): The behaviour a module implements to run a workflow's scheduled work.
  - [AshWorkflow.Scheduler.Leader](AshWorkflow.Scheduler.Leader.md): Answers whether this node is the one that should arm timers.
  - [AshWorkflow.Scheduler.Leader.Oban](AshWorkflow.Scheduler.Leader.Oban.md): Borrows leadership from `Oban.Peer.leader?/2`.
  - [AshWorkflow.Scheduler.Leader.Single](AshWorkflow.Scheduler.Leader.Single.md): Always the leader. The default for `AshWorkflow.Scheduler.Precise`.
  - [AshWorkflow.Scheduler.Oban](AshWorkflow.Scheduler.Oban.md): Runs a workflow's scheduled work through ash_oban. The default scheduler.
  - [AshWorkflow.Scheduler.Precise](AshWorkflow.Scheduler.Precise.md): Fires scheduled work by arming a timer for each deadline, rather than polling
for records whose deadline has passed.
  - [AshWorkflow.Scheduler.Precise.Timeline](AshWorkflow.Scheduler.Precise.Timeline.md): Holds the armed deadlines for `AshWorkflow.Scheduler.Precise`.
  - [AshWorkflow.Scheduler.Work](AshWorkflow.Scheduler.Work.md): One unit of scheduled work a workflow declares, in AshWorkflow's own terms.
  - [AshWorkflow.Transformers.AddActions](AshWorkflow.Transformers.AddActions.md): Generates and modifies Ash actions based on workflow step declarations.
  - [AshWorkflow.Transformers.AddAttributes](AshWorkflow.Transformers.AddAttributes.md): Adds the `state_entered_at` attribute if not already defined on the resource.
  - [AshWorkflow.Transformers.AddCalculations](AshWorkflow.Transformers.AddCalculations.md): Generates workflow calculations on the resource.
  - [AshWorkflow.Transformers.AddCodeInterface](AshWorkflow.Transformers.AddCodeInterface.md): Generates code interface definitions for workflow actions.
  - [AshWorkflow.Transformers.AddIndexes](AshWorkflow.Transformers.AddIndexes.md): Adds the composite indexes that the generated Oban triggers need, for
resources using `AshPostgres.DataLayer`.
  - [AshWorkflow.Transformers.AddPolicies](AshWorkflow.Transformers.AddPolicies.md): Generates Ash policies from workflow step declarations.
  - [AshWorkflow.Transformers.AddScheduler](AshWorkflow.Transformers.AddScheduler.md): Describes the workflow's scheduled work, then hands it to the selected
scheduler.
  - [AshWorkflow.Transformers.AddStateMachine](AshWorkflow.Transformers.AddStateMachine.md): Generates ash_state_machine configuration from workflow steps.
  - [AshWorkflow.TransitionLog](AshWorkflow.TransitionLog.md): Runtime helpers shared by `AshWorkflow.Changes.RecordEvent` and the
generated `state_at/2` and `history/1` code interface functions.
  - [AshWorkflow.Undo](AshWorkflow.Undo.md): Runtime resolution for the generated `undo` action: decides whether a record
may be rewound, and to where.
  - [AshWorkflow.Verifiers.ValidateRetry](AshWorkflow.Verifiers.ValidateRetry.md): Rejects a `retry` block declared on a step nothing is scheduled for.
  - [AshWorkflow.Verifiers.ValidateStepPolicies](AshWorkflow.Verifiers.ValidateStepPolicies.md): Verifies that a workflow declaring a policy has an authorizer to enforce it.
  - [AshWorkflow.Verifiers.ValidateTimeoutFields](AshWorkflow.Verifiers.ValidateTimeoutFields.md): Verifies that timeout `field` options are valid.
  - [AshWorkflow.Verifiers.ValidateTimeoutPrecision](AshWorkflow.Verifiers.ValidateTimeoutPrecision.md): Rejects timeouts whose deadline is shorter than the selected scheduler can honour.
  - [AshWorkflow.Verifiers.ValidateTransitionLog](AshWorkflow.Verifiers.ValidateTransitionLog.md): Verifies that a configured `transition_log` resource has the schema
`AshWorkflow.Changes.RecordEvent` and the `state_at/2`/`history/1` code
interface depend on.
  - [AshWorkflow.Verifiers.ValidateUndo](AshWorkflow.Verifiers.ValidateUndo.md): Verifies that undo is coherently configured.
  - [AshWorkflow.Verifiers.ValidateWorkflow](AshWorkflow.Verifiers.ValidateWorkflow.md): Verifies that workflow step declarations are valid and internally consistent.

## Mix Tasks

- Internals
  - [mix ash_workflow.backfill_transition_log](Mix.Tasks.AshWorkflow.BackfillTransitionLog.md): Seeds an approximate :initial transition-log row for existing records.
  - [mix ash_workflow.gen.transition_log](Mix.Tasks.AshWorkflow.Gen.TransitionLog.md): Scaffolds a transition log resource for a workflow
  - [mix ash_workflow.install](Mix.Tasks.AshWorkflow.Install.md): Installs AshWorkflow, along with AshOban, AshStateMachine and Oban

