Workflow Automation
Pipeline Status
Mark Retries
Automation needs a compact status summary so a failed step can be retried deliberately.
Program
Play the script to choose whether a pipeline step needs a retry.
pipeline_status.R
failed_step <-
steps <- c("extract", "transform", "load")
status <- rep("ok", length(steps))
if (failed_step > 0) {
status[failed_step] <- "retry"
}
ready <- all(status == "ok")
label <- paste(ifelse(ready, "ready", "blocked"), paste(status, collapse = "/"), sep = ":")
cat(label, "\n", sep = "")
failed_step <-
steps <- c("extract", "transform", "load")
status <- rep("ok", length(steps))
if (failed_step > 0) {
status[failed_step] <- "retry"
}
ready <- all(status == "ok")
label <- paste(ifelse(ready, "ready", "blocked"), paste(status, collapse = "/"), sep = ":")
cat(label, "\n", sep = "")
failed_step <-
steps <- c("extract", "transform", "load")
status <- rep("ok", length(steps))
if (failed_step > 0) {
status[failed_step] <- "retry"
}
ready <- all(status == "ok")
label <- paste(ifelse(ready, "ready", "blocked"), paste(status, collapse = "/"), sep = ":")
cat(label, "\n", sep = "")
status vector
A status vector records one state per workflow step.
retry flag
Changing one position to `retry` marks the step that needs attention.
ready check
`all(status == "ok")` turns step states into one pipeline decision.