All pallets

Scheduler docs

Look up any call, event, or storage item with code examples. Runtime v472 · Block #9,197,056

Developer documentation for the Scheduler pallet of the Subtensor blockchain, part of the Bittensor decentralized AI network. This page is designed for developers integrating with the chain: look up any call, event, or storage item, copy code examples in TypeScript, Python, or Rust, and filter by your role. For in-depth explanations, version history, and relationships between items, see the Reference section.

Scheduler

See [`Pallet::schedule`].

Index: 15 31 items

Calls 10

schedule

call details

Anonymously schedule a call for future execution at a specific block.

Parameters

NameTypeFormatDescription
whenu32Integerwhen: Block number
maybe_periodicOption—maybe_periodic (Option)
priorityu8Integer (0-255)priority (u8)
callRuntimeCall—call (RuntimeCall)
Emits: Scheduled
Modifies: Agenda
// ----------------------------------------------------------------------
// HEADS UP: 1 arg below has a complex type with no usable default.
// Look for `undefined as any` and replace it with real value
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build schedule call (typed, named args)
const when = 0;
const maybe_periodic = undefined;
const priority = 0;
const call = undefined as any /* RuntimeCall — replace with real value */;

const tx = api.tx.Scheduler.schedule({
  when,
  maybe_periodic,
  priority,
  call,
});

cancel

call details

Cancel an anonymously scheduled task by its block and index.

Parameters

NameTypeFormatDescription
whenu32Integerwhen: Block number
indexu32Integerindex (u32)
Modifies: Agenda
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build cancel call (typed, named args)
const when = 0;
const index = 0;

const tx = api.tx.Scheduler.cancel({
  when,
  index,
});

schedule_named

call details

Schedule a named task for future execution with a unique identifier.

Parameters

NameTypeFormatDescription
id[u8; 32]—id ([u8; 32])
whenu32Integerwhen: Block number
maybe_periodicOption—maybe_periodic (Option)
priorityu8Integer (0-255)priority (u8)
callRuntimeCall—call (RuntimeCall)
Emits: Scheduled
Modifies: Agenda/ Lookup
// ----------------------------------------------------------------------
// HEADS UP: 1 arg below has a complex type with no usable default.
// Look for `undefined as any` and replace it with real value
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build schedule_named call (typed, named args)
const id = "0x0000000000000000000000000000000000000000000000000000000000000000";
const when = 0;
const maybe_periodic = undefined;
const priority = 0;
const call = undefined as any /* RuntimeCall — replace with real value */;

const tx = api.tx.Scheduler.schedule_named({
  id,
  when,
  maybe_periodic,
  priority,
  call,
});

cancel_named

call details

Cancel a scheduled task by its unique name identifier.

Parameters

NameTypeFormatDescription
id[u8; 32]—id ([u8; 32])
Emits: Canceled
Modifies: Agenda/ Lookup
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build cancel_named call (typed, named args)
const id = "0x0000000000000000000000000000000000000000000000000000000000000000";

const tx = api.tx.Scheduler.cancel_named({
  id,
});

schedule_after

call details

Anonymously schedule a task to execute after a delay from the current block.

Parameters

NameTypeFormatDescription
afteru32Integerafter: Block number
maybe_periodicOption—maybe_periodic (Option)
priorityu8Integer (0-255)priority (u8)
callRuntimeCall—call (RuntimeCall)
Emits: Scheduled
Modifies: Agenda
// ----------------------------------------------------------------------
// HEADS UP: 1 arg below has a complex type with no usable default.
// Look for `undefined as any` and replace it with real value
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build schedule_after call (typed, named args)
const after = 0;
const maybe_periodic = undefined;
const priority = 0;
const call = undefined as any /* RuntimeCall — replace with real value */;

const tx = api.tx.Scheduler.schedule_after({
  after,
  maybe_periodic,
  priority,
  call,
});

schedule_named_after

call details

Schedule a named task to execute after a delay from the current block.

Parameters

