feat: add Workflows automations to OpenWork server and app#1606
Draft
benjaminshafii wants to merge 1 commit into
Draft
feat: add Workflows automations to OpenWork server and app#1606benjaminshafii wants to merge 1 commit into
benjaminshafii wants to merge 1 commit into
Conversation
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: |
71d8845 to
bb87ed2
Compare
342f50b to
16dea99
Compare
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