Skip to content

Add --region-id to compute-config scaling groups - #1239

Open
mani-j9 wants to merge 1 commit into
mani/cli-lambdafrom
mani/cli-region-id
Open

mani-j9 wants to merge 1 commit into
mani/cli-lambdafrom
mani/cli-region-id

Conversation

@mani-j9

@mani-j9 mani-j9 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Related issues

temporalio/api#875 (region_ids), released in api-go v1.64.0. Stacked on the compute-config command tree PR.

What changed?

  • aws-lambda create and aws-lambda update take --region-id, a single region. A scaling group with a region is only used while the Namespace is active in that region. Without --region-id, a new scaling group can be used in any region.
  • aws-lambda update --region-id on its own changes only the region. The region passed replaces the existing one, and other updates keep it.
  • compute-config describe shows each scaling group's region
  • version describe and describe-version show each scaling group's regionId in JSON, only when it has one, so output for scaling groups without a region is unchanged. The one-line ComputeConfigSummary stays as on main.
  • Bumps go.temporal.io/api to v1.64.0, the first release with region_ids, and go.temporal.io/sdk to v1.49.0, which renames StartActivityOptions.Details to StaticDetails.

Checklist

  • No breaking changes; adds a flag and output fields
  • Help text follows the style guide in commands.yaml
  • Functional tests (SharedServerSuite)

Manual tests

I ran these against a Temporal Cloud test cell with a Namespace replicated across aws-us-west-2 and aws-us-east-1, and an AWS Lambda function in each region. All of them behaved as expected.

Happy path

$ temporal worker deployment version compute-config aws-lambda create \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group aws-us-west-2 \
    --region-id aws-us-west-2 \
    --function-arn YourLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Successfully created worker deployment version

$ temporal worker deployment version compute-config describe \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID
Compute Config Scaling Groups:
  ScalingGroup  aws-us-west-2
  RegionId      aws-us-west-2
  Provider      aws-lambda
  Scaler        no-sync

Add scaling groups for both regions, and a fallback without a region:

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group aws-us-west-2 \
    --region-id aws-us-west-2 \
    --function-arn YourLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Successfully updated worker deployment version compute config

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group aws-us-east-1 \
    --region-id aws-us-east-1 \
    --function-arn YourOtherRegionLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Successfully updated worker deployment version compute config

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --function-arn YourLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Successfully updated worker deployment version compute config

$ temporal worker deployment version compute-config describe \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID
Compute Config Scaling Groups:
  ScalingGroup  aws-us-east-1
  RegionId      aws-us-east-1
  Provider      aws-lambda
  Scaler        no-sync

  ScalingGroup  aws-us-west-2
  RegionId      aws-us-west-2
  Provider      aws-lambda
  Scaler        no-sync

  ScalingGroup  default
  Provider      aws-lambda
  Scaler        no-sync

version describe keeps the same one-line summary as on main, and its JSON shows regionId on the regional scaling groups only:

$ temporal worker deployment version describe \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID
Worker Deployment Version:
  DeploymentName        YourDeploymentName
  BuildID               YourBuildID
  Status                created
  CreateTime            21 seconds ago
  RampPercentage        0
  LastModifierIdentity  YourIdentity
  ComputeConfigSummary  aws-lambda

$ temporal worker deployment version describe \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID -o json
{
  "deploymentName": "YourDeploymentName",
  "BuildID": "YourBuildID",
  "status": "created",
  "createTime": "2026-10-26T20:20:18.867293666Z",
  "rampPercentage": 0,
  "lastModifierIdentity": "YourIdentity",
  "taskQueuesInfos": null,
  "metadata": null,
  "computeConfig": {
    "scalingGroups": {
      "aws-us-east-1": {
        "regionId": "aws-us-east-1",
        "provider": {
          "type": "aws-lambda"
        },
        "scaler": {
          "type": "no-sync"
        }
      },
      "aws-us-west-2": {
        "regionId": "aws-us-west-2",
        "provider": {
          "type": "aws-lambda"
        },
        "scaler": {
          "type": "no-sync"
        }
      },
      "default": {
        "provider": {
          "type": "aws-lambda"
        },
        "scaler": {
          "type": "no-sync"
        }
      }
    }
  }
}

