Repository navigation
feat(automations): draft an automation from a sentence - #464
Merged
Merged
Conversation
POST /api/v1/automations/draft asks the model once to turn a sentence into a draft automation, with the kinds of activity and their fields, the match operators and the actions as its vocabulary. The reply is checked piece by piece: a trigger, its where, the If or an action that doesn't fit is dropped and said, and what the sentence asked for that can't be expressed yet (schedules) is listed. Nothing is saved. The call counts in the activity ledger and isn't made over budget. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCAZ9NEmBJNovqdzxvK3qi
16 of 22 tasks
adeelahmad
added a commit
that referenced
this pull request
Oct 16, 2026
Automations merged (#432 to #464): the stream now holds every kind of activity, the Timeline page reviews it, and automations act on it with triggers, conditions, actions, approvals, limits and budgets, made by agents over MCP and in the assistant or drafted from a sentence. Say so under Automate it, with the studio labelled planned as docs/automations.md does; add the open RSS feeds (#453) and condition operators (#434) to In progress; link the timeline from the docs index. Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS Co-authored-by: Adeel Ahmad <noreply@anthropic.com>
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: making an automation meant writing its triggers, If and graph as JSON.
After:
POST /api/v1/automations/draft {"text": "when a new email from the school comes in, tell me", "spaces": [...]}asks the model once and gives back a draft automation to try and save, with what didn't fit (dropped) and what it couldn't express yet (unmapped, such as "when both arrive" while joins are planned). A draft may listen for activities, a webhook (its address comes when it is saved), a schedule, a time or a time in an activity (#450's triggers, in UTC unless the sentence names a zone), or a person running it. Nothing is saved.How:
app/domain/automation_draft.pygives the model the vocabulary Lens has (the kinds with their fields, the If operators and the actions catalog) and a JSON schema, is told about triggers in time only once the timers that run them are there, then maps what comes back onto real triggers, a match tree and a chain of action nodes, dropping anything unknown and checking the result with the same checks as saving. The call goes through the activity ledger and is refused when a budget for the person's account or the chosen namespaces is used up, or no model is set up.Motivation and Context
Workflow studio, module M6 (automation engine), part 5 of 5: drafting from a sentence, so the builder (M11) and agents can start from words.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
save_automation.tests/domain/test_automation_draft.py,tests/api/test_automations.py), docs (docs/automations.md,docs/api.md) and the generated client (make openapi) updated.docs/automations.md.Checked locally: full backend suite (1328 passed), ruff, mypy, the threat model check,
mkdocs build --strictandmake openapi(no change).🤖 Generated with Claude Code
https://claude.ai/code/session_01VCAZ9NEmBJNovqdzxvK3qi
Generated by Claude Code