Skip to content

Where scripts run

A script that only runs when you press Run is a notebook. The useful scripts start by themselves. This part covers every way that can happen, what each one gives the script to work with, and what limits and permissions apply.

StartSet up inThe script gets
An eventSettings > MaSH > Eventsmash.event for the file, person or message involved
A scheduleSettings > MaSH > Schedulea list of files in mash.event.files, or none
A webhookSettings > MaSH > Webhooksthe web request, in mash.event.input
The file action menuSettings > MaSH > Users & groupsthe files someone selected
A form, a signing envelope or a reviewthe form, the envelope or the review rulethe answers, the envelope or the decision
Gracea chat with Gracea script she drafts for you, saved when you confirm
Another scriptmash.scriptswhatever input the caller passes
By handthe editor’s Run buttonno event; you can pick a test file and a test user, and turn on Virtual mode to use mock files and I/O

Every saved run, except one you start by hand, leaves a line on the run log.

  • It is one run, start to finish. Variables don’t survive from one run to the next. Keep anything you need later in a custom field, a file or mash.store.
  • It has a time and memory limit. The numbers are on the Limits page. A queued run gets 60 seconds on both Foldr Cloud and an appliance.
  • It runs as a person, and that person’s rights apply. See Who a script runs as.
  • It needs the MaSH feature. Webhooks and the file action menu check for it on every call. A tenant without it can’t use them.
  • Errors don’t always stop it. A failed call is recorded and the script carries on, unless you handle it. See Errors and the run log.

If you want a script to run when something happens to a file, read Events. If you want it to run at a set time, read Schedules. If another system needs to call Foldr, read Webhooks. Foldr Cloud and appliances lists what differs between the two.

Finished scripts for common jobs are in the How-to guides.