samples-python  by temporalio

Durable execution samples for Python applications

Created 4 years ago
360 stars

Top 77.6% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides a comprehensive collection of sample applications demonstrating the capabilities of the Temporal Python SDK. It targets developers building durable, scalable, and fault-tolerant applications using Temporal, offering practical examples to accelerate learning and adoption of advanced features. The samples showcase core Temporal concepts and integrations, serving as a valuable resource for understanding SDK usage patterns.

How It Works

The project organizes numerous Python scripts, each illustrating a specific Temporal feature or integration. These samples are designed to be run within a Python environment managed by uv, requiring a local Temporal server and the Temporal CLI. The core approach involves executing workflow and activity code, demonstrating concepts such as asynchronous operations, retries, cancellation, child workflows, signals, queries, and advanced patterns like external storage and encryption.

Quick Start & Requirements

  • Primary install/run command: Use uv sync to install dependencies, then uv run <sample_path> to execute samples (e.g., uv run hello/hello_activity.py).
  • Prerequisites: Python >= 3.10 (3.13 recommended), uv package manager, Temporal CLI, and a local Temporal server.
  • Links: Official Temporal Python SDK documentation (implied, not directly linked).

Highlighted Details

  • Extensive coverage of core Temporal features including activities, workflows, signals, queries, child workflows, retries, cancellation, and cron jobs.
  • Demonstrates advanced patterns such as external storage for large payloads (S3, Redis), end-to-end encryption, DSL workflows, and worker versioning.
  • Showcases integrations with AI/ML platforms like Amazon Bedrock, OpenAI Agents, LangGraph, and Strands Agents, enabling orchestration of complex AI applications.
  • Includes samples for custom data converters (Pydantic v1/v2), context propagation via interceptors, and replay testing for workflow code compatibility.

Maintenance & Community

No specific details regarding maintainers, community channels (e.g., Discord/Slack), or roadmaps are present in the provided text.

Licensing & Compatibility

The license type and compatibility notes for commercial use are not specified in the provided text.

Limitations & Caveats

Some samples require additional, non-default dependencies that must be installed per-directory. The pydantic_converter_v1 sample is specifically for Pydantic v1 models, with pydantic_converter recommended for v2. An "Experimental Test" section is noted, suggesting potential instability in testing infrastructure.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
9
Issues (30d)
0
Star History
17 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems").

ragbits by deepsense-ai

0.1%
2k
GenAI application development toolkit
Created 1 year ago
Updated 1 month ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Magnus Müller Magnus Müller(Cofounder of Browser Use), and
86 more.

langchain by langchain-ai

0.4%
141k
Framework for building LLM-powered applications
Created 3 years ago
Updated 1 day ago
Feedback? Help us improve.