Repository navigation
feat(automations): run a workflow, a pipeline or a routine - #441
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01CyjR2zEfmTXBewKAx9Taw5
19 of 22 tasks
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.
Description
Before: automations could message people, use the model and call a web address, but they couldn't start Lens's own work.
After: the Run group of actions (workflow studio M7), all with effect
lens:run_workflow: runs a recordingworkflowon anassetas a job, using its publishedversionor the one named. Output{job, workflow, version, asset}. A graph workflow is refused, since a routine runs those.run_pipeline: processes anassetagain with apipeline, or the one its namespace uses, and keeps its outputs. Output{job, pipeline, asset}.run_routine: asks the scheduler to run aroutinenow, as Run in Settings does, withpropose_onlyif asked. Output{routine, requested, propose_only}. Routines belong to admins, so the person must be one. The routine must work only in the automation's namespaces, and a run over one of its budgets is refused. Its subject is never the event's object, so it always asks first.assettakes an asset id or the activity's object id (lens:recording/<id>). It defaults to{{ event.object.id }}. On the asset the activity is about, inside the automation's namespaces, the action is routine; on any other asset, it asks first. Each one checks that the person canprocessassets in that namespace now. Jobs and runs show as by "automation: ".actions.pygains shared asset helpers, which the next PR (asset changes and notes) uses too:asset_id,asset_subject,asset_param,on_asset,asset_forandallowed.Motivation and Context
Workflow studio, module M7 (plan:
/mnt/project-files/workflow-studio/plan.md§5 M7), PR 4 of 5. Earlier PRs: #433 (notify), #438 (AI), #439 (web). Set a field, move to a collection and write a note come next.Choice taken (reversible):
run_routinepasses onrequestedrather than a run id. The scheduler starts the run within half a minute, and the run's id then shows in the routine's runs. Passing the id on is in refine later.Types of changes
!in the title)Checklist:
tests/api/test_actions_run.pycovers:docs/accordingly (docs/automations.md"Running Lens work", the Actions rows, refine later).Done questions (AGENTS.md)
actions.catalog(), which M6 serves to the API, MCP and the assistant.assetdefaults to the event's object;versiondefaults to the published one, andpipelineto the namespace's.docs/automations.md:🤖 Generated with Claude Code
https://claude.ai/code/session_01CyjR2zEfmTXBewKAx9Taw5
Generated by Claude Code