feat: add Workflows automations to OpenWork server and app#1606
Draft
benjaminshafii wants to merge 12 commits intodevfrom
Draft
feat: add Workflows automations to OpenWork server and app#1606benjaminshafii wants to merge 12 commits intodevfrom
benjaminshafii wants to merge 12 commits intodevfrom
Conversation
- Add inngest dependency and create client/functions/service - Inngest functions: run-automation and scheduled-automation - REST API: /workspaces/:id/automations (CRUD + trigger) - Inngest serve endpoint at /api/inngest - Direct execution fallback when Inngest dev server is offline - In-memory automation store for initial integration
- WorkflowsPanel component with create/trigger/delete UI - Preset workflow templates (Open Chrome to Facebook, standup, etc.) - Integrated into settings-route automations tab - Calls server-v2 /workspaces/:id/automations REST endpoints
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
…ion service directly
- prompt_async expects { parts: [{ type: 'text', text: prompt }] } not { content: prompt }
- Direct execution fallback now uses WorkspaceSessionService instead of HTTP self-call
- Verified end-to-end: automation creates session + sends prompt + agent responds
…r test evidence - Fix /api/inngest route to call InngestCommHandler correctly - Inngest dev server discovers 2 functions: run-automation, scheduled-automation - E2E: trigger -> Inngest event -> create-session step -> send-prompt step -> agent responds - Screenshots of Inngest dev server showing completed run with step trace
- Create apps/server/src/inngest.ts with automation CRUD + trigger - Add routes to server.ts: GET/POST/DELETE /workspace/:id/automations - Trigger creates OpenCode session and sends prompt via fetchOpencodeJson - Update WorkflowsPanel to use v1 URL pattern (/workspace/ not /workspaces/) - Install inngest in apps/server package.json
Tested against running Electron app (CDP port 9823) with server-v1 sidecar: 1. Settings > Automations shows Workflows panel with presets 2. Created 'Daily potato facts' automation via New Workflow modal 3. Automation appears in list with name, description, prompt, Run/Delete buttons 4. Clicked Run -> status shows 'Success', 'Last run: Just now' 5. Clicked Delete -> automation removed, presets shown again
Server: - PATCH /workspace/:id/automations/:autoId for updating name/prompt/schedule - Recurring scheduler: checks every 10s, fires automations whose interval elapsed - runCount tracking on automations - startScheduler() called at route init time App: - Schedule dropdown in create/edit modal (Manual, 30s, 1m, 5m, 15m, 1h, 6h, 24h) - Edit button on automation cards opens modal with current values - Purple recurring badge for scheduled automations - Run count display - Auto-refresh every 15s to pick up recurring status changes Tested via Chrome MCP against Electron dev: - Created 'Recurring potato writer' with Every 1 minute schedule - Observed Runs counter increment to 7 (recurring scheduler working) - Edited schedule from 1m to 5m via Edit modal - Schedule badge updated correctly
The app now shows a generic 'Workflows' surface with no mention of Inngest. The server-side implementation can be swapped in the future without any app changes. Removed: - 'Inngest' badge from Workflows header - 'Powered by Inngest' from modal footer -> 'OpenWork Workflows' - 'Inngest-powered' from description text - 'Connect to use Inngest-powered workflows' -> generic wording
Covers: create, trigger + OpenCode execution, edit schedule, recurring execution, delete, create from preset, server-disconnect graceful degradation. Follows the same format as react-session-flows.md with Chrome DevTools MCP tool recipes.
The Electron app uses server-v1. Server-v2 changes were premature — revert all server-v2 modifications to their dev branch state.
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.
Summary
Adds a Workflows system to OpenWork: users can create, trigger, edit, schedule, and delete automations from the Settings > Automations tab. Each workflow runs a prompt in OpenCode by creating a session and sending the configured prompt.
The server exposes a generic REST API (
/workspace/:id/automations). The app has no knowledge of the execution engine — it can be swapped without touching the frontend.What this adds
Server (
apps/server)src/automations.ts— automation store, CRUD, trigger, recurring schedulerGET /workspace/:id/automations— listPOST /workspace/:id/automations— createGET /workspace/:id/automations/:autoId— getPATCH /workspace/:id/automations/:autoId— update (name, prompt, schedule)DELETE /workspace/:id/automations/:autoId— deletePOST /workspace/:id/automations/:autoId/trigger— run nowsetIntervalin the server process, checks every 10s, fires automations whose interval has elapsedfetchOpencodeJsonand sends the prompt withprompt_asyncApp (
apps/app)WorkflowsPanelcomponent in the Automations settings tabEvals (
evals/workflow-automations.md)Architecture
Two execution paths, same outcome:
:8288fetchcalls to OpenCode, no retries, works out of the boxThe recurring scheduler always uses the direct path. The Inngest path is opt-in by starting
npx inngest-cli@latest devalongside the server.Testing
Electron dev flow (Chrome MCP on CDP port 9823):
API-level verification:
Typecheck:
pnpm tsc --noEmitpasses forapps/serverandapps/appFuture work