{"id":51841747,"url":"https://github.com/resonatehq/resonate-pg","last_synced_at":"2026-07-23T06:02:35.768Z","repository":{"id":371569705,"uuid":"1289319434","full_name":"resonatehq/resonate-pg","owner":"resonatehq","description":"Resonate Durable Execution in a single SQL file","archived":false,"fork":false,"pushed_at":"2026-07-22T16:40:04.000Z","size":2540,"stargazers_count":7,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-07-22T18:19:09.353Z","etag":null,"topics":["durable-execution","durable-promises","plpgsql","postgres","postgresql","resonate","sql","supabase","workflow-engine"],"latest_commit_sha":null,"homepage":"","language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/resonatehq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-04T15:43:29.000Z","updated_at":"2026-07-22T16:41:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/resonatehq/resonate-pg","commit_stats":null,"previous_names":["resonatehq/resonate-pg"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/resonatehq/resonate-pg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resonatehq%2Fresonate-pg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resonatehq%2Fresonate-pg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resonatehq%2Fresonate-pg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resonatehq%2Fresonate-pg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/resonatehq","download_url":"https://codeload.github.com/resonatehq/resonate-pg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resonatehq%2Fresonate-pg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35791264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-23T02:00:06.683Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["durable-execution","durable-promises","plpgsql","postgres","postgresql","resonate","sql","supabase","workflow-engine"],"created_at":"2026-07-23T06:02:35.018Z","updated_at":"2026-07-23T06:02:35.763Z","avatar_url":"https://github.com/resonatehq.png","language":"PLpgSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./assets/resonate-banner.png\"\u003e\n  \u003cimg alt=\"Resonate\" src=\"./assets/resonate-banner-light.png\"\u003e\n\u003c/picture\u003e\n\n# Resonate on Postgres\n\n**Dead simple durable execution.**\n\nResonate durable execution runs your code as a reliable workflow, checkpointing each step as a durable promise, sleeping for days, surviving crashes and restarts. resonate-pg is one SQL file. No additional servers, queues, or timers — Postgres, with pg_cron, is all three. Full Resonate docs live at [docs.resonatehq.io](https://docs.resonatehq.io).\n\n```ts\nresonate.register(\n  \"countdown\",\n  async function countdown(ctx: Context, n: number) {\n    for (let i = n; i \u003e 0; i--) {\n      await ctx.run(() =\u003e console.log(`countdown: ${i}`));\n      await ctx.sleep(10 * 60 * 1000); // durable: no process waits\n    }\n    await ctx.run(() =\u003e console.log(\"liftoff 🚀\"));\n  },\n);\n``` \n\nCrash the process, redeploy, or lose the machine mid-run — the workflow resumes on the right number, and nothing runs twice. Each `ctx.run` is checkpointed to Postgres as it completes, so a resumed run replays finished steps from the database instead of re-executing them. And `ctx.sleep` is just a row with a deadline: the invocation returns and nothing runs until it fires, whether that's ten minutes or ten days from now.\n\n\u003e **On Supabase?** [`example/countdown`](example/countdown) goes from an empty project to a running durable workflow in about five minutes.\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./assets/quickstart-banner.png\"\u003e\n  \u003cimg alt=\"Quickstart\" src=\"./assets/quickstart-banner-light.png\"\u003e\n\u003c/picture\u003e\n\n## Getting started\n\nresonate-pg is a Resonate Server in a single file running on Postgres 16+:\n\n```bash\npsql -d yourdb -f resonate.sql\n```\n\n**Extensions**\n\n- pg_cron *(required — drives all timers)*\n- pg_net or pgsql_http *(optional — either one enables HTTP push delivery)*\n\n## SDK\n\nYou write workflows with a Resonate SDK:\n\n- [TypeScript](https://github.com/resonatehq/resonate-sdk-ts)\n- [Python](https://github.com/resonatehq/resonate-sdk-py)\n- [Go](https://github.com/resonatehq/resonate-sdk-go)\n- [Java](https://github.com/resonatehq/resonate-sdk-java)\n- [Rust](https://github.com/resonatehq/resonate-sdk-rs)\n\n## Operations\n\nCompleted workflows stay in the database. Delete old ones on a schedule:\n\n```sql\n-- daily at 03:00: delete workflows finished more than 7 days ago\nselect cron.schedule('resonate-gc', '0 3 * * *',\n  $$select resonate.gc((extract(epoch from now())*1000 - 7*86400000)::bigint)$$);\n```\n\nKeep the horizon longer than any window in which you might re-send the same workflow id; ids are idempotent only while the row exists.\n\n## Under the hood\n\nresonate-pg is a faithful implementation of the Resonate protocol: every protocol action is a stored procedure, callable via resonate_rpc:\n\n```sql\nSELECT resonate.resonate_rpc('{\"kind\":\"promise.get\",\"head\":{},\"data\":{\"id\":\"invoke:foo\"}}');\n```\n\n## Community\n\nQuestions, ideas, or want to help? Join the [Resonate Discord](https://resonatehq.io/discord), or open an issue or pull request — contributions welcome. resonate-pg is part of [Resonate](https://github.com/resonatehq/resonate).\n\n## License\n\n[Apache 2.0](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresonatehq%2Fresonate-pg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fresonatehq%2Fresonate-pg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresonatehq%2Fresonate-pg/lists"}