.NET: [BREAKING] Unify ExecutorIsh and ExecutorRegistration, unify/simplify APIs (#1637)

* refactor: Unify ExecutorIsh and ExecutorRegistration => ExecutorBinding

* Switch to more modern Record type-tree for Sum Types
* Unify APIs for getting ExecutorBinding
* Fix an issue where workflows consisting entirely of cross-run shareable executors which are not instance-resettable do not properly clear state when running non-concurrently.

* feat: Simplify function-to-executor pattern

* refactor: Normalize API naming
This commit is contained in:
Jacob Alber
2025-11-03 18:20:35 +00:00
committed by GitHub
parent 91c66f8a2c
commit b25b0af49b
35 changed files with 939 additions and 595 deletions
@@ -69,7 +69,7 @@ public static class WorkflowVisualizer
lines.Add($"{indent}\"{MapId(startExecutorId)}\" [fillcolor=lightgreen, label=\"{startExecutorId}\\n(Start)\"];");
// Add other executor nodes
foreach (var executorId in workflow.Registrations.Keys)
foreach (var executorId in workflow.ExecutorBindings.Keys)
{
if (executorId != startExecutorId)
{
@@ -108,7 +108,7 @@ public static class WorkflowVisualizer
private static void EmitSubWorkflowsDigraph(Workflow workflow, List<string> lines, string indent)
{
foreach (var kvp in workflow.Registrations)
foreach (var kvp in workflow.ExecutorBindings)
{
var execId = kvp.Key;
var registration = kvp.Value;
@@ -145,7 +145,7 @@ public static class WorkflowVisualizer
lines.Add($"{indent}{MapId(startExecutorId)}[\"{startExecutorId} (Start)\"];");
// Add other executor nodes
foreach (var executorId in workflow.Registrations.Keys)
foreach (var executorId in workflow.ExecutorBindings.Keys)
{
if (executorId != startExecutorId)
{
@@ -264,9 +264,9 @@ public static class WorkflowVisualizer
#endif
}
private static bool TryGetNestedWorkflow(ExecutorRegistration registration, [NotNullWhen(true)] out Workflow? workflow)
private static bool TryGetNestedWorkflow(ExecutorBinding binding, [NotNullWhen(true)] out Workflow? workflow)
{
if (registration.RawExecutorishData is Workflow subWorkflow)
if (binding.RawValue is Workflow subWorkflow)
{
workflow = subWorkflow;
return true;