Skip to content

feat: add Layer 5 automation system with multi-step workflow executor - #23

Open
Vin124 wants to merge 1 commit into
mainfrom
layer5-automation
Open

feat: add Layer 5 automation system with multi-step workflow executor#23
Vin124 wants to merge 1 commit into
mainfrom
layer5-automation

Conversation

@Vin124

@Vin124 Vin124 commented Mar 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Full automation pipeline: parser → manager → executor → scheduler for creating, scheduling, and running automations via natural language
  • Multi-step workflow executor: tool-use loop (up to 6 turns) enabling chained actions like "search emails about X → summarize → send digest to Y"
  • On-demand triggering: run_automation tool lets the twin execute any saved automation immediately by name
  • Firestore persistence: automation specs, run history with actions_taken, and per-user CRUD via automation_repository
  • Background scheduler: APScheduler cron-based execution with token retrieval for headless runs
  • Batch executor: runs all pending automations for a user in one pass
  • Content generator: AI-written email/message bodies for body_mode: "generate" automations
  • 26 new files, including 11 test modules with comprehensive coverage

Key files

Path Purpose
agents/automation_parser.py NL → structured AutomationSpec (schedule/event/batch, static/generate/workflow)
agents/automation_executor.py Routes to single-tool, content-gen, or workflow executor
agents/automation_manager.py CRUD + enable/disable/delete via LLM tool use
daemons/automation_scheduler.py APScheduler cron loop, background execution
src/db/automation_repository.py Firestore reads/writes for automations + run history
src/agent/tool_defs.py create_automation, manage_automations, list_automations, run_automation tools
src/agent/chat.py Automation instructions wired into system prompt
src/server.py /automations REST endpoints + scheduler lifecycle

Test plan

  • Unit tests pass: pytest tests/test_automation_*.py tests/test_batch_executor.py tests/test_content_generator.py tests/test_workflow_executor.py tests/test_firebase_context.py
  • Create automation via chat: "send me a daily standup email at 9am"
  • Run automation on-demand: ask twin to "run my standup email automation"
  • Verify Firestore stores spec + run history correctly
  • Confirm scheduler picks up cron automations on server start

🤖 Generated with Claude Code

- Automation parser: NL request → structured spec (schedule/event/batch triggers)
- Automation executor: 3-step chain (fetch spec → generate body → MCP dispatch)
- Multi-step workflow executor: full tool-use loop for chained actions
  (e.g. search emails → summarize → send digest)
- Content generator: ghostwriter for message bodies in user's voice
- Batch executor: parallel swarm pattern for batch-trigger automations
- Automation manager: NL commands for pause/resume/edit/delete/run
- APScheduler daemon for cron-based background execution
- Firestore CRUD for automation specs and run history
- Token retrieval for background execution (get_access_token_for_uid)
- Tool denylist prevents recursion in workflow executor
- run_automation tool for on-demand /automation [name] triggering
- Google Sheets scope added to OAuth
- Fixed model ID (claude-opus-4-5-20250514 → claude-sonnet-4-20250514)
- 711 tests passing
@vercel

vercel Bot commented Mar 29, 2026

Copy link
Copy Markdown

@Vin124 is attempting to deploy a commit to the Johnathan's projects team on Vercel, but is not a member of this team. To resolve this issue, you can:

  • Make your repository public. Collaboration is free for open source and public repositories.
  • Upgrade to pro and add @Vin124 as a member. A Pro subscription is required to access Vercel's collaborative features.
    • If you're the owner of the team, click here to upgrade and add @Vin124 as a member.
    • If you're the user who initiated this build request, click here to request access.
    • If you're already a member of the Johnathan's projects team, make sure that your Vercel account is connected to your GitHub account.

To read more about collaboration on Vercel, click here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant