In getOperate, Scripts are the basis of all major features (they are the steps of flows, linked to apps components, or can be run as standalone).
A Script can be written in: TypeScript (Deno & Bun), Python, Go, Bash or SQL. Its two most important components are the input JSON Schema specification and the code content.Python and Go Scripts also have an auto-generated lockfile that ensure that executions of the same Script always use the exact same set of versioned dependencies. To fit getOperate’s execution model, the code must always have a main function, which is its entrypoint when executed as an individual serverless endpoint or a Flow module and typed parameters used to infer the script’s inputs and auto-generated UI:
Path is the Script’s unique identifier that consist of the script’s owner, and the script’s name. The owner can be either a user, or a group of users (folder).
Summary (optional) is a short, human-readable summary of the Script. It will be displayed as a title across getOperate. If omitted, the UI will use the path by default.
You can attach additional functionalities to Scripts by specializing them into specific Script kinds.From the Settings of a script, the “Metadata” tab lets you define the following Script kinds:
These are used as the first step in Flows, most commonly with an internal state and a schedule to watch for changes on a external system, and compare it to the previously saved state. If there are changes,it triggers the rest of the flow, i.e. subsequent Scripts.
Suspend a flow until it’s approved. An Approval Script will interact with the getOperate API using any of the getOperate clients to retrieve a secret approval URL and resume/cancel endpoints. Most common scenario for Approval Scripts is to send an external notification with an URL that can be used to resume or cancel a flow.
Handle errors for Flows after all retries attempts have been exhausted. If it does not return an exception itself, the Flow is considered to be “recovered” and will have a success status. So in most cases, you will have to rethrow an error to have it be listed as a failed flow.