resonate-basic-durable-world-usage-python

Create checkpointed Python durable functions with the generator-based Context API.

6|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/resonatehq/resonate-skills --skill resonate-basic-durable-world-usage-python
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: resonate-basic-durable-world-usage-python
Source: https://github.com/resonatehq/resonate-skills/tree/main/resonate-basic-durable-world-usage-python
Command: npx skills add https://github.com/resonatehq/resonate-skills --skill resonate-basic-durable-world-usage-python

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Durable functions in Resonate simplify building reliable, checkpointed workflows using Python generators and the Context API, enabling deterministic replay and safe side effects.

Core Features & Use Cases

  • Provides the Context API patterns (run, begin_run, rpc, begin_rpc, detached, promise, sleep) and determinism rules to ensure recoverable execution.
  • Demonstrates how to compose durable functions with dependency injection, time and randomness determinism, and distributed coordination for real-world tasks.
  • Includes practical examples showing sequential and parallel orchestration, and recursive workflows.

Quick Start

Invoke @resonate.register and define a generator-based function that yields ctx.run or ctx.rpc to create a durable, reproducible workflow.

Frequently Asked Questions about resonate-basic-durable-world-usage-python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build reliable checkpointed Python workflows with deterministic replay?

Build reliable checkpointed Python workflows by defining generator-based functions that yield Context API calls like ctx.run or ctx.rpc, enabling deterministic replay and safe side effects. Explicit registration with @resonate.register parameterizes the context for checkpoint-driven persistence.

What is a durable function in Python and how does it handle retries?

A durable function in Python is a generator-based workflow using the Context API that ensures recoverable execution through checkpoint-driven persistence. It handles retries safely by applying determinism rules to time and randomness, ensuring consistent state during replay.

How do I orchestrate parallel and sequential tasks using Python generators?

Orchestrate parallel and sequential tasks by composing durable functions with Context API patterns like run, rpc, and sleep. This generator-based approach supports single-process and distributed task coordination, including recursive workflows for complex orchestration.

Can I use dependency injection with Python durable functions?

Yes, you can use dependency injection with Python durable functions by composing generator-based workflows with the Context API. This parameterizes contexts and injects dependencies safely while maintaining deterministic replay and recoverable execution.

How do I ensure deterministic time and random behavior in distributed Python tasks?

Ensure deterministic time and random behavior in distributed Python tasks by applying the Context API's determinism rules within generator-based durable functions. This guarantees checkpointed replays produce consistent results during recoverable execution.

What are the limitations of using generator-based durable functions for workflow orchestration?

Generator-based durable functions require strict adherence to determinism rules for time, randomness, and side effects; non-deterministic operations outside the Context API break checkpoint-driven replay. Explicit registration and context parameterization are mandatory for persistence.