RunProject() runs multiple workflow phase folders in sequence, sharing one
lData object across phases. Each subdirectory of strPath is treated as a
phase. Phases are executed in sorted order (or in the order specified by
strPhases). Within each phase, workflows are loaded via
MakeWorkflowList() and run via RunWorkflows().
Usage
RunProject(
strPath,
lData = NULL,
lConfig = NULL,
strPhases = NULL,
bRecursive = FALSE,
bReturnResult = TRUE,
bKeepInputData = FALSE,
strResultNames = c("Type", "ID"),
bContinueOnError = FALSE
)Arguments
- strPath
characterPath to the project directory. Must contain one or more subdirectories, each holding workflow YAML files.- lData
listInitial named list of data objects. DefaultNULL.- lConfig
listRuntime configuration hooks. Top-levelLoadDataandSaveDatahooks are passed through toRunWorkflows()for each phase and run for each workflow in that phase. UselConfig$phasesfor phase-specific workflow hooks andlConfig$projectfor hooks that run once for the whole project. Phase handoff settings such asinput.from_phasesbelong in per-phase_config.yamlfiles, not inlConfig$phases.- strPhases
characterOptional vector of phase folder names to run. IfNULL(the default), all sorted subdirectories ofstrPathare used.- bRecursive
logicalPassed toMakeWorkflowList(). DefaultFALSE.- bReturnResult
logicalPassed toRunWorkflows(). DefaultTRUE.- bKeepInputData
logicalPassed toRunWorkflows(). DefaultFALSE.- strResultNames
characterVector of length two passed toRunWorkflows(). Defaultc("Type", "ID").- bContinueOnError
logicalPassed toRunWorkflows(). IfTRUE, failed workflows are recorded and later workflows/phases still run. DefaultFALSEretains the existing fail-fast behavior fromRunWorkflows().
Value
A named list with one element per phase. Each element contains the
result returned by RunWorkflows() for that phase. When
bContinueOnError = TRUE, returns a summary with results, status, and
failures.
Details
Phase folders and order:
strPathmust exist and be a directory; otherwise execution stops.By default phases are the immediate subdirectories of
strPath, executed in alphabetical order.When
strPhasesis supplied, phases run in the exact order given (caller order is preserved, not re-sorted).A
strPhasesentry that does not exist on disk stops execution.A phase folder that contains no workflow YAMLs is skipped with a workflow log message; execution proceeds with the remaining phases.
Per-phase _config.yaml files may define input and output maps. Unknown
keys stop execution. Without _config.yaml, all prior phase outputs are
available to the next phase.
Think of _config.yaml and lConfig$phases as two phase-scoped settings at
different layers. _config.yaml is project orchestration config: use
input.from_phases or input.from_results to select earlier phase data,
input.include_workflows to pass workflow definitions, and input.extra for
static values. Use output.wrap_as to store a phase result under one name or
output.transform to apply a function before later phases use the result.
lConfig$phases[[phase_name]] is workflow runtime config: it is merged into
the lConfig passed to RunWorkflows() for that phase, so use it for
phase-specific hooks such as LoadData and SaveData.
Load/save hooks:
Put
LoadDataorSaveDataat the top level oflConfigto pass those hooks toRunWorkflows()for each phase.RunWorkflows()then applies them to each workflow in that phase.Put hooks under
lConfig$phases[[phase_name]]to use them only for that phase. Phase hooks override top-level hooks with the same name.Put
LoadDataorSaveDataunderlConfig$projectto run once before or after the whole project. ProjectLoadDatamust return anlDatalist; projectSaveDatareceives the project result.