# Useful but Little-Known Features of ADK 2.0
🌍 What if a long-running agent workflow could pick up right where it left off after a failure, instead of starting over from scratch?
ADK 2.0's ResumabilityConfig records workflow execution state as event logs, allowing you to resume from the point of failure by specifying an invocation_id.
📌 Title: Workflow Resumption (ResumabilityConfig)
🔗 URL:
🧩 Overview
Setting ResumabilityConfig(is_resumable=True) on an App causes completed tasks to be logged as events during workflow execution. On failure, you can resume by providing the same invocation_id, and built-in agents automatically restore their state. SequentialAgent resumes from current_sub_agent, LoopAgent preserves times_looped and runs remaining iterations, and ParallelAgent executes only uncompleted sub-agents. This eliminates the waste of re-running completed steps when part of a large pipeline fails.
🛠 How to use it
Set ResumabilityConfig on the App and pass invocation_id when resuming.
```python
from adk import App, ResumabilityConfig
app = App(
agent=my_workflow,
resumability_config=ResumabilityConfig(is_resumable=True)
)
# Initial run
result = await "process data")
invocation_id = result.invocation_id
# Resume after failure (same invocation_id)
resumed_result = await
input="process data",
invocation_id=invocation_id
)
```
For custom agents that need resumability, extend BaseAgentState to persist your custom intermediate state.
🏗 Building it into production
・Store invocation_id in a database or message queue so it can be referenced during retries
・Ensure tool idempotency — tools run at least once and may re-run on resume
・For custom agents, extend BaseAgentState and explicitly define the intermediate state needed for resumption
・In long-running workflows, insert checkpoint steps at regular intervals to enable finer-grained resumption
💡 Use cases
📊 Efficiently recovering from mid-pipeline failures in large-scale data processing with dozens of steps
💰 Avoiding wasted API billing by not re-calling expensive external APIs on retry
🔄 Improving reliability of long-running agent execution in unstable network environments
🏭 Continuing batch processing when some items fail, without reprocessing completed ones
⚠️ Watch out
Tools may re-execute on resume (they run at least once), so any tool with side effects (database writes, external API calls, etc.) must be designed to be idempotent — the same input should always produce the same result regardless of how many times it runs. Also note that ParallelAgent resume granularity is at the sub-agent level; intermediate state within a sub-agent is not preserved.
✨ ResumabilityConfig dramatically simplifies the operation of long-running workflows. The ROI is especially high for pipelines that include expensive or time-consuming steps.
#
ADK# #
AIAgent#