WIP. runs all executors/agents in workflow sequantially.

This commit is contained in:
Shyju Krishnankutty
2026-01-14 12:33:54 -08:00
Unverified
parent 4340f37e97
commit 7f22a87a24
9 changed files with 288 additions and 18 deletions
@@ -224,4 +224,25 @@ public class Workflow
}
}
}
/// <summary>
/// Creates an instance of the specified executor.
/// </summary>
/// <param name="executorId">The identifier of the executor to create.</param>
/// <param name="runId">A unique identifier for the run context.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests.</param>
/// <returns>A <see cref="ValueTask{Executor}"/> representing the asynchronous operation.</returns>
/// <remarks>
/// This method is useful for Azure Functions scenarios where you need to create executor instances
/// outside of the normal workflow execution flow.
/// </remarks>
public async ValueTask<Executor> CreateExecutorInstanceAsync(string executorId, string runId, CancellationToken cancellationToken = default)
{
if (!this.ExecutorBindings.TryGetValue(executorId, out ExecutorBinding? binding))
{
throw new InvalidOperationException($"Executor '{executorId}' not found in workflow.");
}
return await binding.CreateInstanceAsync(runId).ConfigureAwait(false);
}
}