{"id":21978637,"url":"https://github.com/temporalio/temporal-pause-resume-compensate","last_synced_at":"2026-06-20T08:31:04.139Z","repository":{"id":230434660,"uuid":"779361343","full_name":"temporalio/temporal-pause-resume-compensate","owner":"temporalio","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-20T13:53:57.000Z","size":1005,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-06-03T05:41:59.943Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/temporalio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-03-29T16:54:32.000Z","updated_at":"2026-04-13T06:14:12.000Z","dependencies_parsed_at":"2024-04-05T02:36:54.772Z","dependency_job_id":"b48c7bd8-ca6f-48cb-9ed9-6c27e4d09ea1","html_url":"https://github.com/temporalio/temporal-pause-resume-compensate","commit_stats":null,"previous_names":["tsurdilo/sample-int","temporalio/temporal-pause-resume-compensate"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/temporalio/temporal-pause-resume-compensate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temporalio%2Ftemporal-pause-resume-compensate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temporalio%2Ftemporal-pause-resume-compensate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temporalio%2Ftemporal-pause-resume-compensate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temporalio%2Ftemporal-pause-resume-compensate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/temporalio","download_url":"https://codeload.github.com/temporalio/temporal-pause-resume-compensate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temporalio%2Ftemporal-pause-resume-compensate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34563535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"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":[],"created_at":"2024-11-29T16:25:50.718Z","updated_at":"2026-06-20T08:31:04.124Z","avatar_url":"https://github.com/temporalio.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Temporal Sample - Pause/Resume and Compensation\nDemos various aspects of [Temporal](https://temporal.io) using the [Java SDK](https://github.com/temporalio/sdk-java). The sample is a SpringBoot application.\n\nThe app will start 10 workflows. Each workflow has four activities and each activity has a chance to fail. Once an activity fails the workflow is paused. \nA signal is used to resume (retry) or fail workflow. Failing workflow triggers compensation and our SAGA. \nCompensation is done through async via a child workflow. \nSignals are sent to multiple workflows using a batch operation. \nThe workflow definition is provided as DSL (json) showing how to create a simple abstraction of steps to execution but still have the full powere of Temporal.\nWe of course always recommend to write your business logic fully via code which is much more powerful.\n\n\n| Prerequisites |   | __ | Features       |  | __ | Patterns            | |\n|:--------------|---|----|----------------|--|----|---------------------|-|\n| Java 17+      | ✅ | __  | Schedule       |  | __ | Entity              | |\n| Temporal CLI  | ✅   | __ | Local Activity |  ✅ | __ | Long-Running        | |\n|               |   | __ | Timer          | ✅ | __ | Fanout              | |\n|               |   | __ | Signal         | ✅ | __ | Continue As New     | |\n|               |   | __ | Query          |  | __ | Manual Intervention | ✅ |\n|               |   | __ | Update         |  | __ | Saga                | ✅ |\n|               |   | __ | Heartbeat      |  | __ | Long-polling        | |\n|               |   | __ | Retry          | ✅ | __ | Batch Operations    | ✅ |\n|               |   | __ | Data Converter |  | __ | DSL                 |  ✅ |\n|               |   | __ | Child Workflow | ✅ | __ |                  | |\n\n### Install Temporal CLI\n\nDetailed instructions are in docs https://docs.temporal.io/cli#install\n\n### Start Local Temporal Server\n```bash\n$ temporal server start-dev\n```\n\n### Create Search Attribute\n```bash\n$ temporal operator search-attribute create --name pause --type Bool --namespace default --address 127.0.0.1:7233\n```\n\n### Start app\n```bash\n$ mvn clean install spring-boot:run\n```\n\n### Access app\n     localhost:3003\n\n### Access Temporal UI\n    http://localhost:8233\n\n### How to use\n\n![Samle UI](./img/sampleint-1.png)\n\n#### Start workflows\nAs mentioned, some amount of workflows should complete and others which encounter a simulated activity failure will be paused (running). You can either retry or fail all paused workflows.\n\nThe UI workflow view shows we have completed most workflows but one is paused as they encountered simulated activity failure.\n\n![Start Workflows](./img/use_case_start_workflows.png)\n\n#### Retry workflows\nIn this case we send a retry signal and the workflows are resumed at the activity they left off with. This can be useful if for example, a downstream is unavailable and retrying makes no sense until the issue is resolved.\n\nThe UI timeline view of the workflows shows we have resumed workflow after initial failure.\n\n![Retry Workflows](./img/use_case_retry_paused_workflow.png)\n\n#### Fail workflows\nIn this case we send a fail signal and the workflows are failed. We run compensation in a child workflow using a SAGA which will rollback any changes that may have occurred. By doing the compensation in a child workflow, we have decoupled it and gained lots of visibility as well as flexibility. In case compensation workflow fails we can also for example, retry it.\n\nThe UI workflow view shows we have failed workflows.\n\n![Fail Workflows](./img/use_case_compensation.png)\n\n#### Retry compensation workflows\nIn case we failed paused workflows and the compensation workflow fails, we will have a paused running compensation workflow which we can now retry.\n\nThe UI timeline view of the workflows shows we have resumed compensation after initial failure.\n\n![Retry Compensation Workflows](./img/use_case_timeline_compensation.png)\n\n#### Fail compensation workflows\nIn case we failed paused workflows and the compensation failed, we will have a paused running compensation workflow which we can now fail.\n\nThe UI workflow view shows we have failed compensation workflows.\n\n![Fail Compensation Workflows](./img/use_case_failed_compensation.png)\n\n#### List Batch Operations\nWe are performing signals (retry or fail) on multiple workflows using batch operation. We can list all batch operations.\n\n![List Batch Operations](./img/use_case_batch_list.png)\n\n#### Stop Batch Operations\nWe are performing signals (retry or fail) on multiple workflows using batch operation. We can stop all batch operations.\n\n![Stop Batch Operations](./img/use_case_batch_stop.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemporalio%2Ftemporal-pause-resume-compensate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftemporalio%2Ftemporal-pause-resume-compensate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemporalio%2Ftemporal-pause-resume-compensate/lists"}