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: Optional[int] = None, offset: Optional[int] = None) -> Dict[str, Any]
List STAN background tasks.
create
create(*, name: str, action: str, model_id: str, schedule_type: str, run_at: Optional[str] = None, cron: Optional[str] = None, timezone: Optional[str] = None, description: Optional[str] = None, execution_mode: Optional[str] = None, tool_name: Optional[str] = None, tool_params: Optional[Mapping[str, Any]] = None, model_name: Optional[str] = None) -> Dict[str, Any]
Create a STAN background task.
Args:
name: Task name (required).
action: Natural-language instruction for llm execution mode (required).
model_id: Model the task runs against (required).
schedule_type: once or recurring (required).
run_at: ISO timestamp for once schedules.
cron: Cron expression for recurring schedules.
timezone: IANA timezone for the schedule.
description: Optional task description.
execution_mode: llm (default) or tool.
tool_name: MCP tool to run directly in tool mode.
tool_params: Parameters for tool_name.
model_name: 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: Optional[str] = None, description: Optional[str] = None, execution_mode: Optional[str] = None, action: Optional[str] = None, tool_name: Optional[str] = None, tool_params: Optional[Mapping[str, Any]] = None, schedule_type: Optional[str] = None, run_at: Optional[str] = None, cron: Optional[str] = None, timezone: Optional[str] = None, model_id: Optional[str] = None, model_name: Optional[str] = None, status: Optional[str] = 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: Optional[bool] = None, checks: Optional[Sequence[str]] = None, interval_minutes: Optional[int] = None) -> Dict[str, Any]
Update STAN's heartbeat configuration.
Args: enabled: Whether the heartbeat runs. checks: Names of the checks to run. interval_minutes: Minutes between heartbeat runs (server floor 5).