Skip to content

Remove legacy event workflow support - #1017

Merged
2witstudios merged 2 commits into
masterfrom
pu/workflows-and-folders
Apr 15, 2026
Merged

2witstudios merged 2 commits into
masterfrom
pu/workflows-and-folders

Conversation

@2witstudios

@2witstudios 2witstudios commented Apr 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • remove event-trigger workflow support from the public workflows API and dashboard
  • treat non-cron workflows as not found in list/manage/run paths
  • stop registering the legacy event workflow runtime and delete the old executor/tests

Assumption

  • no existing drives are using event-trigger workflows, so this PR intentionally makes a clean break instead of preserving dormant legacy rows pending migration

Verification

  • manual code review of updated workflow routes/components
  • git diff --check
  • unable to run workflow Vitest targets in this worktree because apps/web/node_modules is missing, so vitest is not available

Summary by CodeRabbit

Release Notes

  • Breaking Changes

    • Event-triggered workflows are no longer supported; only cron-based scheduling is available.
    • Existing event-triggered workflows are now inaccessible via the API.
  • UI Improvements

    • Simplified workflow creation and editing forms by removing event trigger configuration options.
    • Workflow list displays only cron schedules.

@vercel

vercel Bot commented Apr 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pagespace-master-plan Ready Ready Preview, Comment Apr 15, 2026 3:01am

@coderabbitai

coderabbitai Bot commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 96d22d94-96d9-4a32-9816-91d4ba77ae13

📥 Commits

Reviewing files that changed from the base of the PR and between c3fa069 and b9e2a04.

📒 Files selected for processing (1)
  • apps/web/src/components/workflows/WorkflowForm.tsx

📝 Walkthrough

Walkthrough

This PR removes event-driven workflows and restricts the system to cron-only scheduling. Event-trigger code, tests, schema fields, UI controls, and instrumentation hooks were deleted or tightened; APIs now reject or 404 non-cron workflows and cron logic is the single scheduling path.

Changes

Cohort / File(s) Summary
API — Collection
apps/web/src/app/api/workflows/route.ts, apps/web/src/app/api/workflows/__tests__/route.test.ts
Removed event-related schema/fields and .refine; request bodies are strict and require cron fields. MANAGEABLE_TRIGGER_TYPE = 'cron'; GET filters to cron workflows; POST persists triggerType: 'cron'. Added test rejecting event fields with 400.
API — Single Workflow
apps/web/src/app/api/workflows/[workflowId]/route.ts, apps/web/src/app/api/workflows/[workflowId]/__tests__/route.test.ts
Input schema no longer accepts event-trigger fields and is strict. getWorkflowWithAuth returns 404 unless workflow.triggerType is 'cron'. Removed event-branching; cron cronExpression resolution and nextRunAt computation are unconditional. Tests updated to assert 404 for legacy event workflows and changed PATCH validation expectations.
API — Execution
apps/web/src/app/api/workflows/[workflowId]/run/route.ts, apps/web/src/app/api/workflows/[workflowId]/run/__tests__/route.test.ts
Added MANAGEABLE_TRIGGER_TYPE = 'cron'. Route returns 404 for missing or non-cron workflows. Post-execution scheduling computes nextRunAt whenever enabled and cronExpression present. Test now expects 404 for non-scheduled (event) workflows and ensures no execution/scheduling.
Frontend — Forms & List
apps/web/src/components/workflows/WorkflowForm.tsx, apps/web/src/components/workflows/WorkflowList.tsx, apps/web/src/components/workflows/WorkflowsDashboard.tsx
Removed trigger-type toggle and all event-trigger UI/state. WorkflowFormData requires cronExpression; event fields removed. List always shows clock + cronExpression. Handlers updated to accept cron-only payloads; default edit cron set to '0 9 * * 1-5'.
Types
apps/web/src/components/workflows/types.ts
Removed EventTrigger re-export. Workflow.triggerType narrowed to 'cron'. Deleted optional event-related fields (eventTriggers, watchedFolderIds, eventDebounceSecs).
Event-trigger infra
apps/web/src/lib/workflows/event-trigger.ts, apps/web/src/lib/workflows/__tests__/event-trigger.test.ts
Deleted entire event-trigger implementation (emitWorkflowEvent, WorkflowEvent) and its comprehensive test suite (debounce/coalescing, scoping, execution claiming, status updates).
Instrumentation / Setup
apps/web/src/instrumentation.ts
Removed import/initialization of setWorkflowTriggerHook and emitWorkflowEvent; only activity broadcast hook remains. Removed workflow-trigger init log.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I nibbled event-clutter down to none,
Only cron carrots left under the sun,
Clocks now tick where zaps once played,
My hops are clean, my burrow's made—
Hop on, sweet schedules, our work is done! ⏰🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove legacy event workflow support' accurately and concisely summarizes the primary change across the entire changeset—eliminating event-trigger workflows throughout the API, database schema, UI components, and runtime.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pu/workflows-and-folders

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@2witstudios
2witstudios marked this pull request as ready for review April 15, 2026 00:33

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/web/src/components/workflows/WorkflowForm.tsx (1)

