Continue-As-New - .NET SDK feature guide
This page describes how to Continue-As-New using the Temporal .NET SDK.
Continue-As-New enables a Workflow Execution to close successfully and create a new Workflow Execution in a single atomic operation if the number of Events in the Event History is becoming too large. The Workflow Execution spawned from the use of Continue-As-New has the same Workflow Id, a new Run Id, and a fresh Event History and is passed all the appropriate parameters.
To Continue-As-New in .NET, throw an exception created by CreateContinueAsNewException()
from inside your Workflow, which will stop the Workflow immediately and Continue-As-New.
throw Workflow.CreateContinueAsNewException((MyWorkflow wf) => wf.RunAsync(myNewParam));