Repository navigation
feat(automations): a decide node for judgement calls - #549
Merged
Merged
Conversation
A decide node in an automation's workflow asks the decision model which of its options fits what came in, inside the run's activity scope, and the run goes on along the chosen option's port or along unsure. Its input renders as prompts do, with outside text marked; answers are kept per activity and question so retries and dry runs don't pay twice; steps.<id> gets the decision. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AjJqXgjj1cNdKGRQbX5frb
21 of 23 tasks
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 decide node in an automation's workflow was refused when the workflow was saved, as coming soon; a judgement call ("Does this email need me today?") had to be a condition or switch on fields.
After: a decide node asks the decision model (Jev, then Laya, then the language model, as in Routine choices) a question with 2 to 10 options, and the run goes on along the port of the option it picked, or along
unsurewhen it isn't sure enough (min_confidence, elsedecisions.act_above), when no decision or language model is set up, or when the budget's hard limit is reached. What it reads is the node'sinputtemplate, rendered as prompts are with outside text marked, or the event's summary and its outside fields, marked. The answer is kept per activity and question for 7 days, so a retry or Try it of the same activity doesn't pay again; the call sits in the run's activity scope, so it shows in the ledger under the automation and the run and counts towards budgets.steps.<node id>gets{port, choice, confidence, sure}.Workflow studio module M5, part 5 of 5 (plan section 5, M5 item 5). No model is called unless an automation has a decide node, and then only for activities that reach it.
How:
match.check_decide(the node's config: question, options,input,min_confidence),match.run_decide(the call through the decision layer insideactivity.scope, the cache inautomation_state, the port).automation_nodes.pyrunsdecidenodes and no longer refuses them;variables.pyrenders the node's input withuntrustedmarks.## UnreleasedinCHANGELOG.md;docs/automations.mdThe decide node.Motivation and Context
Adeel asked for the agent to decide inside an automation, with the model only where it adds value and never paying twice.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
unsure; merged on green CI.unsure.decisions.act_above.untrusted.wrap), so instructions in an email are read as content; the model sees what the automation's person may see.unsurewhen spent) and is cached per activity and question.unsure.automation_statetable, no stored shape changes.tests/domain/test_match_decide.py;docs/automations.mdThe decide node.decisions),activity.scope,untrusted.wrap, prompt rendering invariables.py.Generated by Claude Code