Skip to main content

STAN Tasks

STAN's scheduled tasks (a set time) and its heartbeat (watches it keeps).

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 with their schedules and next runs, a page at a time.

Parameters

  • limit (int | None, optional): The most tasks to return; every one when omitted.

create​

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

Schedule STAN to run something at a set time, once or on a cron cadence; return the task.

In llm mode (the default) STAN runs action with model_id (it can reason and report, and costs tokens); in tool mode it runs tool_name directly (no tokens).

Parameters

  • name (str): The task's name.
  • schedule_type (str): once or recurring.
  • run_at (str | None, optional): With once: when, as an ISO 8601 time.
  • cron (str | None, optional): With recurring: a 5-field cron, e.g. "0 8 * * *".
  • timezone (str | None, optional): The schedule's IANA timezone; UTC when omitted.
  • execution_mode (str | None, optional): llm (the default) or tool.
  • action (str | None, optional): llm mode: the instruction STAN runs each time.
  • model_id (str | None, optional): llm mode: the model it runs with (an id, vendor model id or name you may use).
  • model_name (str | None, optional): That model's name.
  • tool_name (str | None, optional): tool mode: the tool STAN runs each time.
  • tool_params (Mapping[str, Any] | None, optional): tool mode: the tool's parameters.
  • description (str | None, optional): What the task is for.

retrieve​

retrieve(task_id: str) -> StanScheduledTask

Get one of your scheduled STAN tasks: its schedule, next run and last result.

Parameters

  • task_id (str): The 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) -> StanScheduledTask

Change a scheduled STAN task (only the fields you pass) and return it.

Schedule fields merge into its schedule and its next run follows the new one. Pause and resume it with pause and resume.

Parameters

  • task_id (str): The task.
  • name (str | None, optional): Its new name.
  • description (str | None, optional): Its new description.
  • execution_mode (str | None, optional): llm or tool.
  • action (str | None, optional): llm mode: its new instruction.
  • tool_name (str | None, optional): tool mode: its new tool.
  • tool_params (Mapping[str, Any] | None, optional): tool mode: its new tool parameters.
  • schedule_type (str | None, optional): once or recurring.
  • run_at (str | None, optional): With once: when, as an ISO 8601 time.
  • cron (str | None, optional): With recurring: a 5-field cron.
  • timezone (str | None, optional): The schedule's IANA timezone.
  • model_id (str | None, optional): llm mode: the model it runs with.
  • model_name (str | None, optional): That model's name.

delete​

delete(task_id: str) -> None

Delete a scheduled STAN task.

Parameters

  • task_id (str): The task.

Lifecycle & actions​

pause​

pause(task_id: str) -> StanScheduledTask

Pause a scheduled STAN task (it does not run until resumed) and return it.

Parameters

  • task_id (str): The task.

resume​

resume(task_id: str) -> StanScheduledTask

Resume a paused STAN task and return it.

Parameters

  • task_id (str): The task.

Other​

add_monitor​

add_monitor(*, instruction: str) -> StanHeartbeatMonitor

Add a watch to your heartbeat and return it (an identical enabled watch is reused).

Parameters

  • instruction (str): In plain language: what to watch, what to do about it, and what needs your approval.

heartbeat​

heartbeat() -> StanHeartbeat

Get your heartbeat: whether it runs, how often, its recent runs and its watches.

remove_monitor​

remove_monitor(monitor_id: str) -> None

Remove a heartbeat watch.

Parameters

  • monitor_id (str): The watch.

run_heartbeat​

run_heartbeat() -> StanHeartbeatRun

Run your heartbeat now (it uses tokens) and return what it found and did.

update_heartbeat​

update_heartbeat(*, enabled: bool | None = None, interval_minutes: int | None = None, model_id: str | None = None) -> StanHeartbeat

Switch your heartbeat on or off and set how often and with which model it runs.

Parameters

  • enabled (bool | None, optional): Whether it runs.
  • interval_minutes (int | None, optional): Minutes between runs (at least 5).
  • model_id (str | None, optional): The model its runs use; your STAN session's when omitted.

update_monitor​

update_monitor(monitor_id: str, *, instruction: str | None = None, state: str | None = None, enabled: bool | None = None) -> StanHeartbeatMonitor

Change a heartbeat watch (only the fields you pass) and return it.

Parameters

  • monitor_id (str): The watch.
  • instruction (str | None, optional): Its new instruction.
  • state (str | None, optional): What it remembers across runs.
  • enabled (bool | None, optional): False pauses it, True resumes it.