Skip to main content

Attributes

The Durable Execution system is configured through the DurableExecution class, which provides the following attributes:
AttributeTypeDefaultDescription
storageDurableExecutionStorage(required)Storage backend for checkpoint persistence
execution_idstrAuto-generatedUnique identifier for this execution
auto_cleanupboolTrueAutomatically cleanup checkpoints on completion
debugboolFalseEnable debug logging

Configuration Example

from upsonic import Agent, Task, DurableExecution
from upsonic.durable import FileDurableStorage

# Create storage backend
storage = FileDurableStorage("./durable_checkpoints")

# Create durable execution
durable = DurableExecution(
    storage=storage,
    auto_cleanup=False,
    debug=True
)

# Create agent and task
agent = Agent("openai/gpt-4o")
task = Task(
    description="Process large dataset and generate report",
    durable_execution=durable
)

# Execute with checkpointing
result = agent.do(task)
print(f"Execution ID: {task.durable_execution_id}")
print(result)

# If execution fails, resume from checkpoint
# result = agent.continue_durable(
#     durable_execution_id=task.durable_execution_id,
#     storage=storage
# )