NameTypeFormatDescription
id[u8; 32]—id ([u8; 32])
afteru32Integerafter: Block number
maybe_periodicOption—maybe_periodic (Option)
priorityu8Integer (0-255)priority (u8)
callRuntimeCall—call (RuntimeCall)
Emits: Scheduled
Modifies: Agenda/ Lookup
// ----------------------------------------------------------------------
// HEADS UP: 1 arg below has a complex type with no usable default.
// Look for `undefined as any` and replace it with real value
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build schedule_named_after call (typed, named args)
const id = "0x0000000000000000000000000000000000000000000000000000000000000000";
const after = 0;
const maybe_periodic = undefined;
const priority = 0;
const call = undefined as any /* RuntimeCall — replace with real value */;

const tx = api.tx.Scheduler.schedule_named_after({
  id,
  after,
  maybe_periodic,
  priority,
  call,
});

set_retry

call details

Configure retry behavior for a scheduled task if it fails.

Parameters

NameTypeFormatDescription
task(u32, u32)—task ((u32, u32))
retriesu8Integer (0-255)retries (u8)
periodu32Integerperiod: Block number
Emits: RetrySet
Modifies: Retries
// ----------------------------------------------------------------------
// HEADS UP: 1 arg below has a complex type with no usable default.
// Look for `undefined as any` and replace it with real value
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build set_retry call (typed, named args)
const task = undefined as any /* (u32, u32) — replace with real value */;
const retries = 0;
const period = 0;

const tx = api.tx.Scheduler.set_retry({
  task,
  retries,
  period,
});

set_retry_named

call details

Configure retry behavior for a named scheduled task.

Parameters

NameTypeFormatDescription
id[u8; 32]—id ([u8; 32])
retriesu8Integer (0-255)retries (u8)
periodu32Integerperiod: Block number
Emits: RetrySet
Modifies: Retries/ Lookup
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build set_retry_named call (typed, named args)
const id = "0x0000000000000000000000000000000000000000000000000000000000000000";
const retries = 0;
const period = 0;

const tx = api.tx.Scheduler.set_retry_named({
  id,
  retries,
  period,
});

cancel_retry

call details

Remove the retry configuration from a scheduled task.

Parameters

NameTypeFormatDescription
task(u32, u32)—task ((u32, u32))
Modifies: Retries
// ----------------------------------------------------------------------
// HEADS UP: 1 arg below has a complex type with no usable default.
// Look for `undefined as any` and replace it with real value
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build cancel_retry call (typed, named args)
const task = undefined as any /* (u32, u32) — replace with real value */;

const tx = api.tx.Scheduler.cancel_retry({
  task,
});

cancel_retry_named

call details

Remove the retry configuration from a named scheduled task.

Parameters

NameTypeFormatDescription
id[u8; 32]—id ([u8; 32])
Modifies: Retries/ Lookup
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build cancel_retry_named call (typed, named args)
const id = "0x0000000000000000000000000000000000000000000000000000000000000000";

const tx = api.tx.Scheduler.cancel_retry_named({
  id,
});

Events 10

Scheduled

event details

Emitted when a task is successfully scheduled for future execution.

When it fires

  • Schedule call succeeded
  • Agenda had capacity at target block

Fields

NameTypeFormatDescription
whenu32IntegerBlock number when the task will execute
indexu32IntegerIndex of the task within the block's agenda
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Scheduled events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Scheduler.Scheduled.get(block.hash);
  for (const evt of events) {
    console.log("Scheduled:", evt.payload);
  }
});

Canceled

event details

Emitted when a scheduled task is cancelled before execution.

When it fires

  • Cancel call succeeded
  • Task existed at specified position

Fields

NameTypeFormatDescription
whenu32IntegerBlock number where the task was scheduled
indexu32IntegerIndex of the cancelled task within the block's agenda
Emitted by: cancel/ cancel_named
Modifies: Agenda/ Lookup
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Canceled events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Scheduler.Canceled.get(block.hash);
  for (const evt of events) {
    console.log("Canceled:", evt.payload);
  }
});