--region-id on its own changes only the region:

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group aws-us-west-2 \
    --region-id aws-us-east-1
Successfully updated worker deployment version compute config

$ temporal worker deployment version compute-config describe \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID
Compute Config Scaling Groups:
  ScalingGroup  aws-us-west-2
  RegionId      aws-us-east-1
  Provider      aws-lambda
  Scaler        no-sync

Other updates keep the region:

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group aws-us-east-1 \
    --scale-up-cooloff-ms 500
Successfully updated worker deployment version compute config

$ temporal worker deployment version compute-config describe \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID
Compute Config Scaling Groups:
  ScalingGroup  aws-us-east-1
  RegionId      aws-us-east-1
  Provider      aws-lambda
  Scaler        no-sync (scale_up_cooloff_ms 500)

  ScalingGroup  aws-us-west-2
  RegionId      aws-us-west-2
  Provider      aws-lambda
  Scaler        no-sync

  ScalingGroup  default
  Provider      aws-lambda
  Scaler        no-sync

Error cases

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group bad \
    --region-id '' \
    --function-arn YourLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Error: --region-id cannot be empty

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group bad \
    --region-id aws-us-west-2 \
    --task-queue-type workflow \
    --function-arn YourLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Error: unknown flag: --task-queue-type

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group second-catch-all \
    --region-id aws-us-east-1 \
    --function-arn YourOtherRegionLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Error: error updating worker deployment version compute config: entry second-catch-all: only one scaling group in region aws-us-east-1 can have no task types defined

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group not-found-group \
    --region-id aws-us-east-1
Error: error updating worker deployment version compute config: entry not-found-group: only one scaling group in region aws-us-east-1 can have no task types defined

The last one shows that update on a scaling group that doesn't exist is treated as adding a new scaling group, so the server's one-group-per-region check applies to it.

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group bad \
    --region-id not-a-region \
    --function-arn YourLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Successfully updated worker deployment version compute config

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group bad \
    --region-id gcp-us-central1 \
    --function-arn YourLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Successfully updated worker deployment version compute config

$ temporal worker deployment version compute-config describe \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID
Compute Config Scaling Groups:
  ScalingGroup  aws-us-east-1
  RegionId      aws-us-east-1
  Provider      aws-lambda
  Scaler        no-sync (scale_up_cooloff_ms 500)

  ScalingGroup  aws-us-west-2
  RegionId      aws-us-west-2
  Provider      aws-lambda
  Scaler        no-sync

  ScalingGroup  bad
  RegionId      gcp-us-central1
  Provider      aws-lambda
  Scaler        no-sync

  ScalingGroup  default
  Provider      aws-lambda
  Scaler        no-sync

Composition: remove the aws-us-west-2 scaling group, so the default fallback serves that region

$ temporal worker deployment version compute-config remove \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group aws-us-west-2
Successfully removed worker deployment version compute config

$ temporal worker deployment version compute-config describe \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID
Compute Config Scaling Groups:
  ScalingGroup  aws-us-east-1
  RegionId      aws-us-east-1
  Provider      aws-lambda
  Scaler        no-sync (scale_up_cooloff_ms 500)

  ScalingGroup  bad
  RegionId      gcp-us-central1
  Provider      aws-lambda
  Scaler        no-sync

  ScalingGroup  default
  Provider      aws-lambda
  Scaler        no-sync

@mani-j9
mani-j9 force-pushed the mani/cli-region-id branch from dce9828 to 704c430 Compare October 20, 2026 21:30
@mani-j9
mani-j9 marked this pull request as ready for review October 20, 2026 21:43
@mani-j9
mani-j9 requested a review from a team as a code owner October 20, 2026 21:43
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T20:29:51.041415Z fc81db4 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd70d5e6bb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread internal/temporalcli/commands.worker.deployment.version.go Outdated
Comment thread internal/temporalcli/commands.gen.go
Comment thread internal/temporalcli/commands.yaml Outdated
--deployment-name YourDeploymentName \
--build-id YourBuildID \
--scaling-group YourScalingGroup \
--region-id aws-us-west-2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"To update only the region of a scaling group, supply --region-id without the other flags."
What if --region-id is supplied, with a --scaling-group NotFoundGroup ? Will it a group with only region-id? Or will it fail? I think this scenario can apply to PR #1235 as well, for flags other than --region-id, that use invalid scaling-group.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it will fail with a message indicating that the scaling group doesn't exist.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correction - update doesn’t require the scaling group to exist. With a --scaling-group that doesn't exist, it adds a new scaling group, and the server validates it

  • With the provider flags, it creates the group.
  • With only --region-id, there’s no provider, so the server rejects it:
    Error: error updating worker deployment version compute config: entry not-found-group: invalid compute provider type ''
    A new group in a region that already has one is also rejected: “only one scaling group in region … can have no task types defined”.

