Skip to main content
You’re viewing developer documentation
This documentation is for developers working with the Base44 developer platform. For information about automations in the app editor, see Creating automations for your app.
Automations allow backend functions to run automatically on a schedule, in response to database events, or when a connected integration sends a webhook event. Use automations to process data at regular intervals, handle entity changes, react to external service events, or execute one-time tasks at specific times. Each backend function can have multiple automations attached, configured in the function’s function.jsonc file. If you only have an entry.ts or entry.js file, you’ll need to add this configuration file to use automations. Automations are deployed atomically with the function code when you run deploy or functions deploy.

Automation types

Base44 supports 4 types of automations:

Common fields

Common fields for all automations

All automation types share the following fields:

Common fields for scheduled automations

Both cron and simple scheduled automations share these additional fields:

Automation configuration

Configure automations in your function.jsonc file using one of the following approaches. All automations use the common fields for all automations listed above, plus the fields specific to each type.

Cron

Use common fields for all automations and common fields for scheduled automations along with the cron-specific fields listed here. Set type to "scheduled" and schedule_type to "cron" to use cron expressions for precise scheduling control. Cron automations use standard 5-field syntax: minute hour day-of-month month day-of-week. See crontab.guru for an interactive cron expression editor and syntax reference.

Cron example

This example runs a function every day at midnight UTC:

Simple schedule

Use common fields for all automations and common fields for scheduled automations along with the simple schedule fields listed here. Set type to "scheduled" and schedule_type to "simple" for straightforward scheduling needs. Configure recurring tasks by interval such as minutes, hours, days, weeks, or months without writing cron expressions.

Simple schedule examples

The following examples show different ways to schedule automations with simple schedules:

Entity events

Use common fields for all automations along with the entity event fields listed here. Set type to "entity" to trigger functions automatically when database records are created, updated, or deleted. Entity automations can listen to 1 or more event types on a specific entity.
Entity automations only fire for single-record create, update, and delete calls made through the entities API. Bulk operations, such as bulkUpdate(), and by-query operations, such as updateMany(), do not trigger entity automations, even when they affect records that match your entity’s name. Restoring a soft-deleted record or permanently deleting one also does not trigger an automation. If your automation must react to every change, avoid bulk or by-query writes on that entity, or trigger the automation’s logic manually instead.

Entity event examples

The following examples show how to trigger functions based on entity events:

Connector automations

Use common fields for all automations along with the connector-specific fields listed here. Set type to "connector" to trigger functions when a connected integration sends a webhook event. Use these to react to external service activity in real time. For example, you can parse a new email, sync a calendar change, or respond to a file update in Google Drive. You can optionally add trigger conditions to filter events so your function only runs when the payload matches rules you define. When a connector automation fires, your function receives a structured webhook payload containing the event type, integration details, and the raw data from the external service.
The connector must be configured in your project and authorized before deployment. See Shared connectors for setup instructions.

Supported integrations and events

Gmail’s mailbox event fires for any mailbox change, not just new messages. To run your function only when new emails arrive, add a trigger condition: { "field": "has_new_messages", "operator": "equals", "value": true }.
Slack (slack) and Slack Bot (slackbot) connector automations require trigger conditions. Deployment will fail if no conditions are set for these connector automations.

Resource ID formats

The expected value for resource_id varies by connector:
  • Google Drive: The file ID. Required for file-scoped events (file, file.update, file.trash, file.untrash, file.delete).
  • Gmail: A comma-separated list of label IDs to watch. Defaults to "INBOX" if omitted.
  • Microsoft Teams: {teamId}/{channelId} to watch a specific channel, or {chatId} to watch a specific chat.
  • SharePoint: {siteId}/{listId} to watch a specific list.

Trigger conditions

Use trigger_conditions to filter webhook events so your function only runs when the payload matches rules you define. If no conditions are set, the function runs for every incoming event. See Connector automation examples for complete configurations.
string
How to combine the conditions. Possible values: "and" (all must match), "or" (any must match). Defaults to "and".
array
required
One or more condition objects or nested condition groups. Maximum 20 leaf conditions and 5 levels of nesting.

Webhook payload

When a connector automation triggers your function, the request body contains a payload object with the following structure. See Connector automation examples for a function that reads the payload.

Connector automation examples

Function arguments

Pass data to your function when it’s triggered by including the function_args field in your automation configuration. This is useful when one function handles multiple automations with different behaviors, such as a sync function that runs incrementally every 15 minutes but does a full sync daily. Access these arguments in your function code through the request body.

Function arguments example

This example shows a function that handles both incremental and full sync modes based on the automation config:

Deploy automations

Deploy backend functions with their automations using the CLI functions deploy command or the unified deploy command. You can deploy specific functions by name with functions deploy <names...>. The deployment is atomic per function. A function is only considered deployed if both the Deno deployment and all its automations succeed. If any automation fails to deploy, the entire function deployment is rolled back. After deploying, the CLI shows per-function status: deployed, unchanged, or error.

Manage automations in the dashboard

Any changes made in the dashboard will be overwritten the next time you run functions deploy. There is no two-way sync between the dashboard and your local files. Automations defined in your local function.jsonc files are the source of truth.If you want to make changes to your automations, update your local function.jsonc files and redeploy. Use the dashboard for monitoring execution logs and manually triggering automations when needed.
View and manage your automations in the Base44 dashboard under the Automations tab. From the dashboard, you can:
  • View execution logs and history
  • Run automations manually for testing
  • Monitor automation status

See also