workflow_cancelled is the read-only flag set when a timeout fires (useful for downstream callbacks).Scope change: async already enforced this; sync now does too.
By default, callback and memory exceptions are logged and swallowed. These flags surface them.
Param
Type
Default
Effect when True
fail_on_callback_error
bool
False
Re-raises any exception thrown inside task.callback.
fail_on_memory_error
bool
False
Re-raises memory-store failures (both inside and after the task).
from praisonaiagents import Agent, Taskdef buggy_callback(task_output): raise ValueError("This callback always fails!")# This task will crash the workflow when callback failsstrict_task = Task( description="Process data", callback=buggy_callback, fail_on_callback_error=True, # Surface the bug)# This task will log the error but continuelenient_task = Task( description="Process data", callback=buggy_callback, fail_on_callback_error=False, # Swallow and log)# Check non-fatal errors after executionresult = agent.start(lenient_task)print(f"Callback error: {result.callback_error}")print(f"All non-fatal errors: {result.non_fatal_errors}")
# Jitter automatically prevents thundering herdagents = [Agent(name=f"Worker-{i}") for i in range(10)]# All agents hitting same LLM get automatic jitter - no config needed
Don't catch jitter-related delays — let the SDK handle backoff
The retry system is designed to handle rate limits automatically:
# Good: let SDK handle retriesagent = Agent(name="Worker")result = agent.start("Process this data")# Bad: don't manually catch and retrytry: result = agent.start("Process this data")except RateLimitError: time.sleep(5) # Wrong! SDK already does this with jitter result = agent.start("Process this data")
Inspect TaskOutput.non_fatal_errors in your monitoring pipeline
Non-fatal errors indicate potential issues that should be tracked:
result = workflow.start()for error in result.non_fatal_errors: logger.warning(f"Non-fatal error in {task.name}: {error}") metrics.increment("task.non_fatal_error", tags={ "task": task.name, "error_type": type(error).__name__ })