App Properties
| Property | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique app identifier used for API calls |
api_version | string | Yes | Pins your compose app to a specific API version. Use “Stable” if unsure |
secrets | array(string) | No | Names of secrets you’ve set for this app |
env | ENV | No | Environment-specific variables |
tasks | Tasks[] | Yes | List of tasks in your app |
Basic example
ENV variables
You can set env variables in your manifest which will be injected in your app under the env context property. Env configuration is namespaced by environment and the values of the current environment your running in will be injected. Currently the two environments “local” for when you’re running your compose app locally and “cloud” for when you’ve deployed your app withgoldsky compose deploy, read more about deploying here.
Example
Task configuration
Compose apps are made up of tasks, each task in thetasks array defines an executable unit of work and references a typescript file, see Task Authoring for
more details. Tasks can be triggered by http requests from your app,
blockchain events, cron schedules, etc. See more about triggers below. Tasks can also trigger other tasks via the callTask context function
within the task code.
Name validation
App names must start with a lowercase letter, end with a letter or digit, and contain only lowercase letters, digits, and hyphens (e.g.my-app-1).
Task names must start with a letter (or underscore followed by a letter/digit) and contain only letters, digits, and underscores (e.g. fetch_prices, _internal_task).
Task properties
| Property | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique task identifier used for API calls |
path | string | Yes | File path to the task module |
triggers | array(object) | No | List of triggers that will run the task. Each trigger type can only appear once per task. |
retry_config | object | No | Task-level retry behavior |
Triggers
Triggers are what runs your Compose tasks, these can be http calls, onchain events, or cron jobs. For more information, see Triggers.Example
If you provide no triggers in your manifest then tasks can only be executed by other tasks.
Retry configuration
When specifying
retry_config, all three fields (max_attempts, initial_interval_ms, backoff_factor) are required. You cannot provide only some of them.- If a task fails, Compose waits
initial_interval_msbefore retrying - Each subsequent retry interval is multiplied by
backoff_factor - Example with above config: 1000ms → 2000ms → 4000ms
- After
max_attemptsfailures, the task is marked as permanently failed - The default retry behaviour is 0 retries (1 attempt, no retries)