Skip to contents

Launches a detached background R process that evaluates expr (or sources file) inside the run sandbox, registers the job, and returns immediately. Never blocks on the fit. expr is evaluated with RUN_DIR bound to the run directory.

Usage

start_nlme_job(
  expr = NULL,
  file = NULL,
  label = "job",
  project_dir = ".",
  extra_meta = NULL,
  env = NULL
)

Arguments

expr

Optional R code (single string) to evaluate in the child.

file

Optional path to an R script to run in the child (used when expr is NULL).

label

Short human label used in the job id / slug.

project_dir

Project root under which the run sandbox is created.

extra_meta

Optional named list of extra fields merged into the registered job record (jobs.jsonl) and the returned metadata.

env

Optional named list/character vector of environment variables to export in the child process (e.g. a launch recipe's input .rds paths). Reserved names RUN_DIR / NLME_MCP_RUN_DIR are managed by the runner and cannot be set here.

Value

A list: job_id, run_dir, state ("running"), a next_action directive pointing at wait_for_nlme_job(), plus any extra_meta fields.