Skip to main content

Functions

Functions is a module for implementing custom logic and running it automatically for both on-chain and off-chain operations.

Diagram

Triggers
Schedule
Fixed interval or cron expression
Webhook
HTTP POST to dedicated URL
📡
Monitor
On-chain event detection
Function
Custom Logic
// your code here
const data = parse(input)
await callAPI(endpoint)
return { status: 'ok' }
Actions
Sequential
Steps run in order
Parallel
Steps run concurrently
External API
Call any HTTP endpoint
Notify
Slack, Discord & more

Primary use cases

  • Operations automation: Periodic maintenance tasks, such as revenue collection and state updates.
  • External integrations: Call external APIs and connect with notification tools such as Slack and Discord.
  • Workflow orchestration: Combine multiple actions to execute complex scenarios.

Three execution triggers

Functions can be started by one of the following triggers:

TriggerDescription
ScheduleRuns on fixed intervals (for example, every hour) or with cron expressions.
WebhookRuns when an HTTP POST request is sent to the generated dedicated URL.
MonitorRuns when the monitoring module detects a target event.

Runtime specifications

Runtime specifications are currently under design.

Workflows

You can compose multiple actions in either sequential or parallel execution patterns.

  • Sequential: The next action runs only if the previous action succeeds.
  • Parallel: Multiple actions run at the same time for higher throughput.