Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.

Cron + Postgres support#37

Merged
awantoch merged 5 commits intomainfrom
feat/cron-and-postgres
Jul 27, 2025
Merged

Cron + Postgres support#37
awantoch merged 5 commits intomainfrom
feat/cron-and-postgres

Conversation

@awantoch
Copy link
Copy Markdown
Collaborator

Cron and PostgreSQL storage support

  • Introduced global and per-workflow cron endpoints to trigger workflows based on schedule.cron.
  • Added PostgreSQL storage implementation for managing workflow runs.
  • Supports system cron in server mode, respecting workflow cron definition and triggering with curl /cron/{workflow}
  • Supports Vercel Cron via /cron HTTP endpoint
  • Enhanced existing workflows to utilize cron triggers and added tests for cron functionality.
  • Updated documentation for cron setup and usage.

This commit enhances the scheduling capabilities of BeemFlow, allowing for more flexible and reliable workflow execution.

…s and PostgreSQL storage support

- Introduced global and per-workflow cron endpoints to trigger workflows based on schedule.cron.
- Added PostgreSQL storage implementation for managing workflow runs.
- Updated configuration to support cron integration in server mode.
- Enhanced existing workflows to utilize cron triggers and added tests for cron functionality.
- Updated documentation for cron setup and usage.

This commit enhances the scheduling capabilities of BeemFlow, allowing for more flexible and reliable workflow execution.

Signed-off-by: Alec M. Wantoch <alec@wantoch.com>
@awantoch awantoch added this to the MVP milestone Jul 27, 2025
@awantoch awantoch self-assigned this Jul 27, 2025
@vercel
Copy link
Copy Markdown

vercel Bot commented Jul 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
beemflow ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 27, 2025 5:16pm

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Bugbot free trial expires on July 29, 2025
Learn more in the Cursor dashboard.

Comment thread core/cron.go Outdated
- Changed cron schedule from every 5 minutes to every 30 minutes in vercel.json.
- Modified the serverless function initialization to return a cleanup function in api/index.go.
- Added early exit response for cases with no workflows in core/operations.go.
- Adjusted PostgreSQL connection pool settings for serverless optimization in storage/postgres.go.

These changes improve the scheduling efficiency and resource management of the application.

Signed-off-by: Alec M. Wantoch <alec@wantoch.com>
Comment thread api/index.go Outdated
- Introduced context with timeout for serverless requests to ensure proper cleanup.
- Added a serverless flag to the context to indicate serverless execution.
- Configured in-memory event handling for serverless operations.

These changes enhance the serverless function's reliability and performance during execution.

Signed-off-by: Alec M. Wantoch <alec@wantoch.com>
Comment thread core/cron.go Outdated
Comment thread api/index.go Outdated
- Added unit tests for CORS handling and health check endpoints in api/index_test.go.
- Updated .gitignore to exclude test database files.
- Refactored api/index.go to improve resource management and initialization for serverless functions.
- Introduced shell quoting functionality in core/cron.go to enhance security in cron command generation.

These changes improve the reliability of the application and ensure proper handling of database configurations and HTTP requests.

Signed-off-by: Alec M. Wantoch <alec@wantoch.com>
Comment thread core/cron.go
Comment thread core/operations.go Outdated
Comment thread core/cron.go Outdated
- Added a test mode in main.go to prevent actual server startup during tests.
- Updated main_test.go to set the test mode environment variable.
- Enhanced cron functionality in cron.go and operations.go to prevent path traversal and command injection attacks.
- Introduced new tests in cron_test.go to validate security against path traversal and command injection.

These changes improve the testing framework and enhance the security of cron operations in BeemFlow.

Signed-off-by: Alec M. Wantoch <alec@wantoch.com>
@awantoch awantoch merged commit 3a5a8d2 into main Jul 27, 2025
3 checks passed
@awantoch awantoch deleted the feat/cron-and-postgres branch July 27, 2025 17:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant