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 → Backend Scripts
  2. Click New Script
  3. Choose language: JavaScript or Gonja
  4. Write script code
  5. Configure trigger type and schedule
  6. Save

Script Types#

TypeTriggerUse Case
ManualExecute on demandOne-time operations
ScheduleCron expressionDaily reports, cleanup tasks
EventItem eventsAuto-assign, notifications
Save HookAfter item saveValidation, field updates

Viewing Execution History#

  1. Go to Group Settings → Backend Scripts
  2. Click on a script to view its execution history
  3. Check logs for output and errors

Event Triggers#

Available Events#

EventTrigger
CREATEItem is created
UPDATEItem is updated
DELETEItem is deleted
STATUS_CHANGEItem status changes
FIELD_UPDATESpecific field is updated
ASSIGNItem is assigned/unassigned
COMMENT_CREATEComment is added

Configuring Field Conditions#

For FIELD_UPDATE events, specify which fields trigger the script:

Fields: priority, status, dueDate

The script will only run when one of these fields is modified.

Scheduled Tasks#

Cron Expression Format#

┌───────────── second (optional)
│ ┌───────────── minute
│ │ ┌───────────── hour
│ │ │ ┌───────────── day of month
│ │ │ │ ┌───────────── month
│ │ │ │ │ ┌───────────── day of week
│ │ │ │ │ │
* * * * * *

Common Examples#

ScheduleCron ExpressionDescription
Every hour0 * * * *Run at the start of each hour
Daily at 9 AM0 9 * * *Run daily at 9 AM
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

Security Considerations#

Script Permissions#

  • Scripts run with the permissions of the script owner
  • Group admins can create/modify scripts in their groups
  • Instance admins can manage scripts across all groups

Secrets Management#

Scripts can access encrypted secrets via secrets.get():

  1. Navigate to Group Settings → Secrets
  2. Add secret keys and values
  3. Access in scripts: secrets.get("API_KEY")

API Call Limits#

Script TypeAPI Call LimitTimeout
Backend Scripts10030 seconds
Widget Scripts5030 seconds
Chart Scripts5010 seconds

Monitoring#

Execution Logs#

View script execution logs:

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

Performance Tips#

  • Keep scripts small and focused
  • Use specific queries to minimize data transfer
  • Schedule heavy tasks during off-peak hours
  • Monitor API call usage

Troubleshooting#

Script Not Running#

  1. Verify trigger configuration
  2. Check script syntax for errors
  3. Review execution logs
  4. Ensure user has permission to execute scripts

Timeout Errors#

Scripts timeout after configured duration. Reduce query complexity or split into multiple scripts.

API Call Limit Exceeded#

Review script to reduce API calls:

  • Use specific queries instead of broad ones
  • Cache results when possible
  • Batch operations together

See also: