cron, http, and onchain_event.
Local Task Execution
For locally testing tasks you can use thecallTask CLI command. This works regardless of what trigger types a task has configured (and even for tasks with no triggers at all).
Trigger Task locally with CLI
Task Code
Task To Task Execution
Tasks can call other tasks directly — no trigger configuration required on the called task. This is done using the callTask context function.Example
process-data task will receive the payload and can return a response:
Chain Event Triggers
Tasks can be triggered by onchain events. The payload delivered to the task is the raw encoded log. Compose provides helpers for decoding the event in your task code — see Contracts for more details on decoding.Example event object sent as the payload to your task:
Example configuration for an onchain event trigger:
Task code
Here’s an example in which we decode the event with a contract class we’ve generated withgoldsky compose codegen, see Contracts for more info.
Onchain Trigger Properties
| Property | Type | Required | Description |
|---|---|---|---|
type | "onchain_event" | Yes | Type discriminator |
network | string | Yes | The network slug in snake_case (e.g. base_sepolia, ethereum_mainnet). See Chains for the full list. |
contract | string | Yes | The contract address (0x followed by 40 hex characters). |
events | string[] | No | Specific event signatures (human-readable, not encoded) to match — e.g. "Transfer(address,address,uint256)". If omitted, all logs from the contract are delivered. |
dataset_version | string | No | Override the dataset version for chains that don’t use 1.0.0 (e.g., megaeth_testnet_v2). If not specified, the server auto-detects the correct version. |
Failure Handling
Onchain-triggered tasks honor the task’sretry_config. When a task throws (or otherwise fails), Compose retries it up to max_attempts with the configured backoff. If every attempt fails, that event is dropped and the pipeline advances to the next one — it is not replayed.
This means an unhandled exception in an onchain-triggered task only stalls delivery for the duration of your retry window, not indefinitely. If you want a failure to be visible without consuming retries, catch the error in your task and return normally — the run is recorded as successful and the pipeline moves on.
Cron Triggers
Tasks can be triggered on a schedule. Tasks triggered by cron are invoked with an empty payload ({}), since each invocation is generic.
Example
6-field (second-granularity) example
Pass a 6-field expression if you need second-level precision — the first field becomes seconds:Cron Trigger Properties
| Property | Type | Required | Description |
|---|---|---|---|
type | "cron" | Yes | Type discriminator |
expression | string | Yes | A cron expression. Supports both 5-field (minute hour day month weekday) and 6-field (second minute hour day month weekday) formats. Accepts *, numbers, ranges (1-5), lists (1,3,5), and step values (*/2). |
HTTP Triggers
Tasks can be triggered by HTTP requests. This is often used to kick off compose tasks from your application logic. HTTP triggers accept any JSON payload you want for dynamic execution.Example
Http Trigger Properties
| Property | Type | Required | Description |
|---|---|---|---|
type | "http" | Yes | Type discriminator |
authentication | "auth_token" | "none" | Yes | Type of authentication to use on the endpoint. |
role | "Owner" | "Admin" | "Editor" | "Viewer" | No | The minimum RBAC role required to call the endpoint (only applies when authentication is "auth_token"). Defaults to "Viewer" (any team member). |
ip_whitelist | string[] | No | Restrict access to specific IPs. Supports IPv4, IPv6, and CIDR notation (e.g. ["192.168.1.0/24", "10.0.0.1"]). |
Base URL
Locally, Compose runs onhttp://localhost:4000. The base pattern for all task endpoints is:
authentication: "auth_token") are reachable at:
authentication: "none") are reachable at:
HTTP Request Format
authentication: "auth_token", you’ll need to pass a Goldsky API token:
Execute HTTP trigger without parameters
Execute an HTTP trigger with parameters
Response Format
Tasks return JSON responses with the data returned by the task’smain function.
Calling this task:
Next Steps
Using Packages
You can use any sandbox compatible typescript packages with any package manager.
Debugging
Debug and monitor your apps