Skip to main content

Workflow Primitives

Tools and durable workflow steps are shared runtime concepts exposed with language-idiomatic bindings. Python provides @tool, @step, and @workflow decorators; TypeScript, Go, C#, and Java configure AgentTool descriptors and DurableWorkflow; Rust uses ToolBackend and run_durable_step.

from ish import tool


@tool(requires_approval=True, read_only=False)
async def update_account(account_id: str, status: str) -> dict[str, str]:
"""Update an account status after approval."""
return {"account_id": account_id, "status": status}

Tool definitions​

In Python, @tool infers the tool name, description, and JSON Schema from type annotations and docstrings. Other languages pass explicit JSON Schema definitions or Rust ToolBackend implementations with the same safety and scheduling metadata (requires_approval, read_only, return_direct, secret_inputs, unfoldable, mutates, parallel_safe):

Durable workflow steps​

Steps accept retries, backoff_seconds, and backoff_factor evaluated by the shared Rust RetryPolicy. Retry callbacks may run more than once, so keep external side effects idempotent:

from ish import SQLiteLogger, step, workflow

logger = SQLiteLogger(db_path="./data/workflow.db")


@step(retries=2, backoff_seconds=0.5)
async def validate_record(record_id: str) -> dict[str, str]:
return {"record_id": record_id, "status": "valid"}


@workflow(name="record_check", persistence=logger)
async def record_check(record_id: str) -> dict[str, str]:
return await validate_record(record_id)

See Tools, Durable workflows, and the individual SDK READMEs for current API details.