Skip to main content

set_workflow_scope

Function set_workflow_scope 

Source
pub fn set_workflow_scope(
    name: &str,
    doc: &str,
    meta: &Value,
    task_context: Option<&TaskContextHandle>,
) -> Result<WorkflowGuard>
Expand description

High-level entry the workflow/run builtin calls: resolve the run id + run-dir, open the journal, build the WorkflowCtx, write metadata.json, install the scope, and return the guard. The journal-open error propagates so the runtime can fail the run cleanly (per-event writes below are best-effort).

meta is the workflow’s metadata map ({:phases … :budget … :args …}); it is recorded into metadata.json, and :budget is parsed into the run’s spend caps. :permissions is enforced by the CLI before the interpreter is built.