% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/workflow__run_task.R
\name{run_task_batch}
\alias{run_task_batch}
\title{Run Multiple Tasks in Batch}
\usage{
run_task_batch(
  prompts,
  output_format = "text",
  temporal = NULL,
  config = NULL,
  agent = NULL,
  parallel = FALSE,
  workers = NULL,
  progress = TRUE,
  circuit_breaker = TRUE,
  abort_on_trip = FALSE,
  field_status = NULL,
  budget_state = NULL,
  search_budget_limit = NULL,
  unknown_after_searches = NULL,
  finalize_on_all_fields_resolved = NULL,
  orchestration_options = NULL,
  performance_profile = NULL,
  webpage_policy = NULL,
  allow_read_webpages = NULL,
  webpage_relevance_mode = NULL,
  webpage_embedding_provider = NULL,
  webpage_embedding_model = NULL,
  recursion_limit = NULL
)
}
\arguments{
\item{prompts}{Character vector of task prompts, or a data frame with a
'prompt' column}

\item{output_format}{Expected output format (applies to all tasks)}

\item{temporal}{Named list for temporal filtering (applies to all tasks).
See \code{\link{run_task}} for details.}

\item{config}{Optional \code{asa_config} object to apply across the batch.
When provided, \code{config$temporal} is used if \code{temporal} is NULL, and
\code{config$workers} is used if \code{workers} is NULL. In parallel mode,
the config is sent to worker processes so each worker can initialize its
own agent session.}

\item{agent}{An asa_agent object}

\item{parallel}{Use parallel processing}

\item{workers}{Number of parallel workers}

\item{progress}{Show progress messages}

\item{circuit_breaker}{Enable circuit breaker for error rate monitoring.
When enabled, tracks recent error rates and pauses if threshold exceeded.
Default TRUE.}

\item{abort_on_trip}{If TRUE, abort the batch when circuit breaker trips.
If FALSE (default), wait for cooldown and continue.}

\item{field_status}{Optional named list tracking per-field resolution status.
Passed through to \code{\link{run_task}}.}

\item{budget_state}{Optional list tracking search budget consumption across
batch items. Passed through to \code{\link{run_task}}.}

\item{search_budget_limit}{Optional integer maximum number of searches per
task. Passed through to \code{\link{run_task}}.}

\item{unknown_after_searches}{Optional integer threshold: if a field remains
unknown after this many searches, mark it resolved. Passed through to
\code{\link{run_task}}.}

\item{finalize_on_all_fields_resolved}{Optional logical; if TRUE, finalize
immediately when all schema fields are resolved. Passed through to
\code{\link{run_task}}.}

\item{orchestration_options}{Optional named list/dict of generic orchestration
options passed through to \code{\link{run_task}}.}

\item{performance_profile}{Optional orchestration profile passed through to
\code{\link{run_task}}.}

\item{webpage_policy}{Optional structured OpenWebpage policy passed through to
\code{\link{run_task}}.}

\item{allow_read_webpages}{If TRUE, allows the agent to open and read full
webpages (HTML/text) via the OpenWebpage tool. Disabled by default.}

\item{webpage_relevance_mode}{Relevance selection for opened webpages.
One of: "auto", "lexical", "embeddings". See \code{\link{run_task}}.}

\item{webpage_embedding_provider}{Embedding provider for relevance. See
\code{\link{run_task}}.}

\item{webpage_embedding_model}{Embedding model identifier. See
\code{\link{run_task}}.}

\item{recursion_limit}{Optional maximum number of agent steps applied to each
task. See \code{\link{run_task}}.}
}
\value{
A list of asa_result objects, or if prompts was a data frame,
  the data frame with result columns added (including per-row operational
  metadata and full per-row \code{asa_result} objects via list column
  \code{asa_result} and attribute \code{asa_results}). If circuit breaker aborts,
  includes attribute "circuit_breaker_aborted" = TRUE.
}
\description{
Executes multiple research tasks, optionally in parallel. Includes a circuit
breaker that monitors error rates and pauses execution if errors spike,
preventing cascading failures.
}
\examples{
\dontrun{
prompts <- c(
  "What is the population of Tokyo?",
  "What is the population of New York?",
  "What is the population of London?"
)
results <- run_task_batch(prompts, agent = agent)

# With temporal filtering for all tasks
results <- run_task_batch(
  prompts,
  temporal = list(time_filter = "y"),
  agent = agent
)

# Disable circuit breaker
results <- run_task_batch(prompts, agent = agent, circuit_breaker = FALSE)

# Abort on circuit breaker trip
results <- run_task_batch(prompts, agent = agent, abort_on_trip = TRUE)
}

}
\seealso{
\code{\link{run_task}}, \code{\link{configure_temporal}}
}
