Timill Platform Documentation

Scripts

Backend scripts, scripted widgets and charts.

Scripts let you automate workflows and extend group behavior with code that runs on the server. Backend scripts are written in JavaScript; scripted widgets use Gonja (a Jinja2-style template language) instead.

Creating a script#

From the scripts section, create a script and choose what kind: an automation (manual or scheduled) or an item script (save hook or menu), then write the logic in the built-in code editor.

Triggers#

A script runs based on its trigger:

  • Manual — run on demand from the scripts admin.
  • Schedule — run on a recurring cron schedule.
  • Event — run when something happens in the group (e.g., an item is created, updated, or deleted).
  • Save hook — run as part of saving an item, for example to validate or adjust field values before they are stored.
  • Menu — added as an entry in an item’s context menu, and run on demand when someone picks it.

See Backend scripts for what each trigger runs as, what’s available to the script, and how writes behave — and Script administration for limits and troubleshooting.

Scripted widgets and charts#

Scripts can also power custom scripted widgets and scripted charts on pages and dashboards, producing the data (or chart configuration) that the widget renders.

Secrets#

Scripts can reference group secrets (API keys, tokens) by name without exposing the raw value in code. Manage them in the Secrets section.

Tips#

  • Use a save hook for validation and computed fields so the rules apply no matter how an item is edited.
  • Keep credentials in Secrets and reference them by key — never hard-code keys in a script.