https://github.com/dbos-inc/dbos-transact-py Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + GitHub Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions By size + Enterprise + Teams + Startups By industry + Healthcare + Financial services + Manufacturing By use case + CI/CD & Automation + DevOps + DevSecOps * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} dbos-inc / dbos-transact-py Public * Notifications You must be signed in to change notification settings * Fork 0 * Star 57 Ultra-Lightweight Durable Execution in Python docs.dbos.dev License MIT license 57 stars 0 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 0 * Pull requests 0 * Actions * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Security * Insights dbos-inc/dbos-transact-py This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Last commit Last Name Name message commit date Latest commit History 98 Commits .github/workflows .github/workflows dbos dbos tests tests version version .gitignore .gitignore .pre-commit-config.yaml .pre-commit-config.yaml .pydocstyle .pydocstyle CONTRIBUTING.md CONTRIBUTING.md DEVELOPING.md DEVELOPING.md LICENSE LICENSE README.md README.md alembic.ini alembic.ini make_release.py make_release.py pdm.lock pdm.lock pyproject.toml pyproject.toml View all files Repository files navigation * README * MIT license DBOS Transact: Ultra-Lightweight Durable Execution Documentation * Examples * Github * Discord --------------------------------------------------------------------- DBOS Transact is a Python library providing ultra-lightweight durable execution. For example: @DBOS.step() def step_one(): ... @DBOS.step() def step_two(): ... @DBOS.workflow() def workflow() step_one() step_two() Durable execution means your program is resilient to any failure. If it is ever interrupted or crashes, all your workflows will automatically resume from the last completed step. If you want to see durable execution in action, check out this demo app (source code here). No matter how many times you try to crash it, it always resumes from exactly where it left off! Under the hood, DBOS Transact works by storing your program's execution state (which workflows are currently executing and which steps they've completed) in a Postgres database. So all you need to use it is a Postgres database to connect to--there's no need for a "workflow server." This approach is also incredibly fast, for example 25x faster than AWS Step Functions. Some more cool features include: * Scheduled jobs--run your workflows exactly-once per time interval. * Exactly-once event processing--use workflows to process incoming events (for example, from a Kafka topic) exactly-once. * Observability--all workflows automatically emit OpenTelemetry traces. Getting Started Install and configure with: pip install dbos dbos init --config Then, try it out with this simple program (requires Postgres): from fastapi import FastAPI from dbos import DBOS app = FastAPI() DBOS(fastapi=app) @DBOS.step() def step_one(): print("Step one completed!") @DBOS.step() def step_two(): print("Step two completed!") @DBOS.workflow() def dbos_workflow(): step_one() for _ in range(5): print("Press Control + \ to stop the app...") DBOS.sleep(1) step_two() @app.get("/") def fastapi_endpoint(): dbos_workflow() Save the program into main.py, edit dbos-config.yaml to configure your Postgres connection settings, and start it with fastapi run. Visit localhost:8000 in your browser to start the workflow. When prompted, press Control + \ to force quit your application. It should crash midway through the workflow, having completed step one but not step two. Then, restart your app with fastapi run. It should resume the workflow from where it left off, completing step two without re-executing step one. To learn how to build more complex workflows, see our programming guide or examples. Documentation https://docs.dbos.dev Examples * AI-Powered Slackbot -- A Slackbot that answers questions about previous Slack conversations, using DBOS to durably orchestrate its RAG pipeline. * Widget Store -- An online storefront that uses DBOS durable workflows to be resilient to any failure. * Earthquake Tracker -- A real-time earthquake dashboard that uses DBOS to stream data from the USGS into Postgres, then visualizes it with Streamlit. More examples here! Community If you're interested in building with us, please star our repository and join our community on Discord! If you see a bug or have a feature request, don't hesitate to open an issue here on GitHub. If you're interested in contributing, check out our contributions guide. About Ultra-Lightweight Durable Execution in Python docs.dbos.dev Topics python postgresql dbos Resources Readme License MIT license Activity Custom properties Stars 57 stars Watchers 0 watching Forks 0 forks Report repository Releases 2 0.6.1 Latest Sep 10, 2024 + 1 release Packages 0 No packages published Contributors 4 * @kraftp kraftp Peter Kraft * @qianl15 qianl15 Qian Li * @chuck-dbos chuck-dbos * @devhawk devhawk Harry Pierson Languages * Python 99.7% * Mako 0.3% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.