From 49a6001dde72622df9410b738322e9a23e68ddee Mon Sep 17 00:00:00 2001 From: t Date: Fri, 21 Aug 2026 11:26:48 -0600 Subject: Add workflow cancellation controls --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 1cbf917..e985c18 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ top-level `output = ["id", ...]` array names, in that order. The Lua workflow API handles dynamic branching and fan-out. `subagents.lua` starts model-authored workflows in a restricted environment and returns a session-scoped workflow ID immediately. Work continues on Pantograph's event -loop; completion wakes the primary, and later calls can inspect immutable +loop; completion wakes the primary, and later calls can inspect field-read-only records through `subagents.workflows[id]`, including named child status and outputs. Every `ctx:agent` needs a workflow-unique `name`, and the callback must return the workflow's string result. @@ -148,7 +148,10 @@ return the workflow's string result. The same read-only workflow records are exposed to other extensions as `panto.ext.workflows`. Extensions can iterate this table or look up an ID; each record has `id`, `status`, `result`, `error`, and `agents`, and a `status` of -`running` identifies in-flight background work. +`running` identifies in-flight background work. Fields are read-only, but +`workflow:cancel()` requests cancellation for every running agent and +`workflow.agents[name]:cancel()` requests cancellation for one; both return +true only while their target is running. Inline `agents` remain scoped to workflows started by that tool call. The API can await one job or a group and supports one-turn workers whose validated tool -- cgit v1.3