188-189: Stale comment: "Trigger Type Toggle" no longer applies.

The comment on line 188 references a trigger type toggle that has been removed. Consider updating or removing this comment.

📝 Suggested fix
-          {/* Trigger Type Toggle */}
           <div className="space-y-2">
+            {/* Cron Schedule */}
             <Label htmlFor="wf-cron">Schedule (Cron Expression)</Label>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/components/workflows/WorkflowForm.tsx` around lines 188 - 189,
Remove or update the stale JSX comment "Trigger Type Toggle" inside the
WorkflowForm component: locate the JSX block containing the div with className
"space-y-2" and the existing comment string "Trigger Type Toggle" and either
delete the comment or replace it with an accurate brief comment describing the
current content of that block (or leave no comment if unnecessary) so comments
match the current UI.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/web/src/components/workflows/WorkflowForm.tsx`:
- Around line 188-189: Remove or update the stale JSX comment "Trigger Type
Toggle" inside the WorkflowForm component: locate the JSX block containing the
div with className "space-y-2" and the existing comment string "Trigger Type
Toggle" and either delete the comment or replace it with an accurate brief
comment describing the current content of that block (or leave no comment if
unnecessary) so comments match the current UI.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 02f1e52b-a99b-4b6a-976a-43837ba928f4

📥 Commits

Reviewing files that changed from the base of the PR and between 92b7248 and c3fa069.

📒 Files selected for processing (13)
  • apps/web/src/app/api/workflows/[workflowId]/__tests__/route.test.ts
  • apps/web/src/app/api/workflows/[workflowId]/route.ts
  • apps/web/src/app/api/workflows/[workflowId]/run/__tests__/route.test.ts
  • apps/web/src/app/api/workflows/[workflowId]/run/route.ts
  • apps/web/src/app/api/workflows/__tests__/route.test.ts
  • apps/web/src/app/api/workflows/route.ts
  • apps/web/src/components/workflows/WorkflowForm.tsx
  • apps/web/src/components/workflows/WorkflowList.tsx
  • apps/web/src/components/workflows/WorkflowsDashboard.tsx
  • apps/web/src/components/workflows/types.ts
  • apps/web/src/instrumentation.ts
  • apps/web/src/lib/workflows/__tests__/event-trigger.test.ts
  • apps/web/src/lib/workflows/event-trigger.ts
💤 Files with no reviewable changes (2)
  • apps/web/src/lib/workflows/tests/event-trigger.test.ts
  • apps/web/src/lib/workflows/event-trigger.ts

@2witstudios
2witstudios merged commit 5884041 into master Apr 15, 2026
12 checks passed
@2witstudios
2witstudios deleted the pu/workflows-and-folders branch April 16, 2026 01:31

This branch was previously deployed

1 inactive deployment
Preview — b9e2a04a Deployed Apr 15, 2026 by vercel[bot]
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