Comment thread internal/temporalcli/commands.yaml
Comment thread internal/temporalcli/commands.worker.deployment.version.go Outdated
@mani-j9
mani-j9 force-pushed the mani/cli-region-id branch 2 times, most recently from 0b5d68f to 4b5580b Compare October 26, 2026 19:48

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b5580bf82

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if o.RegionId == "" {
return nil, fmt.Errorf("--region-id cannot be empty")
}
sg.RegionIds = []string{o.RegionId}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve regions in version describe output

When a scaling group is created with --region-id, worker deployment version describe -o json silently drops that routing information: formatComputeConfigProto in commands.worker.deployment.go:506-539 copies only the provider and scaler into formattedComputeConfigScalingGroup. Consequently, the general version-description command reports regional and fallback groups with otherwise identical JSON, so clients cannot reconstruct the configuration; add the region IDs to that formatter as well.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version describe keeps the same output as describe-version on main, that formatter shows each scaling group’s provider and scaler only, we can keep it the same and let users use compute-config describe for a detailed lookup response

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ks-temporal I’ve added regionId to each scaling group in the JSON output. I’d left it out at first because describe-version shares this formatter, but the field is omitted when a scaling group has no region. Regions can only be set through the new commands, so existing output doesn’t change.

I kept the text ComputeConfigSummary as it is on main. Adding regions there would read like aws-lambda,aws-lambda in aws-us-east-1,aws-lambda in aws-us-west-2, which doesn't seem useful to me. We can improve later on if needed.

@mani-j9
mani-j9 force-pushed the mani/cli-region-id branch from 4b5580b to fc81db4 Compare October 26, 2026 20:27
@mani-j9
mani-j9 requested a review from ks-temporal October 26, 2026 21:07
Comment thread go.mod
github.com/temporalio/ui-server/v2 v2.54.1
go.temporal.io/api v1.63.5
go.temporal.io/sdk v1.47.0
go.temporal.io/api v1.64.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is an API version bump, then this PR will need to wait until the next OSS server release to be part of the generic CLI release. Alternatively, it could go in cloud specific pre-releases of CLI but not the general CLI release.

If the --region-id feature is independent of the API version/change AND if you want these CLI PRs/changes to go in the end-of-month CLI release (without a new OSS server release), then I recommend using older api version (v1.63.5) that is part of the currently released OSS server.

On the other hand if the --region-id depends on the new OSS server release, then this is fine - just will wait until OSS server release.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean the breaking changes checkbox should be unchecked in the PR description?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. This is not a breaking change from what I can tell. The CLI build process will ensure that if this PR is included in the CLI release, then it will have an embedded server which uses an API version of 1.64.0 or higher; otherwise this PR will not be included in that CLI release.

From what I know, a breaking change is like removing an already defined option or command, or changing the semantics of the existing option or command. Adding a new option or bumping the API version to use newer API/SDK is not a breaking change.

This PR will likely be included in either a cloud-tagged pre-release CLI, which usually builds from new/recent tag from server "main" branch (which can be done anytime on demand), or the public CLI release after the next public OSS server release (which I believe is planned for mid Nov but could be delayed).

@gcristea-temporal gcristea-temporal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for clarifying the intent here.

@seanbollin

Copy link
Copy Markdown
Contributor

Is "Error: error updating worker deployment version compute config: entry not-found-group: only one scaling group in region aws-us-east-1 can have no task types defined" the expected output for the not found scaling group update? It's the last error cases example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants