Scheduled

Event v133 → current #0

Emitted when a task is successfully scheduled for future execution.

View events on chain
Useful for: developersanalytics

The Big Picture

Confirmation that a call has been queued for future execution at the specified block.

Use Cases

  • Confirm task was scheduled
  • Track scheduled operations
  • Build scheduling dashboards

From Chain Metadata

Scheduled some task.

Triggers

Preconditions

  • Schedule call succeeded
  • Agenda had capacity at target block

Effects

Storage Modified

Postconditions

  • Task queued in Agenda storage
  • Will execute at specified block

Side Effects

  • Deposit may be reserved

Event Data

#NameTypeDescription
0
when
u32 Block number when the task will execute
1
index
u32 Index of the task within the block's agenda

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Subscribe to Scheduled events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("Scheduler") &&
      event.method === "Scheduled"
    )
    .forEach(({ event }) => {
      console.log("Scheduled:", event.data.toHuman());
    });
});

Runtime Info

Pallet Index
15
Event Index
0
First Version
v133
Current Version
v393