Timill Platform Documentation

Script Administration

The longer guide — triggers, scheduled tasks, security limits and troubleshooting.

Manage backend scripts, event triggers, and scheduled tasks in Timill Platform.

Script Management#

Creating Scripts#

  1. Navigate to Group Settings → Scripts
  2. Open the script editor and choose an automation (Manual or Schedule) or an item script (Save Hook or Menu)
  3. Write the JavaScript code
  4. Configure the trigger — a cron expression for Schedule, an icon for Menu, field conditions for Event / Save Hook / Menu
  5. Save

Backend scripts are JavaScript only. See Backend scripts for the full walkthrough — what each trigger runs as, what globals it gets, and how writes behave (immediate vs. staged in a save hook).

Script Types#

TypeTriggerUse Case
ManualExecute on demandOne-time operations, bulk cleanups
ScheduleCron expressionDaily reports, recurring cleanup tasks
EventItem eventsAuto-assign, notifications, webhooks
Save HookRuns as part of saving an item of its bound typeValidation, computed fields
MenuRun on demand from an item’s context menuOne-off actions a person triggers, e.g. “create follow-up task”

Note

The script editor’s trigger buttons only offer Manual, Schedule, Save Hook and Menu directly. An Event script is created via the scripting AI assistant; once it exists it opens and edits normally like any other script.

Viewing Execution History#

  1. Go to Group Settings → Scripts
  2. Click on a script to view its execution history
  3. Check logs — everything passed to log() / console.log() — for output and errors

Event Triggers#

Available Events#

Pick Event in the script editor’s trigger buttons, then choose what runs the script:

EventFires when
An item is created (CREATE)An item is created, including through a form or an import
A field is changed (FIELD_UPDATE)Any field of an item is saved with a new value

An event script can listen to items of every type or be limited to one, and can carry field-level conditions, built in the editor, that further restrict when it fires — for example, only when the status changes to Done, rather than on every change. It runs in the background after the save, as the person who made the change.

Event scripts are reserved to group administrators: the configuration assistant in group administration can also create and edit them, but the Timill assistant cannot.

Scheduled Tasks#

Cron Expression Format#

Schedules use standard 5-field cron — there is no seconds field:

┌───────────── minute (0–59)
│ ┌───────────── hour (0–23)
│ │ ┌───────────── day of month (1–31)
│ │ │ ┌───────────── month (1–12)
│ │ │ │ ┌───────────── day of week (0–6, Sunday = 0)
│ │ │ │ │
* * * * *

@hourly, @daily, @weekly, @monthly and @every 30m are also accepted. Schedules run in the server’s local time zone unless the expression carries its own (CRON_TZ=Europe/Paris 0 7 * * *).

Common Examples#

ScheduleCron ExpressionDescription
Every hour0 * * * *Run at the start of each hour
Daily at 9 AM0 9 * * *Run daily at 9 AM (server local time)
Weekly on Monday0 9 * * 1Run every Monday at 9 AM
Monthly on 1st0 9 1 * *Run on the 1st of each month
Every 5 minutes*/5 * * * *Run every 5 minutes
Weekdays at 7 AM0 7 * * 1-5Run Monday through Friday

A scheduled script never overlaps itself: if the previous run is still executing when the next tick is due, that tick is skipped rather than queued.

Security Considerations#

Script Permissions#

  • A script runs as its acting user — who that is depends on the trigger (the person who clicked Run or the menu entry, the acting user of the triggering save/event, or the script’s own author for a schedule) — and every read and write is checked against that user’s permissions, exactly as if they had made the change by hand.
  • Group admins can create and modify scripts in their own groups.
  • Instance admins can manage scripts across all groups.

Secrets Management#

Scripts can access encrypted secrets via secrets.get(), JavaScript backend scripts only:

  1. Navigate to Group Settings → Secrets
  2. Add secret keys and values
  3. Access in scripts: secrets.get("API_KEY") — returns null if the key isn’t found

See Secrets for the group→instance fallback and other details.

Limits#

Script kindTimeoutMax API callsMax memory
Backend scripts (manual, schedule, event, menu)30 seconds10050 MB
Save hooks5 seconds10050 MB
Scripted widgets10 seconds5025 MB
Scripted charts10 seconds5025 MB

Only fetch() and secrets.get() count against the API call limit — group.queryItems() and every other read or write does not. Scripted widgets (Gonja) have no fetch or secrets access at all, so their limit is mostly a timeout/memory ceiling in practice.

Monitoring#

Execution Logs#

View script execution logs:

  1. Group Settings → Scripts → [Script] → Execution History
  2. Check for errors or unexpected output
  3. Monitor execution times

Performance Tips#

  • Keep scripts small and focused.
  • Bound queryItems calls with a specific filter (a date range, a status) rather than sweeping every item in the group.
  • Schedule heavy tasks during off-peak hours.
  • Monitor API call usage — remember only fetch() and secrets.get() count toward it.

Troubleshooting#

Script Not Running#

  1. Verify the trigger configuration (cron expression, event actions, conditions).
  2. Check the script syntax — a syntax error is rejected at save time, so a script already saved should be syntactically valid; check the execution history for a runtime error instead.
  3. Review execution logs.
  4. Confirm the acting user for this run actually has permission to make the change the script attempts.

Timeout Errors#

The script exceeded its timeout (30 seconds for backend scripts, 5 seconds for save hooks, 10 seconds for widgets/charts). Reduce query complexity, narrow the query, or split the work across multiple scripts.

API Call Limit Exceeded#

Review the script to reduce fetch() / secrets.get() calls:

  • Fetch what’s needed in fewer requests instead of one call per item.
  • Cache a secret’s value in a local variable instead of calling secrets.get() repeatedly.
  • Batch operations together.

See also: