Repository navigation
feat(workflows): an event scope for automations, with action and decide nodes - #436
Merged
Merged
Conversation
…de nodes What an automation does is a workflow of scope event: its input passes on the run context, and action nodes render their params from it, work out effect and risk, and make intents (done at once, asked first, or waiting for a time). The leaf rule keeps anything after an action that reaches outside or waits off every save path. flow.Kit gains optional ports, keeps and check_graph hooks; decide nodes are refused as coming soon until the decision model lands. Event workflows are tried on an activity or a kind's sample, kept out of the canvas list, and never run by pipelines, routines or on an asset. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCAZ9NEmBJNovqdzxvK3qi
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCAZ9NEmBJNovqdzxvK3qi
…-sxrerj # Conflicts: # docs/automations.md
…-sxrerj # Conflicts: # docs/automations.md
…faults before rendering An action node renders a prompt param (format prompt) with actions.render_prompt, so what the run read from outside Lens is marked as data; fills the action's defaults before rendering, so a default that is a template (ask_agent's about) is filled in; and counts a node whose output says untrusted (an http_request answer) as outside text for the params that read it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCAZ9NEmBJNovqdzxvK3qi
…-sxrerj # Conflicts: # docs/automations.md
…-sxrerj # Conflicts: # docs/automations.md
…-sxrerj # Conflicts: # docs/automations.md
This was referenced Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: a workflow ran on assets, organised the graph, or was an assistant tool's body. Nothing could describe what an automation does.
After: a workflow of scope
eventis what an automation does (workflow studio M6, part 1 of 5). Its input passes on the run context (the event, the automation, the person,steps...), and its action nodes fill their params in from it ("text": "New: {{ event.object.name }}"), work out effect and risk, and make an intent: done at once, asked first, or waiting for a time. An action that asks first or waits passes nothing on, so the nodes after it are skipped and the log says where it stopped.POST /api/v1/workflows/testwithscope: eventtries one on a real activity (by id) or a kind's sample and lists what each action would do. The decide node is in the catalog with a port per option plusunsure, and is refused as coming soon until the decision model lands (M5).How:
flow.Kitgains three optional hooks that default to today's behaviour:ports(node)(decide's ports),keeps(node)(an action node counts as doing something without being terminal, so it keeps itsoutport) andcheck_graph(nodes, edges)(the leaf rule: an action that reaches outside Lens or waits has nothing after it, on every save path including/api/v1/workflows).app/domain/automation_nodes.pyholds the kit: checks, rendering (a param that is exactly one{{ }}expression keeps its type), the baseline run context, and anIntentsbox the automations module will keep and hand off from. It calls the variables, timers and match modules once they exist and keeps a baseline until then. Event workflows are left out of the canvas's list (?scope=eventlists them) and refused as a pipeline step, a routine's action or a run on an asset.With the M7 actions now on main, an action node also fills in the action's defaults before rendering (so
ask_agent'sabout: "{{ event }}"andrun_workflow'sasset: "{{ event.object.id }}"are filled in), renders prompt params ("format": "prompt") withactions.render_promptso outside text is marked as data, and counts a node whose output saysuntrusted(anhttp_requestanswer) as outside text for the params that read it.Motivation and Context
Workflow studio, module M6 (automation engine), brief section 2 "The event workflow scope". Next PRs: storing automations and their API, the dispatcher and runs, agent tools, drafting from a sentence.
Defaults I picked: event workflows are hidden from the generic list so the canvas (which doesn't draw them yet) is unchanged;
delay/whenon an action and the decide node refuse to save as "coming soon" until timers and the decision model are merged.Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md. (n/a: plumbing for automations; the changelog line comes with storing and running them)Done questions (AGENTS.md)
untrusted; anything reaching outside asks first. Threat model entries come with running automations.out, orlensoutside the event's own object, ask first; no defaults change.make openapi).docs/automations.md.Tests:
tests/domain/test_automation_nodes.py,tests/api/test_event_workflows.py; full backend suite passed locally (1201 passed), ruff, mypy, frontendtsc,mkdocs build --strict.🤖 Generated with Claude Code
https://claude.ai/code/session_01VCAZ9NEmBJNovqdzxvK3qi
Generated by Claude Code