dr_workflow()
Named functions describe the receipt, preparation and dbt steps once.
Each function argument names an input or another step. Steps execute in
dependency order; a failed step blocks its consumers. Results remain ordinary
R values, so existing
dataraft.lake::dr_ingest(), dr_publish() and dbt calls keep their meaning.
Keep report issuance outside the workflow as an explicit final decision.
Usage
dr_workflow(..., inputs = list(), code_version = NULL)
\method{dr_run}{dr_workflow}(
pipeline,
lake = NULL,
inputs = list(),
previous = NULL,
refresh = character(),
stop_on_failure = TRUE,
...
)Arguments
- ...
- Named step functions. Their arguments must name dependencies;
defaults and
...in step functions are not supported. - inputs
- Named list of initial input values.
- code_version
- Explicit version of workflow code and dependencies. Required for every dependency graph.
- pipeline
- A workflow specification.
- lake
- Unused; supply storage inside the relevant step definition.
- previous
- Previous result from the same workflow input names.
- refresh
- Step names to rerun even when their inputs are unchanged.
- stop_on_failure
- Signal an error after collecting step status. Set
FALSEto inspect failures directly; errors also retaincondition$result.
Value
A workflow specification. Running it returns named
results,
effective inputs, and a step status table.
Details
On correction, pass replacement
inputs and the previous workflow result
to dr_run(). Unchanged successful branches are reused; changed inputs and their
consumers rerun. Failed branches retry on the next explicit call. Change
code_version whenever code, captured values or dependencies change. Use
refresh for named steps whose external sources changed without a new input.
This is sequential orchestration, not a scheduler or a distributed transaction.
Already committed steps stay committed if a later step fails.
Examples
flow <- dr_workflow(total = function(delivery) sum(delivery),
inputs = list(delivery = c(10, 20)), code_version = "v1")
dr_run(flow)$results$totalDocumentation source snapshot · View source at d9cb454 ↗
Code examples are documented source examples; they are not executed in this website build.
Code examples are documented source examples; they are not executed in this website build.