Skip to content

Instantly share code, notes, and snippets.

@geiltonxavier
Created May 4, 2025 16:45
Show Gist options
  • Save geiltonxavier/d6833cfb23fdc3b03f81745d6f5dc82d to your computer and use it in GitHub Desktop.
Save geiltonxavier/d6833cfb23fdc3b03f81745d6f5dc82d to your computer and use it in GitHub Desktop.
[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