Skip to main content

STAN Tasks

STAN background tasks and heartbeat.

Access it as client.stan_tasks on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.

Quick start​

from strongly import Strongly

client = Strongly()

# List (auto-paginates as you iterate)
for stan in client.stan_tasks.list():
print(stan.id)

Methods​

Core​

list​

list(*, limit: int | None = None) -> SyncPaginator[StanScheduledTask]

List your scheduled STAN tasks, a page at a time as you iterate.

Each has its schedule and next run time.

create​

create(*, name: str, action: str, model_id: str, schedule_type: str, run_at: str | None = None, cron: str | None = None, timezone: str | None = None, description: str | None = None, execution_mode: str | None = None, tool_name: str | None = None, tool_params: Mapping[str, Any] | None = None, model_name: str | None = None) -> dict[str, Any]

Create a STAN background task.

Parameters

  • name (str): Task name (required).
  • action (str): Natural-language instruction for llm execution mode (required).
  • model_id (str): Model the task runs against (required).
  • schedule_type (str): once or recurring (required).
  • run_at (str | None, optional): ISO timestamp for once schedules.
  • cron (str | None, optional): Cron expression for recurring schedules.
  • timezone (str | None, optional): IANA timezone for the schedule.
  • description (str | None, optional): Optional task description.
  • execution_mode (str | None, optional): llm (default) or tool.
  • tool_name (str | None, optional): MCP tool to run directly in tool mode.
  • tool_params (Mapping[str, Any] | None, optional): Parameters for tool_name.
  • model_name (str | None, optional): Display name of the model.

retrieve​

retrieve(task_id: str) -> dict[str, Any]

Retrieve a single STAN background task.

update​

update(task_id: str, *, name: str | None = None, description: str | None = None, execution_mode: str | None = None, action: str | None = None, tool_name: str | None = None, tool_params: Mapping[str, Any] | None = None, schedule_type: str | None = None, run_at: str | None = None, cron: str | None = None, timezone: str | None = None, model_id: str | None = None, model_name: str | None = None, status: str | None = None) -> dict[str, Any]

Update a STAN background task (any subset of fields).

delete​

delete(task_id: str) -> None

Delete a STAN background task. Raises on failure; returns nothing.

Lifecycle & actions​

pause​

pause(task_id: str) -> dict[str, Any]

Pause a STAN background task.

resume​

resume(task_id: str) -> dict[str, Any]

Resume a paused STAN background task.

Other​

heartbeat​

heartbeat() -> dict[str, Any]

Get STAN's heartbeat configuration and last-run state.

run_heartbeat​

run_heartbeat() -> dict[str, Any]

Trigger a STAN heartbeat run immediately.

update_heartbeat​

update_heartbeat(*, enabled: bool | None = None, checks: Sequence[str] | None = None, interval_minutes: int | None = None) -> dict[str, Any]

Update STAN's heartbeat configuration.

Parameters

  • enabled (bool | None, optional): Whether the heartbeat runs.
  • checks (Sequence[str] | None, optional): Names of the checks to run.
  • interval_minutes (int | None, optional): Minutes between heartbeat runs (server floor 5).