Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1.31 KB

suborchestrations.md

File metadata and controls

35 lines (24 loc) · 1.31 KB

Sub-orchestrations

Orchestrator functions can also call other orchestrator functions (sub-orchestrators).

Sub-orchestrations

This enables re-use of orchestrators, and keeping them small and maintainable. Just like activity functions, sub-orchestrators can be chained, or executed in parallel.

This is an example where two sub-orchestrators are chained:

[FunctionName(nameof(CollectAndUpdateGameStatsOrchestrator))]
public async Task Run(
    [OrchestrationTrigger] IDurableOrchestrationContext context,
    ILogger logger)
{
    var playerId = context.GetInput<string>();

    var playerGameStats = await context.CallSubOrchestratorAsync<PlayerGameStats>(
        nameof(CollectPlayerGameStatsOrchestrator),
        playerId);
    
    await context.CallSubOrchestratorAsync(
        nameof(UpdatePlayerGameStatsOrchestrator),
        playerGameStats);
}
    

Official Docs

Sub-orchestrations in Durable Functions


◀ Durable Functions | 🔼 Notify Support Challenge | 🔼 Fraud Detection Challenge | Eternal Orchestrations ▶