Skip to content

Add standalone activity start delay support#691

Open
eamsden wants to merge 2 commits into
mainfrom
ea/saa-delay
Open

Add standalone activity start delay support#691
eamsden wants to merge 2 commits into
mainfrom
ea/saa-delay

Conversation

@eamsden
Copy link
Copy Markdown

@eamsden eamsden commented May 14, 2026

Expose StartDelay on StartActivityOptions, validate that it is non-negative, and pass it through to StartActivityExecutionRequest.

Add integration coverage for delayed standalone activity dispatch and document the new option.

What was changed

Added StartActivityOptions.StartDelay for standalone activities.

The client now validates that StartDelay is non-negative and maps it to StartActivityExecutionRequest.StartDelay when starting a standalone activity. The README standalone activity section now mentions the new option.

Added tests covering client-side rejection of negative start delays and an integration test that verifies a delayed standalone activity starts after the configured delay.

Why?

Standalone activities support delayed first dispatch at the service API level, but the .NET client was not exposing or wiring that field. This gives users a typed way to delay the first activity task without affecting retries.

Checklist

  1. Closes N/A

  2. How was this tested:
    dotnet format --verify-no-changes

dotnet build -p:RestoreLockedMode=true

dotnet test tests/Temporalio.Tests/Temporalio.Tests.csproj --no-restore --filter FullyQualifiedName~Temporalio.Tests.Client.TemporalClientActivityTests.StartActivityAsync_NegativeStartDelay_Throws

dotnet test tests/Temporalio.Tests/Temporalio.Tests.csproj --no-restore --filter FullyQualifiedName~Temporalio.Tests.Client.TemporalClientActivityTests.StartActivityAsync_StartDelay_WaitsProperly

  1. Any docs updates needed?
    README updated for standalone activity StartDelay. No docs.temporal.io update included.

@eamsden eamsden requested a review from a team as a code owner May 14, 2026 00:06
Copy link
Copy Markdown
Contributor

@maciejdudko maciejdudko left a comment

Choose a reason for hiding this comment

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

Looks good, just needs a small change in test setup.

[Fact]
public async Task StartActivityAsync_StartDelay_WaitsProperly()
{
await using var env = await Temporalio.Testing.WorkflowEnvironment.StartLocalAsync(new()
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.

Instead of this, use the default test env and set the CLI version and dynamic config globally:

DownloadVersion = "v1.7.0",

eamsden added 2 commits May 15, 2026 17:52
Expose StartDelay on StartActivityOptions, validate that it is non-negative, and pass it through to StartActivityExecutionRequest.

Add integration coverage for delayed standalone activity dispatch and document the new option.
Move the delayed standalone activity server version and dynamic config into the shared local test environment, then use the default client and worker helper in the start-delay test.
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.

2 participants