temporalio / temporalio/temporal

Add ability to invoke the ParentClosePolicy on chain completion not the run completion.

Open
#3,666 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
23.2k
Forks
1.9k
Avg merge
2d 8h
Merged PRs (30d)
228

Description

Is your feature request related to a problem? Please describe.
When a parent calls continue-as-new the child behaves according to its ParentClosePolicy. A common scenario is to keep children running until the whole chain of parent continue-as-new calls is complete. In this case the only option is to set ParentClosePolicy to ABANDON. But it disables the ability to terminate all the children automatically when the parent is terminated.

Describe the solution you'd like
Add a flag that specifies if ParentClosePolicy applies when the chain is done or the run is done. Besides not being backward compatible, I propose to default it to when the whole chain is done. The strawman for the flag is parentClosePolicyScope with RUN, WORKFLOW_CHAIN (or just WORKFLOW).

If parentClosePolicyScope is set to WORKFLOW_CHAIN then terminating the last run of a workflow will terminate all the children started by the whole chain. This obviously should obey the parent retention interval as information about the past children started by deleted due to retention runs might not be available.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by locating the ParentClosePolicy handling and continue-as-new chain lifecycle logic, then define how RUN and WORKFLOW_CHAIN scopes interact with termination and retention. Done means the selected scope is supported without breaking existing behavior and the requested child-termination semantics are verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.