Dispatched

event details

Emitted when a scheduled task is executed.

When it fires

  • Block reached scheduled time
  • Task existed in Agenda

Fields

NameTypeFormatDescription
task(u32, u32)—Task address as (block_number, index) tuple
idOption—Optional 32-byte task name (None for anonymous tasks)
resultResult—Dispatch result (Ok or Err with error details)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Dispatched events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Scheduler.Dispatched.get(block.hash);
  for (const evt of events) {
    console.log("Dispatched:", evt.payload);
  }
});

RetrySet

event details

Emitted when retry configuration is set for a scheduled task.

When it fires

  • Task exists
  • set_retry call succeeded

Fields

NameTypeFormatDescription
task(u32, u32)—Task address as (block_number, index) tuple
idOption—Optional 32-byte task name (None for anonymous tasks)
periodu32IntegerNumber of blocks between retry attempts
retriesu8Integer (0-255)Maximum number of retry attempts allowed
Modifies: Lookup/ Retries
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to RetrySet events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Scheduler.RetrySet.get(block.hash);
  for (const evt of events) {
    console.log("RetrySet:", evt.payload);
  }
});

RetryCancelled

event details

Emitted when retry configuration is removed from a scheduled task.

When it fires

  • Task had retry config
  • cancel_retry call succeeded

Fields

NameTypeFormatDescription
task(u32, u32)—Task address as (block_number, index) tuple
idOption—Optional 32-byte task name (None for anonymous tasks)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to RetryCancelled events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Scheduler.RetryCancelled.get(block.hash);
  for (const evt of events) {
    console.log("RetryCancelled:", evt.payload);
  }
});

CallUnavailable

event details

Emitted when a scheduled call could not be found and the task is aborted.

When it fires

  • Execution attempted
  • Call data unavailable

Fields

NameTypeFormatDescription
task(u32, u32)—Task address as (block_number, index) tuple
idOption—Optional 32-byte task name (None for anonymous tasks)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to CallUnavailable events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Scheduler.CallUnavailable.get(block.hash);
  for (const evt of events) {
    console.log("CallUnavailable:", evt.payload);
  }
});

PeriodicFailed

event details

Emitted when a periodic task fails to reschedule because the agenda is full.

When it fires

  • Periodic task completed
  • Next occurrence block agenda at capacity

Fields

NameTypeFormatDescription
task(u32, u32)—Task address as (block_number, index) tuple
idOption—Optional 32-byte task name (None for anonymous tasks)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to PeriodicFailed events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Scheduler.PeriodicFailed.get(block.hash);
  for (const evt of events) {
    console.log("PeriodicFailed:", evt.payload);
  }
});

RetryFailed

event details

Emitted when a task retry fails to reschedule due to agenda capacity or weight.

When it fires

  • Task failed and retry attempted
  • Retry could not be scheduled

Fields

NameTypeFormatDescription
task(u32, u32)—Task address of the failed retry attempt
idOption—Optional 32-byte task name (None for anonymous tasks)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to RetryFailed events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Scheduler.RetryFailed.get(block.hash);
  for (const evt of events) {
    console.log("RetryFailed:", evt.payload);
  }
});

PermanentlyOverweight

event details

Emitted when a task is permanently abandoned because it always exceeds weight limits.

When it fires

  • Task execution exceeded available weight
  • No possibility of success

Fields

NameTypeFormatDescription
task(u32, u32)—Task address as (block_number, index) tuple
idOption—Optional 32-byte task name (None for anonymous tasks)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to PermanentlyOverweight events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Scheduler.PermanentlyOverweight.get(block.hash);
  for (const evt of events) {
    console.log("PermanentlyOverweight:", evt.payload);
  }
});

AgendaIncomplete

event details

Emitted when not all scheduled tasks could be processed in a block.

When it fires

  • Block processing hit weight limit
  • Remaining tasks exist

Fields

