MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / workflow

Method workflow

src/workflow/runtime.py:279–301  ·  view source on GitHub ↗
(self, name_or_ref: str, args: Any = None)

Source from the content-addressed store, hash-verified

277 self._progress.log(str(message))
278
279 async def workflow(self, name_or_ref: str, args: Any = None) -> Any:
280 if self._depth >= 1:
281 raise WorkflowError("workflow() nesting is one level only")
282 if self._resolve_workflow is None:
283 raise WorkflowError("nested workflows are not available in this run")
284 # Consume a slot so the nested run's keys don't collide with siblings.
285 slot = current_branch().next_slot()
286 source = self._resolve_workflow(name_or_ref)
287 sub = await run_workflow(
288 source,
289 runner=self._runner,
290 args=args,
291 run_id=f"{self._run_id}/{name_or_ref}",
292 resolve_workflow=self._resolve_workflow,
293 scheduler=self._scheduler, # share the concurrency cap
294 budget=self._budget, # share the budget pool
295 controller=self._controller,
296 base_path=current_branch().path + (slot,),
297 _depth=self._depth + 1,
298 )
299 if not sub.ok:
300 raise WorkflowError(f"nested workflow '{name_or_ref}' failed: {sub.error}")
301 return sub.value
302
303 # ── internals ──────────────────────────────────────────────────────────
304 def _next_display(self) -> int:

Callers

nothing calls this directly

Calls 4

WorkflowErrorClass · 0.85
current_branchFunction · 0.85
run_workflowFunction · 0.85
next_slotMethod · 0.80

Tested by

no test coverage detected