Skip to Content
AutomationGetting Started

Getting Started

Getting Started for Developers

Supra’s Automation Network is built to be developer-friendly. It provides multiple interfaces for registering tasks, managing them, and observing execution. Developers can integrate automation into their applications with minimal setup using the REST API, Supra CLI, or the SDK.

Here is an overview of a diagram which will give you the idea of the workflow.

Supra Automation Network


Basic Setup Requirements

Before creating tasks, make sure the following conditions are met:

  • The target smart contract is deployed on the Supra network.
  • The target smart contract exposes callable entry functions to invoke automation.
  • The developer wallet has enough funds to cover registration fees and automation gas costs.
  • Automation is enabled on the network and registration is open. Check both with the view functions below. Each returns true when the condition holds.
supra move tool view \ --function-id 0x1::automation_registry::is_feature_enabled_and_initialized \ --rpc-url <RPC_URL> supra move tool view \ --function-id 0x1::automation_registry::is_registration_enabled \ --rpc-url <RPC_URL>

Registering an Automation Task

There are two ways to register an automation task:

Using the Supra CLI

The CLI provides a straightforward interface:

supra move automation register \ --task-max-gas-amount <MAX_GAS> \ --task-gas-price-cap <GAS_PRICE_CAP> \ --task-expiry-time-secs <EXPIRY> \ --task-automation-fee-cap <FEE_CAP> \ --function-id "<ADDRESS>::<MODULE>::<FUNCTION>" \ --args address:<RECIPIENT> u64:<AMOUNT> \ --rpc-url <RPC_URL>

Replace the placeholders as follows. Amounts are in quants (1 SUPRA = 100,000,000 quants).

PlaceholderHow to derive it
<MAX_GAS>The gas one execution of the function needs. The total gas of all tasks is limited by the registry’s gas cap.
<GAS_PRICE_CAP>At or above max_gas_price from <RPC_URL>/rpc/v3/transactions/estimate_gas_price.
<EXPIRY>start_time + duration_secs + buffer, with start_time and duration_secs from get_cycle_info.
<FEE_CAP>At or above the result of estimate_automation_fee for <MAX_GAS>.

The Calculate task-expiry-time & task-automation-fee page shows the view calls for each value.

This command registers a task that will call the specified function with the given arguments. The function runs at the end of each block while the task is active, and any condition is evaluated inside the function.

You can also simulate task creation using:

supra move automation register --simulate ...

Using a REST API

You can also register tasks by submitting signed transactions through the REST API, with a transaction payload of type AutomationRegistration. The payload structure includes:

  • Target entry function (The entry function includes the conditional logic that determines when to execute the task)
  • Arguments
  • Expiry time
  • Maximum gas amount
  • Gas price cap
  • Automation fee cap
  • Auxiliary data, which holds the task type and its priority

The REST interface accepts AutomationRegistration as a transaction payload type. The Supra CLI builds, signs and submits this transaction for you, and --simulate runs it against the RPC node without committing it.


Monitoring and Managing Tasks

Once registered, tasks are visible in the registry. You can:

  • Query task IDs with get_task_ids or get_active_task_ids.
  • Fetch task metadata by index with get_task_details.
  • Cancel a task with the cancel_task function or the supra move automation cancel command, or stop it immediately with supra move automation stop-tasks.
  • Estimate automation fees with estimate_automation_fee, through the CLI or the REST view endpoint.

Tasks that expire or exceed fee limits are removed at the next cycle boundary.

Manually cancelled active tasks also remain in the registry until the current cycle ends and are removed at the next cycle boundary.

Last updated on