NameTypeFormatDescription
whenu32IntegerBlock number where agenda processing was incomplete
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to AgendaIncomplete events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Scheduler.AgendaIncomplete.get(block.hash);
  for (const evt of events) {
    console.log("AgendaIncomplete:", evt.payload);
  }
});

Storage 4

Agenda

storage details

Items to be executed, indexed by the block number for execution.

Modifier: Default Keys: 1 Returns: BoundedVec

Keys

NameTypeFormatDescription
key1u32Integer—
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query Agenda storage
const key1 = 0;

const result = await api.query.Scheduler.Agenda.getValue(key1);
console.log("Agenda:", result);

IncompleteSince

storage details

Block number from which the agenda became incomplete.

Modifier: Optional Keys: 0 Returns: u32 (Integer)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query IncompleteSince storage (no keys - plain value)
const result = await api.query.Scheduler.IncompleteSince.getValue();
console.log("IncompleteSince:", result);

Lookup

storage details

Lookup from a name to the block number and index of the task.

Modifier: Optional Keys: 1 Returns: (u32, u32)

Keys

NameTypeFormatDescription
key1[u8; 32]——
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query Lookup storage
const key1 = "0x0000000000000000000000000000000000000000000000000000000000000000";

const result = await api.query.Scheduler.Lookup.getValue(key1);
console.log("Lookup:", result);

Retries

storage details

Retry configurations for items, indexed by task address (block, index).

Modifier: Optional Keys: 2 Returns: RetryConfig

Keys

NameTypeFormatDescription
key1u32Integer—
key2u32Integer—
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query Retries storage
const key1 = 0;
const key2 = 0;

const result = await api.query.Scheduler.Retries.getValue(key1, key2);
console.log("Retries:", result);

Constants 2

MaximumWeight

constant details

Maximum weight for scheduled calls.

Type: Weight
Value: "1369913486720630795"
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query MaximumWeight constant
const value = await api.constants.Scheduler.MaximumWeight();
console.log("MaximumWeight:", value);

MaxScheduledPerBlock

constant details

Maximum scheduled calls per block.

Type: u32
Value: 50
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query MaxScheduledPerBlock constant
const value = await api.constants.Scheduler.MaxScheduledPerBlock();
console.log("MaxScheduledPerBlock:", value);

Errors 5

FailedToSchedule

error details #0

The runtime failed to schedule the requested call.

Common Causes

  • Agenda for target block is full (MaxScheduledPerBlock reached)
  • Insufficient weight budget for the block
  • Invalid scheduling parameters

How to Fix

Try scheduling for a different block,Check MaxScheduledPerBlock constant,Reduce the number of scheduled tasks for that block

NotFound

error details #1

The scheduled call you're trying to cancel or modify doesn't exist.

Common Causes

  • Task already executed
  • Task already cancelled
  • Wrong block number or index
  • Wrong task name/id

How to Fix

Verify the task address (block, index) or name,Check Scheduler.Agenda storage for the target block,For named tasks, check Scheduler.Lookup storage

TargetBlockNumberInPast

error details #2

You're trying to schedule a call for a block that has already passed.

Common Causes

  • Target block number is less than or equal to current block
  • Delay calculation error
  • Stale transaction submitted after target passed

How to Fix

Use a future block number,Use schedule_after with a positive delay,Recalculate target based on current block

RescheduleNoChange

error details #3

The reschedule operation would not change the scheduled time.

Common Causes

  • New target block equals current scheduled block
  • Calling reschedule with same parameters

How to Fix

Provide a different target block number,Verify the task's current scheduled block before rescheduling

Named

error details #4

You used a non-named function on a named task, or vice versa.

Common Causes

  • Using cancel on a named task (should use cancel_named)
  • Using cancel_named on an anonymous task
  • Task was created with schedule_named but modified with schedule

How to Fix

For named tasks: use cancel_named, set_retry_named, cancel_retry_named,For anonymous tasks: use cancel, set_retry, cancel_retry with (block, index),Check Scheduler.Lookup to verify if task has a name