Skip to content

[Feat]: Add schemas for functions automations#197

Open
kfirstri wants to merge 5 commits intomainfrom
support-automations
Open

[Feat]: Add schemas for functions automations#197
kfirstri wants to merge 5 commits intomainfrom
support-automations

Conversation

@kfirstri
Copy link
Contributor

@kfirstri kfirstri commented Feb 5, 2026

Note

Description

This PR adds comprehensive schema support for function automations in the Base44 CLI. It introduces Zod schemas for scheduled automations (one-time, cron, and simple recurring) and entity event-based automations, enabling functions to be triggered automatically on schedules or entity lifecycle events. The schemas validate automation configurations in function.jsonc files and include them in API payloads during deployment.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Added AutomationSchema with four automation types: one-time scheduled, cron scheduled, simple recurring scheduled, and entity event-based
  • Extended FunctionConfigSchema to include optional automations array field
  • Updated toDeployPayloadItem() in api.ts to include automations in API payload
  • Added skipped field to DeployFunctionsResponseSchema for functions not deployed due to validation
  • Removed unused FunctionDeploySchema (replaced by inline type in deployment logic)
  • Fixed FunctionWithCode type to correctly omit filePaths instead of files

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated AGENTS.md if I made architectural changes

Additional Notes

Automation types supported:

  • One-time scheduled: Execute once at a specific date/time
  • Cron scheduled: Recurring execution with cron expressions
  • Simple recurring: Recurring execution with user-friendly intervals (minutes, hours, days, weeks, months) with optional end conditions
  • Entity events: Trigger on entity lifecycle events (create, update, delete)

The automations field is optional, maintaining full backward compatibility with existing function configurations that don't use automations.


🤖 Generated by Claude | 2026-02-05 08:17 UTC

@kfirstri kfirstri self-assigned this Feb 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.28-pr.197.3dd0528

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.28-pr.197.3dd0528"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.28-pr.197.3dd0528"
  }
}

Preview published to npm registry — try new features instantly!

@kfirstri kfirstri marked this pull request as ready for review February 5, 2026 10:03
@claude
Copy link

claude bot commented Feb 5, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant