Created
May 4, 2025 16:45
-
-
Save geiltonxavier/d6833cfb23fdc3b03f81745d6f5dc82d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FunctionName("OrchestrateWorkflow")] | |
public static async Task<List<string>> RunOrchestrator( | |
[OrchestrationTrigger] IDurableOrchestrationContext context) | |
{ | |
var outputs = new List<string>(); | |
// Call a task and wait for the result. | |
outputs.Add(await context.CallActivityAsync<string>("FetchData", "recordId")); | |
// Fan out parallel tasks | |
var tasks = new List<Task<string>> | |
{ | |
context.CallActivityAsync<string>("ProcessData", "param1"), | |
context.CallActivityAsync<string>("ProcessData", "param2") | |
}; | |
var results = await Task.WhenAll(tasks); | |
outputs.AddRange(results); | |
return outputs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment