diff options
| author | t <t@tjp.lol> | 2026-08-21 11:26:48 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-08-21 11:26:48 -0600 |
| commit | 49a6001dde72622df9410b738322e9a23e68ddee (patch) | |
| tree | c00f587a76b186f69872ba7362b77b9637358293 /README.md | |
| parent | 2d4981b3870f2aee75d03006eea6318c501fe47b (diff) | |
Add workflow cancellation controls
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 |
